Gold Price Forecasting Using Machine Learning Models with Hyperparameter Optimization for Inflation Hedging

Gold Price Forecasting Machine Learning Deep Learning Hyperparameter Optimization Macroeconomic Indicators Inflation Hedge

Authors

  • Joan Sim Pei Suan Centre for Advanced Analytics, CoE for Artificial Intelligence & Faculty of Information Science and Technology, Multimedia University, Melaka 75450, Malaysia
  • Kalaiarasi Sonai Muthu Anbananthen
    kalaiarasi@mmu.edu.my
    Centre for Advanced Analytics, CoE for Artificial Intelligence & Faculty of Information Science and Technology, Multimedia University, Melaka 75450, Malaysia https://orcid.org/0000-0002-0540-2872
  • Raj Kumar Kanan Research Department of Computer Science, Bishop Heber College (Auto), Affiliated to Bharathidasan University Tiruchirappalli, Tamil Nadu, India

Downloads

Gold serves as a hedge against inflation, particularly in emerging markets such as Malaysia, where macroeconomic volatility is pronounced. This study evaluates the predictive performance of six machine learning models; comprising ensemble models (Random Forest, XGBoost, Gradient Boosting Machine, and LightGBM) and deep learning models (Long Short-Term Memory and Gated Recurrent Units) in forecasting Malaysia's gold prices using monthly macroeconomic data from 2009 to 2024. Key indicators include inflation rates, interest rates, exchange rates, oil prices, and stock indices. Hyperparameter tuning is performed using the Optuna framework by comparing three optimization strategies: Tree-structured Parzen Estimator (TPE), Grid Search, and Covariance Matrix Adaptation Evolution Strategy (CMA-ES). Experimental results show that Gradient Boosting, optimized via CMA-ES, achieves the best performance (RMSE = 101.26, R² = 0.9972) using the complete feature set. While deep learning models demonstrate improvements following optimization, ensemble models consistently outperform them due to better alignment with the static, cross-sectional nature of the dataset. Feature importance analysis identifies GP_Low, GP_High, and both domestic and international inflation and interest rates as the most significant predictors. This study contributes by benchmarking ensemble and deep learning models, evaluating multiple hyperparameter optimization strategies, and identifying key macroeconomic indicators relevant to gold price forecasting. The findings provide valuable insights for investors, financial analysts, and policymakers in economies sensitive to inflation.