Stock Price Prediction Using Deep Learning Algorithms (RNN, LSTM and GRU) and Frequency Decomposition

Document Type : Research Paper

Authors

1 Assistant Professor, Department of Financial Engineering, Faculty of Accounting and Financial Sciences, University of Tehran, Tehran, Iran

2 Associate Professor, Department of Financial Engineering, Faculty of Accounting and Financial Sciences, University of Tehran, Tehran, Iran

3 M.Sc. Graduate, Department of Finance (Banking), Faculty of Accounting and Financial Sciences, University of Tehran, Tehran, Iran

Abstract

Predicting stock prices has become difficult due to the non-linearity and high volatility of financial time series. Despite significant advancements in various fields and the development of neural network models such as RNN, LSTM, and GRU, which have greatly improved the analysis of this type of data, complex and dynamic financial systems remain susceptible to noise, which can significantly impact their performance. However, complex and dynamic financial systems are highly susceptible to noise, which complicates the extraction of hidden features and patterns in time series data for deep learning models. Consequently, this reduces the learning ability and prediction accuracy of these models. Research has demonstrated that the method of Complementary Ensemble Empirical Mode Decomposition (CEEMD) may be effective in the analysis of financial time series. The current research aims to construct a model that is based on the analysis of time series to predict a step ahead. The CEEMD model and deep learning models like RNN, LSTM, GRU, and ARMA statistical models have been combined in four structures in this research. To evaluate the models, the data on the index of the Tehran Stock Exchange and the data of the 34 most active companies on the Tehran Stock Exchange from the time period of March 2017 to March 2202 have been used. According to this study, raw data analysis can make it easier to extract features and patterns for machine learning. The prediction accuracy of the CEEMD-ARMA-LSTN model has been 3% better than that of uncombined models.

Keywords

Main Subjects


 

Aggarwal, A., Gupta, I., Garg, N., & Goel, A. (2019). Deep learning approach to determine the impact of socio-economic factors on bitcoin price prediction. In 2019 Twelfth International Conference on Contemporary Computing (IC3) (pp. 1-5). IEEE.
Ali, M., Prasad, R., Xiang, Y., & Yaseen, Z. M. (2020). Complete ensemble empirical mode decomposition hybridized with random forest and kernel ridge regression model for monthly rainfall forecasts. Journal of Hydrology, 584, 124647.
Bao, W., Yue, J., & Rao, Y. (2017). A deep learning framework for financial time series using stacked autoencoders and long-short term memory. PLOS ONE, 12(7), e0180944.
Büyükşahin, Ü. Ç., & Ertekin, Ş. (2019). Improving forecasting accuracy of time series data using a new ARIMA-ANN hybrid method and empirical mode decomposition. Neurocomputing, 361, 151-163.
Chen, L., Chi, Y., Guan, Y., & Fan, J. (2019). A hybrid attention-based EMD-LSTM model for financial time series prediction. In 2019 2nd International Conference on Artificial Intelligence and Big Data (ICAIBD) (pp. 113-118). IEEE.
Chen, R., & Pan, B. (2016). Chinese stock index futures price fluctuation analysis and prediction based on complementary ensemble empirical mode decomposition. Mathematical Problems in Engineering, 2016(1), 3791504.
Choi, D. (2019). On empirical comparisons of optimizers for deep learning. arXiv preprint arXiv:1910.05446.
Fallahpour, S., & Alipour Reikandeh, J. (2014). Prediction of stock index using wavelet neural networks in Tehran Stock Exchange. Financial management strategy, 2(4), 15-31. (In Persian)
Fischer, T., & Krauss, C. (2018). Deep learning with long short-term memory networks for financial market predictions. European Journal of Operational Research, 270(2), 654-669
Gan, L., Wang, H., & Yang, Z. (2020). Machine learning solutions to challenges in finance: An application to the pricing of financial products. Technological Forecasting and Social Change, 153, 119928.
Hochreiter, S., & Schmidhuber, J. (1997). Long short-term memory. Neural Computation, 9(8), 1735-1780.
Hsieh, T. J., Hsiao, H. F., & Yeh, W. C. (2011). Forecasting stock markets using wavelet transforms and recurrent neural networks: An integrated system based on artificial bee colony algorithm. Applied Soft Computing, 11(2), 2510-2525.
Huang, N. E., Shen, Z., Long, S. R., Wu, M. C., Shih, H. H., Zheng, Q., & Liu, H. H. (1998). The empirical mode decomposition and the Hilbert spectrum for nonlinear and non-stationary time series analysis. Proceedings of the Royal Society of London. Series A: Mathematical, Physical and Engineering Sciences, 454(1971), 903-995.
Jin, Z., Yang, Y., & Liu, Y. (2020). Stock closing price prediction based on sentiment analysis and LSTM. Neural Computing and Applications, 32, 9713-9729.
Jothimani, D., & Yadav, S. S. (2019). Stock trading decisions using ensemble-based forecasting models: a study of the Indian stock market. Journal of Banking and Financial Technology, 3(2), 113-129.
Khashei, M., & Bijari, M. (2011). A novel hybridization of artificial neural networks and ARIMA models for time series forecasting. Applied Soft Computing, 11(2), 2664-2675.
Liu, Y. (2019). Novel volatility forecasting using deep learning–long short-term memory recurrent neural networks. Expert Systems with Applications, 132(1), 99-109.
Lv, P., Wu, Q., Xu, J., & Shu, Y. (2022). Stock index prediction based on time series decomposition and hybrid model. Entropy, 24(2), 146.
Masters, D., & Luschi, C. (2018). Revisiting small batch training for deep neural networks. arXiv preprint arXiv:1804.07612.
McNally, S. (2016). Predicting the price of Bitcoin using machine learning. Dissertation. National College of Ireland, Dublin, Ireland.
Motevasseli, M., & Taleb Kashefi, B. (2006). A comparative study of neural networks’ capabilities using indicators of technical analysis for forecasting of stock’s price. Journal of Economic Studies and Policies, 9(1), 57-82. (In Persian)
Nelson, D. M., Pereira, A. C., & De Oliveira, R. A. (2017). Stock market’s price movement prediction with LSTM neural networks. In 2017 International Joint Conference on Neural Networks (IJCNN) (pp. 1419-1426). IEEE.
Niu, H., Xu, K., & Wang, W. (2020). A hybrid stock price index forecasting model based on variational mode decomposition and LSTM network. Applied Intelligence, 50(3), 4296-4309
Polanco-Martínez, J. M. (2019). Dynamic relationship analysis between NAFTA stock markets using nonlinear, nonparametric, non-stationary methods. Nonlinear Dynamics, 97(1), 369-389.
Rezaei, H., Faaljou, H., & Mansourfar, G. (2021). Stock price prediction using deep learning and frequency decomposition. Expert Systems with Applications, 169(1), 114332.
Shafi, I., Ahmad, J., Shah, S. I., & Kashif, F. M. (2006). Impact of varying neurons and hidden layers in neural network architecture for a time frequency application. In 2006 IEEE International Multitopic Conference (pp. 188-193). IEEE.
Sinha, S., Singh, T. N., Singh, V. K., & Verma, A. K. (2010). Epoch determination for neural network by self-organized map (SOM). Computational Geosciences, 14(2), 199-206.
Sović, A., & Seršić, D. (2012). Signal decomposition methods for reducing drawbacks of the DWT. Engineering Review, 32(2), 70-77.
Xian, L., He, K., Wang, C., & Lai, K. K. (2020). Factor analysis of financial time series using EEMD-ICA based approach. Sustainable Futures, 2(1), 100003.
Xuan, Y., Yu, Y., & Wu, K. (2020, May). Prediction of short-term stock prices based on EMD-LSTM-CSI neural network method. In 2020 5th IEEE International Conference on Big Data Analytics (ICBDA) (pp. 135-139). IEEE.
Yeh, J. R., Shieh, J. S., & Huang, N. E. (2010). Complementary ensemble empirical mode decomposition: A novel noise enhanced data analysis method. Advances in Adaptive Data Analysis, 2(2), 135-156.
You, K., Long, M., Wang, J., & Jordan, M. I. (2019). How does learning rate decay help modern neural networks?
Zhang, G. P. (2003). Time series forecasting using a hybrid ARIMA and neural network model. Neurocomputing, 50, 159-175.
Zhang, X., Liang, X., Zhiyuli, A., Zhang, S., Xu, R., & Wu, B. (2019). At-lstm: An attention-based lstm model for financial time series prediction. In IOP Conference Series: Materials Science and Engineering, 569)5(, 052037. IOP Publishing.