Abstract

The unforeseen outbreak of the COVID-19 pandemic in early 2020 had a profound impact on the real economy and business sectors, leading to a period of heightened volatility. The stock price of smartphone brands had shown an abnormal trend of fluctuation and hard to be predicted by using the inchoate regression and machine learning models. In this paper, Long Short-Term Memory (LSTM) is adapted to predict the stock price of five top smartphone brands. Spanning the period from 2016 to 2021, the dataset for each brand contains 1258 data points, which are split into two groups, training set including 850 observations and test set including 408 observations after the pandemic in 2020. The model employed two prices as x and the next price as y to be predicted. The structure of the model in this work is composed of 3 layers, with 64 and 5 neurons in the first two LSTM layers respectively and a dense layer for dense equal to 1. The model is based on TensorFlow system with Adaptive Moment Estimation optimizer and Mean Absolute Error as the loss function. For the model checking, Root Mean Standard Error, Mean Absolute Error and R-square score are calculated to evaluate the precision of the prediction. Experimental results indicate that under an unexpected external condition, LSTM is effective in stock price prediction to a certain extent. Further investigations are still needed to improve LSTM applied in the stock market.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call