Intelligent Stock Price Prediction Using LSTM, GRU, ARIMA, and ARIMAX Models: Analysis and Performance Comparison
Abstract
This study examines and compares the performance of four-time series forecasting models, including ARIMA, ARIMAX, LSTM, and GRU, in forecasting the stock price of Iran Export Bank over 16 years (2009-2025). The data were prepared for modeling after performing preprocessing steps such as normalization. In the modeling section, the classical ARIMA models and the improved version of ARIMAX, which also consider exogenous variables (such as trading volume, moving average, and volatility), were used along with deep learning-based Recurrent Neural Networks (RNNs), namely LSTM and GRU. The results showed that the deep learning models LSTM and GRU performed significantly better than the classical models. Among the classical models, ARIMAX performed significantly better in forecasting than ARIMA, which had very poor performance. The LSTM model provided the most accurate forecasts and was able to model more than 98.67 percent of the data changes. The GRU model also performed close to LSTM, approximately 98.61, but its accuracy was slightly lower than LSTM. The results show that deep learning models, especially LSTM, perform better than classical models in simulating nonlinear patterns and long-term dependencies in financial data. Overall, deep learning-based models, especially LSTM, are powerful tools for predicting complex time series and can play an important role in investment decisions and analyzing stock market trends.
Keywords:
Time series, Deep learning, LSTM, GRU, ARIMAXReferences
- [1] Shaygani, M., & Nourbakhsh, A. (2023). Predicting stock prices in the tehran stock exchange with artificial intelligence. The second national conference on new developments in financial, economic and accounting studies. (In Persian). Civilica. https://civilica.com/doc/2116487
- [2] Abdi, N., MoradzadehFard, M., Ahmadzadeh, H., & Khoddam, M. (2024). A hybrid model for portfolio optimization based on stock price forecasting with LSTM recurrent neural network using multi-criteria decision making techniques and mean-CVaR. International journal of finance & managerial accounting, 9(35), 1–14. http://www.ijfma.ir/article_22706.html
- [3] Yaraqi, M., & Rabiei, A. (2021). Review and comparison of LSTM and GRU deep recurrent neural network algorithms in currency valuation time series data models. Computer science, 5(4), 40-50. (In Persian). https://dor.isc.ac/dor/20.1001.1.2538161.1399.5.4.4.1
- [4] Pai, P. F., & Lin, C. S. (2005). A hybrid ARIMA and support vector machines model in stock price forecasting. Omega, 33(6), 497–505. https://doi.org/10.1016/j.omega.2004.07.024
- [5] Gülmez, B. (2023). Stock price prediction with optimized deep LSTM network with artificial rabbits optimization algorithm. Expert systems with applications, 227, 120346. https://doi.org/10.1016/j.eswa.2023.120346
- [6] Zhang, R., Guo, Z., Meng, Y., Wang, S., Li, S., Niu, R., … & Li, Y. (2021). Comparison of ARIMA and LSTM in forecasting the incidence of HFMD combined and uncombined with exogenous meteorological variables in Ningbo, China. International journal of environmental research and public health, 18(11), 1–14. https://doi.org/10.3390/ijerph18116174
- [7] Ulyah, S. M. (2019). Forecasting index and stock returns by considering the effect of indonesia pre-presidential election 2019 using arimax and varx approches. Journal of physics: Conference series (Vol. 1277, p. 12053). IOP Publishing. https://iopscience.iop.org/article/10.1088/1742-6596/1277/1/012053/meta
- [8] Althelaya, K. A., El-Alfy, E. S. M., & Mohammed, S. (2018). Stock market forecast using multivariate analysis with bidirectional and stacked (lstm, Gru). 2018 21st saudi computer society national computer conference (NCC) (pp. 1–7). IEEE. https://doi.org/10.1109/NCG.2018.8593076
- [9] Jiang, W. (2021). Applications of deep learning in stock market prediction: Recent progress. Expert systems with applications, 184, 115537. https://doi.org/10.1016/j.eswa.2021.115537
- [10] Hu, Z., Zhao, Y., & Khushi, M. (2021). A survey of forex and stock price prediction using deep learning. Applied system innovation, 4(1), 1–30. https://doi.org/10.3390/asi4010009
- [11] Fitriyanto, N., & Kusrini, K. (2025). Optimasi prediksi harga emas menggunakan CNN-Bi-LSTM dengan mekanisme attention dan bayesian optimization. Journal of economic, management, accounting and technology, 8(1), 210–219. https://doi.org/10.32500/jematech.v8i1.8668
- [12] Biswas, M., Shome, A., Islam, M. A., Nova, A. J., & Ahmed, S. (2021). Predicting stock market price: a logical strategy using deep learning. 2021 IEEE 11th IEEE symposium on computer applications & industrial electronics (ISCAIE) (pp. 218–223). IEEE. https://doi.org/10.1109/ISCAIE51753.2021.9431817
- [13] Siami-Namini, S., Tavakoli, N., & Namin, A. S. (2018). A comparison of arima and lstm in forecasting time series. 2018 17th IEEE international conference on machine learning and applications (ICMLA) (pp. 1394–1401). IEEE. https://doi.org/10.1109/ICMLA.2018.00227
- [14] Atsalakis, G. S., & Valavanis, K. P. (2009). Surveying stock market forecasting techniques – Part II: Soft computing methods. Expert systems with applications, 36(3), 5932–5941. https://doi.org/10.1016/j.eswa.2008.07.006
- [15] Saud, A. S., & Shakya, S. (2020). Analysis of look back period for stock price prediction with RNN variants: A case study on banking sector of NEPSE. Procedia computer science, 167, 788–798. https://doi.org/10.1016/j.procs.2020.03.419
- [16] Esmaili, Z., & Torabipour, T. (2021). Providing a solution for predicting stock prices using lstm neural networks. 5th national conference on technology in electrical and computer engineering (TEC 2021). Civilica. https://civilica.com/doc/1281535
- [17] Darapaneni, N., Paduri, A. R., Sharma, H., Manjrekar, M., Hindlekar, N., Bhagat, P., … & Agarwal, Y. (2022). Stock price prediction using sentiment analysis and deep learning for Indian markets. ArXiv Preprint ArXiv:2204.05783. http://dx.doi.org/10.48550/arXiv.2204.05783
- [18] Zhong, Z., Wu, D., & Mai, W. (2023). Stock prediction based on ARIMA model and GRU model. Academic journal of computing & information science, 6(7), 114–123. https://francis-press.com/uploads/papers/OckW11Te0djE8HywqAEKr9zwq4KUu1vpVHKMwM5L.pdf
- [19] Yavasani, R., & Wang, H. (2023). Comparative analysis of LSTM, GRU, and ARIMA Models for stock market price prediction. Journal of student research, 12(4), 1–9.
- [20] Basher, S. A., & Sadorsky, P. (2022). Forecasting Bitcoin price direction with random forests: How important are interest rates, inflation, and market volatility? Machine learning with applications, 9, 100355. https://doi.org/10.1016/j.mlwa.2022.100351
- [21] Ghaderzadeh, H., & Ghasiri Darbande, S. (2020). Investigating the effect of oil price fluctuations on agricultural products using the Arimax model and neural network during the period. Agricultural economics research, 12(4), 189-204. (In Persian). https://www.ensani.ir/fa/article/432206/
- [22] Mohammadi Kabari, S. M. H., Khosravi, A., & Dohli, S. (2024). Daily stock price prediction using improved lstm. The first international conference on information technology, management and computers (pp. 1-8). (In Persian). Civilica. https://civilica.com/doc/2084244
Downloads
Published
Issue
Section
License
Copyright (c) 2025 Accounting and Auditing with Applications

This work is licensed under a Creative Commons Attribution 4.0 International License.