Prediction of the Iran Stock Market Using an LSTM Network and DTW Algorithm
Subject Areas : Artificial Intelligence Tools in Software and Data Engineering
1 - Department of Computer Engineering, Marv.C., Islamic Azad University, Marvdasht, Iran
2 - Department of Computer Engineering, Marv.C., Islamic Azad University, Marvdasht, Iran
Keywords: Stock market, LSTM network, prediction, classification, recurrent neural network parameters, activation function,
Abstract :
The fluctuations, noise, and information load of the stock market necessitate efficient forecasting methods. The nonlinear and non-stationary nature of time-series data generated from the stock market makes predicting index prices complicated. In this dynamic market, intelligent forecasters develop analytical tools and predictive models that enable investors and traders to make informed decisions and reduce financial risks. Stock market data is categorized as a time series because it is generated regularly. Long Short-Term Memory (LSTM) networks are particularly effective for time-series forecasting. In this study, the trend of the Tehran Stock Exchange index and the Shapna stock has been predicted using an LSTM network. For data classification, the researchers compared the price of each day and the previous day. If the price increases or remains relatively stable compared to the last day, it is assigned to a class (1); if the price decreases, it is assigned to a class (-1). The DTW algorithm is used to compare the predicted results with actual values. By employing two-class classification and tuning the parameters of the LSTM network, model accuracy improved. Additionally, removing sections of the price chart affected by market excitement, considered outliers, played a key role in enhancing the prediction accuracy of the model
1. Yu, P. and X. Yan, Stock price prediction based on deep neural networks. Neural Computing and Applications, 2020. 32(6): p. 1609-1628.
2. Vismayaa, V., et al., Classifier based stock trading recommender systems for Indian stocks: An empirical evaluation. Computational Economics, 2020. 55(3): p. 901-923.
3. Nair, B.B., et al., A stock trading recommender system based on temporal association rule mining. SAGE Open, 2015. 5(2): p. 2158244015579941.
4. Möws, B., Deep Learning for Stock Market Prediction: Exploiting Time-Shifted Correlations of Stock Price Gradients. 2016.
5. Bohn, T.A., Improving long term stock market prediction with text analysis. 2017.
6. De Rossi, G., J. Kolodziej, and G. Brar, A recommender system for active stock selection. Computational Management Science, 2019: p. 1-31.
7. Patel, J., et al., Predicting stock and stock price index movement using trend deterministic data preparation and machine learning techniques. Expert systems with applications, 2015. 42(1): p. 259-268.
8. Janocha, K. and W.M. Czarnecki, On loss functions for deep neural networks in classification. arXiv preprint arXiv:1702.05659, 2017.
9. Bennett, K.P. and E. Parrado-Hernández, The interplay of optimization and machine learning research. The Journal of Machine Learning Research, 2006. 7: p. 1265-1281.
10. Nanopoulos, A., R. Alcock, and Y. Manolopoulos, Feature-based classification of time-series data. International Journal of Computer Research, 2001. 10(3): p. 49-61.
11. Hochreiter, S. and J. Schmidhuber, Long short-term memory. Neural Comput, 1997. 9(8): p. 1735-80.
12. Gers, F.A. and E. Schmidhuber, LSTM recurrent networks learn simple context-free and context-sensitive languages. IEEE Transactions on Neural Networks, 2001. 12(6): p. 1333-1340.
13. Graves, A. and A. Graves, Long short-term memory. Supervised sequence labelling with recurrent neural networks, 2012: p. 37-45.
14. Senin, P., Dynamic time warping algorithm review. Information and Computer Science Department University of Hawaii at Manoa Honolulu, USA, 2008. 855(1-23): p. 40.
15. Investments, H.A., Beating the Quants at Their Own Game. Seeking Alpha, 2021.