Integrated variable selection with hyperparameter-tuned random forest for modeling exchange rate volatility in Iraq
Abstract
This study proposes an integrated random forest framework to forecast exchange rate volatility in Iraq. Traditional econometric models often struggle with the high dimensionality and multicollinearity of macro‑financial indicators, which leads to overfitting and weak out‑of‑sample performance. To address these challenges, the paper develops an integrated sparrow search algorithm–random forest (ISSA‑RF) that jointly performs variable selection and hyperparameter tuning. In the first stage, a binary sparrow search algorithm (SSA) selects a parsimonious subset of relevant monetary variables, balancing prediction error and model complexity. In the second stage, a continuous SSA optimizes key random forest hyperparameters, including the number of trees, maximum depth, and node‑splitting thresholds. The empirical application uses monthly data from the central bank of Iraq and international sources covering 2004–2024, with a split between training (2004–2020) and testing (2021–2024) samples. Forecasting performance is evaluated using mean absolute error, root mean squared error, coefficient of determination, and directional accuracy, and ISSA‑RF is benchmarked against random search, Bayesian optimization, cross‑validation, grid search, and SSA‑tuned random forests without variable selection. The integrated approach selects six economically meaningful predictors, capturing domestic monetary conditions, foreign exchange interventions, and global monetary and inflation factors. Across both training and testing sets, ISSA‑RF consistently delivers the lowest forecast errors, the highest explanatory power, and the strongest directional accuracy, indicating substantial gains in both fit and generalization relative to all competing models. These results suggest that combining metaheuristic‑based variable selection with hyperparameter tuning can significantly enhance exchange rate volatility forecasting, providing policymakers and market participants with more reliable tools for risk management and macro‑financial surveillance in Iraq.
Fields of Study & Subjects
Rural and Ethnic Education
Linguistics and Education Research
Linguistics and Language Studies
Publication details
- Journal / source
- Statistics, Optimization & Information Computing (University of Cambridge)
- Publication date
- 19 September 2026
- Language
- EN