International Journal of Multidisciplinary Engineering Sciences | Volume 1 Issue 2 | Pages: 21-30 | Doi : 10.67914/ijmes/rsa/1.2/21-30
Research Article
OPEN ACCESS | Published on : 27-Aug-2026

Comparative Analysis of Deep Learning Algorithms for Forecasting Stock Market Returns in the Nigerian Exchange Market


    Abdulrahman Mohammed
  • Department of Computer Science, Federal Polytechnic Kaltungo, Gombe State, Nigeria.

  • Isah Muhammad Alhassan
  • Department of Computer Science, Azman University Kano State, Nigeria.

  • Aminu Adamu Ahmed
  • Department of Information Communication Technology, Federal Polytechnic Kaltungo, Gombe State, Nigeria.

Abstract

Deep learning has become a dominant paradigm for financial time series forecasting, yet comparative evidence on which recurrent architecture performs best for emerging-market return forecasting remains limited. This study conducts a systematic comparative analysis of three recurrent deep learning architectures: Long Short-Term Memory (LSTM), Gated Recurrent Unit (GRU) and Simple Recurrent Neural Network (Simple RNN) for forecasting one-day-ahead logarithmic returns of the Nigerian Stock Exchange (NSE) All-Share Index using 2,221 daily observations spanning January 2015 to December 2023, supplemented with a contextual update on the index's trajectory through July 2026 drawn from publicly reported market data. Eleven technical predictors were transformed into fifteen-day rolling sequences and used to train each architecture, implemented from first principles in Python/NumPy with an identical sixteen-hidden-unit configuration, Adam optimisation and chronological train-validation-test partitioning to ensure a controlled, like-for-like comparison. Model performance was evaluated on the held-out test set using root mean squared error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE) and the coefficient of determination (R²), benchmarked against a random-walk naive forecast and a random forest regressor. The LSTM achieved the lowest error among the three recurrent architectures (RMSE = 0.00846, MAE = 0.00571), outperforming GRU (RMSE = 0.00968) and Simple RNN (RMSE = 0.00934) and comfortably beating the naive random-walk benchmark (RMSE = 0.01045), while a random forest baseline achieved the lowest overall error (RMSE = 0.00827) among all five models evaluated, and the least negative R2 (-0.016), though all models produced R2 values below zero, reflecting the difficulty of explaining out-of-sample daily return variance for a single equity index. These results confirm the general superiority of gated recurrent architectures, and LSTM in particular, over simple recurrent networks for return forecasting, while also demonstrating that the marginal advantage of deep sequence models over well-tuned ensemble methods remains small for a single-index return series, consistent with weak-form market efficiency. The paper provides a transparent, reproducible comparative benchmark for deep learning-based return forecasting on the NSE and offers practical guidance for architecture selection in frontier-market applications.

Keywords

Deep Learning, LSTM, GRU, Recurrent Neural Network, Nigerian Stock Exchange, Stock Return Forecasting, Comparative Analysis

References

  • 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. https://doi.org/10.1371/journal.pone.0180944

    Bhandari, H. N., Rimal, B., Pokhrel, N. R., Rimal, R., Dahal, K. R., & Khatri, R. K. C. (2022). Predicting stock market index using LSTM. Machine Learning with Applications, 9, 100320. https://doi.org/10.1016/j.mlwa.2022.100320

    Chen, K., Zhou, Y., & Dai, F. (2015). A LSTM-based method for stock returns prediction: A case study of China stock market. In Proceedings of the 2015 IEEE International Conference on Big Data (pp. 2823–2824). IEEE.

    Cho, K., van Merriënboer, B., Gulcehre, C., Bahdanau, D., Bougares, F., Schwenk, H., & Bengio, Y. (2014). Learning phrase representations using RNN encoder-decoder for statistical machine translation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP) (pp. 1724–1734). Association for Computational Linguistics.

    Chung, J., Gulcehre, C., Cho, K., & Bengio, Y. (2014). Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv. https://arxiv.org/abs/1412.3555

    Cowrywise. (2026). The NGX returned 51% in 2025: Here's what young Nigerians need to know. Cowrywise Blog. https://cowrywise.com/blog/the-ngx-returned-51-in-2025-heres-what-young-nigerians-need-to-know/

    Elman, J. L. (1990). Finding structure in time. Cognitive Science, 14(2), 179–211. https://doi.org/10.1207/s15516709cog1402_1

    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. https://doi.org/10.1016/j.ejor.2017.11.054

    Gers, F. A., Schmidhuber, J., & Cummins, F. (2000). Learning to forget: Continual prediction with LSTM. Neural Computation, 12(10), 2451–2471.

    Hochreiter, S., & Schmidhuber, J. (1997). Long short-term memory. Neural Computation, 9(8), 1735–1780. https://doi.org/10.1162/neco.1997.9.8

    Nabipour, M., Nayyeri, P., Jabani, H., Mosavi, A., Salwana, E., & Shahab, S. (2020). Deep learning for stock market prediction. Entropy, 22(8), 840. https://doi.org/10.3390/e22080840

    Nelson, D. M. Q., Pereira, A. C. M., & de Oliveira, R. A. (2017). Stock market's price movement prediction with LSTM neural networks. In Proceedings of the 2017 International Joint Conference on Neural Networks (IJCNN) (pp. 1419–1426). IEEE. https://doi.org/10.1109/IJCNN.2017.7966019

    NGX Group. (2025). NGX ASI closes 2024 with +37% return. Nigerian Exchange Group Corporate Disclosures. https://ngxgroup.com/ngx-asi-closes-2024-with-37-return/

    NGX Pulse. (2026). Nigeria's stock market intelligence platform: Daily market summaries. https://ngxpulse.ng/

    Patel, J., Shah, S., Thakkar, P., & Kotecha, K. (2015). Predicting stock market index using fusion of machine learning techniques. Expert Systems with Applications, 42(4), 2162–2172. https://doi.org/10.1016/j.eswa.2014.10.031

    Rather, A. M., Agarwal, A., & Sastry, V. N. (2015). Recurrent neural network and a hybrid model for prediction of stock returns. Expert Systems with Applications, 42(6), 3234–3241. https://doi.org/10.1016/j.eswa.2014.12.003

    Roondiwala, M., Patel, H., & Varma, S. (2017). Predicting stock prices using LSTM. International Journal of Science and Research, 6(4), 1754–1756.

    Salisu, A. (2026). Application of machine learning and deep learning in stock price prediction: A comparative study using Dangote Cement Plc dataset from the Nigerian Stock Exchange. Global Journal of Artificial Intelligence and Technology Development, 4(1), 119–128. https://doi.org/10.46654/5da6a248

    Selvin, S., Vinayakumar, R., Gopalakrishnan, E. A., Menon, V. K., & Soman, K. P. (2017). Stock price prediction using LSTM, RNN and CNN-sliding window model. In Proceedings of the 2017 International Conference on Advances in Computing, Communications and Informatics (ICACCI) (pp. 1643–1647). IEEE.

    Sezer, O. B., Gudelek, M. U., & Ozbayoglu, A. M. (2020). Financial time series forecasting with deep learning: A systematic literature review: 2005–2019. Applied Soft Computing, 90, 106181. https://doi.org/10.1016/j.asoc.2020.106181

    Shen, G., Jiang, X., & Zhang, Y. (2018). Deep learning-based stock trend prediction: A comparison of LSTM and GRU architectures. In Proceedings of the 2018 International Conference on Machine Learning and Cybernetics.

    Sherstinsky, A. (2020). Fundamentals of recurrent neural network (RNN) and long short-term memory (LSTM) network. Physica D: Nonlinear Phenomena, 404, 132306. https://doi.org/10.1016/j.physd.2019.132306

    Siami-Namini, S., Tavakoli, N., & Siami Namin, A. (2018). A comparison of ARIMA and LSTM in forecasting time series. In Proceedings of the 17th IEEE International Conference on Machine Learning and Applications (ICMLA) (pp. 1394–1401). IEEE.

    Siami-Namini, S., Tavakoli, N., & Siami Namin, A. (2019). The performance of LSTM and BiLSTM in forecasting time series. In Proceedings of the 2019 IEEE International Conference on Big Data (pp. 3285–3292). IEEE.

    ThisDayLive. (2025). NGX ASI closes 2024 with impressive annual growth of 37.65%. THISDAYLIVE. https://thisdaylive.com/index.php/2025/01/01/ngx-asi-closes-2024-with-impressive-annual-growth-of-37-65.