Stock Price Prediction using LSTM and GRU
The stock market is more popular in recent years due to its high return rates. In spite of high risk, some investors and institutions still choose the stock market to invest. Therefore, the stock price index prediction has attracted the attention of both private and institution investors. In addition to its inherent complexity, there has been an unchanging argument on the predictability of stock returns and various of methods for predicting and modeling stock price index have been object of study of many different subjects, such as physics, economics, computer science and statistics. In 1970, Fama introduced the Efficient-Market hypothesis, which defines that the current price of an asset always reflects all of the previous available information.
It is worth mentioning that in 2012, it was estimated that about 85% of the transactions in the US stock market could be carried out by algorithms. Many methods have been used to forecast the stock price index, including traditional models and the recently popular neural network models. The traditional models include Autoregressive Integrated Moving Average(ARIMA), and Autoregressive Conditional Heteroskedasticity(GARCH) volatility. These models are based on the assumption that a linear correlation structure exists among time series values. Therefore, non linear patterns cannot be captured by these models. To overcome this limitation, neural network models have been widely used in the prediction of nonlinear time series such as stock price index.
Recurrent Neural Network(RNN) have been proved to be one of the most forceful models for processing sequential data, it can recognize complex nonlinear relationships which are difficult to capture using traditional forecasting models, Long Short-Term Memory(LSTM) and Gated Recurrent Unit(GRU) are the two most satisfactory RNN structures. LSTM adopts the memory cell, a unit of calculation, which displaces traditional artificial neuron in the hidden layers of the network. With these memory cells, networks are able to effectively link the memories and the new input, and seize the architecture of data dynamically, which make the prediction more accurate. GRU is very similar to LSTM, the main difference between them is that GRU does not have the output gate as in LSTM. On the basis of the two RNN structures, there are many improved models in recent years, such as the Bi-directional LSTM structure, which has also been used widely.
Note that, LSTM network has a longer memory capacity for preserving and processing the previous information, then, for large data, the LSTM network may derive better results. However, GRU is much faster than LSTM since it has fewer parameters. In this paper, we combined LSTM and GRU, and proposed a new Regularized GRU-LSTM network model with better performance. With this model, we predicted the closing prices of two stocks.