FORECASTING GLOBAL STOCK PRICES USING GATED RECURRENT UNIT, LONG SHORT-TERM MEMORY WEIGHTED-LSTM AND LSTM WITH ATTENTION
Abstract
This research assesses the forecasting potential of four deep learning models: Gated Recurrent Unit (GRU), Simple Long Short-Term Memory (LSTM), LSTM with Attention, and Weighted LSTM (W-LSTM), specifically for predicting stock prices in five African countries - Tanzania, South Africa, Nigeria, Kenya, and Morocco. The evaluation utilized historical price data, and model performance was measured using four metrics: Mean Squared Error (MSE), Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), and the Coefficient of Determination (R²). The GRU model consistently produced the lowest error rates and highest accuracy in South Africa (MSE: 0.87, MAE: 0.89, RMSE: 0.87, R²: 0.94) and Nigeria (MSE: 0.90, MAE: 0.89, RMSE: 0.92, R²: 0.93), demonstrating a strong predictive power in these regions. Meanwhile, in Kenya and Morocco, the Simple LSTM model excelled, achieving R² scores of 0.92 and 0.91, respectively, along with commendable MSE and RMSE figures (Kenya RMSE: 0.84, Morocco RMSE: 0.84). Although both the LSTM with Attention and W-LSTM models produced competitive results, they did not consistently achieve lower error metrics or higher R² values compared to the simpler models. These results indicate that streamlined architectures like GRU and LSTM are effective for stock price forecasting in emerging markets. The findings offer valuable insights into the predictive effectiveness of sophisticated recurrent neural network models. The study holds practical significance for financial organizations, investors, and policymakers in utilizing deep learning for informed decision-making and risk management, while pinpointing areas for future improvements in model development and data integration.
Downloads
