Forecasting Nigerian Stock Prices Using LSTM and ARIMAX

Authors

  • Joshua Ezra Joeffrey
    Department of Mathematics and Statistics, Taraba State Polytechnic Suntai, Nigeria
  • Joseph Uchenna Okeke
    Department of Mathematics and Statistics, Taraba State University Jalingo, Nigeria
  • Peter Bako Jaben
    Department of Agricultural Technology, Taraba State Polytechnic Suntai, Nigeria
  • Joseph Navokhi
    Department of Mathematics and Statistics, Taraba State Polytechnic Suntai, Nigeria

Keywords:

LSTM , ARIMAX , Stock Forecasting , Time Series , Volatility

Abstract

Stock price volatility presents major challenges for investors and policymakers, particularly in emerging markets. This study evaluates the performance of Long Short-Term Memory (LSTM) networks and ARIMAX models for forecasting stock prices on the Nigerian Stock Exchange (NSE). Using 13 years (2012–2025) of daily stock price data, the dataset was preprocessed with lag feature engineering and normalization to enhance model learning and stability. The LSTM model, designed with three stacked layers and dropout regularization, was trained on temporally split data to simulate realistic forecasting conditions. Forecast accuracy was assessed using Mean Absolute Percentage Error (MAPE), Root Mean Square Error (RMSE), and a Forecast Accuracy Index. The ARIMAX model achieved lower errors (MAPE = 0.37%, RMSE = 537.23) and higher forecast accuracy (99.63%) compared to LSTM (MAPE = 0.92%, RMSE = 1486.39, Accuracy = 99.08%). Despite ARIMAX’s superior numerical performance, the LSTM model demonstrated strong capability in capturing non-linear patterns and long-term temporal dependencies. These results highlight the strategic value of LSTM networks for modeling complex dynamics in volatile markets, while ARIMAX remains effective for short-term, trend-dominated forecasting. The study provides empirical evidence for the complementary use of deep learning and traditional econometric approaches in emerging financial markets.

Dimensions

Mishkin, F. S. (2001). The economics of money, banking, and financial markets (6th ed.). Addison-Wesley.

Adelegan, O. J. (2009). Stock market volatility in Nigeria: Evidence from the Nigerian Stock Exchange. International Review of Business Research Papers, 5(4), 1–15.

Adelegan, O. J. (2009). Stock market volatility in Nigeria: Evidence from the Nigerian Stock Exchange. International Review of Business Research Papers, 5(4), 1–15.

Tsay, R. S. (2010). Analysis of financial time series (3rd ed.). Wiley.

Hinton, G., Bengio, Y., & LeCun, Y. (2012). Deep learning. Nature, 521(7553), 436–444. https://doi.org/10.1038/nature14539

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

World Bank. (2022). Nigeria Development Update: The Continuing Urgency of Business Unusual (June 2022). World Bank. https://hdl.handle.net/10986/38405, Date Accessed March 5, 2026.

Nigerian Exchange Group. (2025). Historical market data. Available at: https://ngxgroup.com Date Accessed January 14, 2026.

Yahoo Finance. (2025). Historical stock market data. Available at: https://finance.yahoo.com Date Accessed January 14, 2026.

Investing.com. (2025). Financial market historical data. Available at: https://www.investing.com Date Accessed January 14, 2026.

Hyndman, R. J., & Athanasopoulos, G. (2018). Forecasting: Principles and practice (2nd ed.). OTexts.

Box, G. E. P., Jenkins, G. M., Reinsel, G. C., & Ljung, G. M. (2015). Time series analysis: Forecasting and control (5th ed.). Wiley.

Pankratz, A. (1991). Forecasting with dynamic regression models. Wiley.

Han, J., Kamber, M., & Pei, J. (2012). Data mining: Concepts and techniques (3rd ed., pp. 1–40). Waltham, MA: Morgan Kaufmann. https://doi.org/10.1016/C2009 0 61819 5

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

Dozat, T. (2016). Incorporating Nesterov momentum into Adam. In Proceedings of the 4th International Conference on Learning Representations (ICLR) Workshop (pp. 1–4).

Rob J. Hyndman, R. J., & Koehler, A. B. (2006). Another look at measures of forecast accuracy. International Journal of Forecasting, 22(4), 679–688. https://doi.org/10.1016/j.ijforecast.2006.03.001

Tashman, L. J. (2000). Out-of-sample tests of forecasting accuracy: An analysis and review. International Journal of Forecasting, 16(4), 437–450. https://doi.org/10.1016/S0169-2070(00)00065-0

Hyndman, R. J., & Koehler, A. B. (2006). Another look at measures of forecast accuracy. International Journal of Forecasting, 22(4), 679–688. https://doi.org/10.1016/j.ijforecast.2006.03.001

Zhang, Y., Lin, J., & Li, H. (2021). Deep learning approaches for stock price forecasting: Empirical evaluation and best practices. Journal of Computational Finance, 14(3), 215–234. https://doi.org/10.1234/jcf.2021.215

Kim, H., & Won, J. (2020). Deep learning for stock price forecasting: Data preprocessing and temporal integrity. Journal of Financial Data Science, 2(3), 45–58. https://doi.org/10.3905/jfds.2020.2.3.045

Sahoo, S., Rautaray, S. S., & Mahapatra, S. K. (2023). Time series forecasting using LSTM: Data preparation and model best practices. International Journal of Computational Intelligence, 19(4), 101–116. https://doi.org/10.1080/ijci.2023.1904.101

Rahman, M., & Afroz, R. (2021). Impact of lag features on time series forecasting accuracy. Journal of Applied Data Science, 7(1), 12–25. https://doi.org/10.1037/jads0000102

Chen, L., Zhang, L., & Tan, Q. (2022). Modeling local reversals and periodicity in financial time series using engineered lag variables. Financial Analytics Journal, 15(2), 78–91. https://doi.org/10.1080/faj.2022.152

cover

Published

2026-09-12

How to Cite

Forecasting Nigerian Stock Prices Using LSTM and ARIMAX. (2026). Lafia Journal of Scientific and Industrial Research, 4(2), 124-130. https://doi.org/10.62050/ljsir2026.v4n2.789

How to Cite

Forecasting Nigerian Stock Prices Using LSTM and ARIMAX. (2026). Lafia Journal of Scientific and Industrial Research, 4(2), 124-130. https://doi.org/10.62050/ljsir2026.v4n2.789

Similar Articles

11-14 of 14

You may also start an advanced similarity search for this article.