Research Article Open Access

Random Forest Based Feature Selection of Macroeconomic Variables for Stock Market Prediction

Isaac Kofi Nti1, Adebayo Felix Adekoya2 and Benjamin Asubam Weyori2
  • 1 Department of Computer Science, Sunyani Technical University (STU), Ghana
  • 2 Department of Computer Science and Informatics, University of Energy and Natural Resource, Sunyani-Fiapre, Ghana


A firm’s equity price on the stock-market is reported to be closely related to the Macroeconomic Variable (MVs) of the country in which the firm trades. For this reason, researchers, market traders, financial analysts and forecasters to examine the association between MVs and stock-price have carried out numerous studies, using time-series statistical analysis methods like Autoregressive Integrated Moving Average (ARIMA), Autoregressive Moving Average (ARMA) and Generalised Autoregressive Conditional Heteroscedasticity (GARCH). However, these techniques are reported to suffer from limited predictive power and restrictive assumptions. Besides, in pursuit of ways to remedy these paucities and limitations within these techniques, some researchers have examined uncountable machine learning techniques for measuring the stock-markets trends and making trading decisions using macroeconomic variables. On the other hand, a higher percentage of these studies paid attention to the stock index prediction and neglected the diversity of MVs that influence different sector indices. In addressing the issues above, this study seeks to examine the degree of significance between different sectors stock-price and MVs and predict a 30-day head stock-price using Random Forest (RF) with an improve leave-one-out cross-validation tactic and Long Short-Term Memory Recurrent Neural Network (LSTMRNN). An empirical analysis of the proposed model over the Ghana Stock Exchange (GSE) exhibits high prediction accuracy and better mean absolute error compared with other time-series techniques. It can, therefore, be inferred from the fallouts that the proposed stock-market prediction with MVs, provides an efficient approach to automatic identification and extraction of MVs that affect diverse sector stock and offer an accurate prediction of a stock's future price.

American Journal of Applied Sciences
Volume 16 No. 7, 2019, 200-212


Submitted On: 4 May 2019 Published On: 31 July 2019

How to Cite: Nti, I. K., Adekoya, A. F. & Weyori, B. A. (2019). Random Forest Based Feature Selection of Macroeconomic Variables for Stock Market Prediction. American Journal of Applied Sciences, 16(7), 200-212.

  • 69 Citations



  • Macroeconomic Variable
  • Inflation Rate
  • Recurrent Neural Network
  • Random Forest
  • Ghana Stock Exchange