Background: The challenge of forecasting stock prices in the capital markets of developing countries, such as
Nigeria, persists. Traditional statistical models, such as the Autoregressive Integrated Moving Average (ARIMA)
which have mostly been used for this purpose, are no longer as effective as they are limited in their ability to
handly non-linear time-series data. This study investigates the predictive powers of the ARIMA model against
selected machine learning algortihms such as Random Forest (RF), Support Vector Regression (SVR), and Long
Short-Term Memory (LSTM) networks, for some selected stocks from the Nigerian Exchange Group (NGX).
Materials and Methods: The study employed an ex-post facto research design, and utilized historical stock price
data of five major companies on the Nigeria Exchange Group (NGX) from 2015 to 2022. Stationarity tests were
conducted using Augmented Dickey Fuller (ADF) and thereafter, the ARIMA model was specified using
Autocorrelation function (ACF) and Partial Autocorrelation function (PACF) analysis. The Machine Learning
models were evaluated using hyperparameter tuning and time-series cross-validation. The Root Mean Squared
Error (RMSE), Mean Absolute Error (MAE) and Mean Absolute Percentage Error (MAPE) were utilized for the
assessment of the forecasting accuracy of the ARIMA model and the Machine Learning models.
Results: Random Forest had the lowest MAPE, MAE and RMSE for four out of the five stocks indicating that it
was the most adequate model for the forecasting of stock prices in Nigeria. Support Vector Regression was second
for 4 of the 5 stocks and also had the lowest MAPE, MAE and RMSE for one of the stocks. Random Forest and
Support Vector Regression both outperformed ARIMA for all 5 stocks, while ARIMA outperformed Long ShortTerm Memory model., this could be due to overfitting of the model.
Conclusion: In summary, the findings of the study show that Random Forest models and Support Vector
Regression models are better predictors of the stock market prices in Nigeria. Their superior forecasting capacity
challenges the weak-form Efficient Market Hypothesis, which in turns suggests the presence of exploitable nonlinear patterns in the Nigeria Exchange Group.
Recommendation: The study recommends the integration of Machine Learning Algorithms such as Random
Forest, into equity analysis and trading systems to improve the forecast accuracy and portfolio returns in the
Nigerian Market.