Hybrid LSTM–XGBoost Model with Residual Error Correction for Multivariate Gold Price Forecasting Using Macroeconomic Indicators
Gold plays a critical role in financial markets and is widely regarded as a hedge and safe-haven asset during periods of economic uncertainty. Accurate gold price forecasting is therefore essential for investment strategy, portfolio allocation, and risk management. This study proposes a hybrid forecasting framework that integrates Long Short-Term Memory (LSTM) and Extreme Gradient Boosting (XGBoost) through explicit residual error correction for multivariate gold price prediction. Monthly gold prices and selected macroeconomic indicators, including CPI, DXY, US10Y, WTI, and S&P 500, covering the period from 2010 to 2025, are employed. The dataset consists of 192 monthly observations. Prior to modeling, logarithmic transformation, stationarity testing using the Augmented Dickey–Fuller (ADF) test, first-order differencing, and Min–Max normalization are applied to ensure statistical validity and numerical stability. The LSTM component captures temporal dependencies in sequential data, while the XGBoost model nonlinearly models residual structures to enhance predictive performance. A 12-month sliding-window mechanism is employed to capture annual temporal dependencies, and the XGBoost component is trained to learn residual errors not explained by the LSTM forecasts. Empirical results demonstrate that the proposed hybrid model achieves superior accuracy compared to standalone LSTM, XGBoost, and ARIMA baselines, obtaining an RMSE of 0.0989, an MAE of 0.0691, and a MAPE of 0.8503 in the testing period. Diebold–Mariano tests confirm that the hybrid model significantly outperforms both LSTM and ARIMA (p < 0.01). Walk-forward validation further indicates stable forecasting performance across rolling evaluation windows. The validation results demonstrate consistent predictive accuracy across multiple rolling windows, supporting the robustness and generalizability of the proposed framework. These findings suggest that integrating temporal learning with structured residual correction provides a robust, statistically grounded approach to multivariate gold price forecasting.
Keywords: Gold price forecasting, Hybrid LSTM–XGBoost, Multivariate forecasting, Residual learning, Time series forecasting, Walk-forward validation.
Baur, D. G., & McDermott, T. K. (2010). Is gold a safe haven? International evidence. Journal of Banking and Finance, 34(8), 1886–1898. https://doi.org/10.1016/j.jbankfin.2009.12.008
Bechere, M., Barkat, A., Ghenabzia, A., & Yiltas-Kaplan, D. (2025). Urban traffic prediction using hybrid XGBoost–LSTM model. International Journal of Computing and Digital Systems, 18(1), 1–15. https://doi.org/10.12785/ijcds/1571136041
Ben Ameur, H., Jamaani, F., & Abu Alfoul, M. N. (2024). Examining the safe-haven and hedge capabilities of gold and cryptocurrencies: A GARCH and regression quantiles approach in geopolitical and market extremes. Heliyon, 10(22), e40400. https://doi.org/10.1016/j.heliyon.2024.e40400
Box, G. E. P., & Cox, D. R. (1964). An analysis of transformations. Journal of the Royal Statistical Society Series B (Methodological), 26(2), 211–252. https://doi.org/10.1111/j.2517-6161.1964.tb00553.x
Box, G. E. P., Jenkins, G. M., Reinsel, G. C., & Ljung, G. M. (2016). Time series analysis: Forecasting and control (5th ed.). John Wiley & Sons.
Cerqueira, V., Torgo, L., & Mozetič, I. (2020). Evaluating time series forecasting models: An empirical study on performance estimation methods. Machine Learning, 109, 1997–2028. https://doi.org/10.1007/s10994-020-05910-7
Chen, T., & Guestrin, C. (2016). XGBoost: A scalable tree boosting system. Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD '16), 785–794. https://doi.org/10.1145/2939672.2939785
Dickey, D. A., & Fuller, W. A. (1979). Distribution of the estimators for autoregressive time series with a unit root. Journal of the American Statistical Association, 74(366), 427–431. https://doi.org/10.1080/01621459.1979.10482531
Diebold, F. X., & Mariano, R. S. (1995). Comparing predictive accuracy. Journal of Business & Economic Statistics, 13(3), 253–263. https://doi.org/10.1080/07350015.1995.10524599
Echaust, K., & Just, M. (2022). Is gold still a safe haven for stock markets? New insights through the tail thickness of portfolio return distributions. International Review of Financial Analysis, 84, 102388. https://doi.org/10.1016/j.irfa.2022.102388
Faraj, H., McMillan, D., & Al-Sabah, M. (2025). The diminishing luster: Gold’s market volatility and the fading safe haven effect. Global Finance Journal, 65, 101145. https://doi.org/10.1016/j.gfj.2025.101145
Hewamalage, H., Bergmeir, C., & Bandara, K. (2021). Recurrent neural networks for time series forecasting: Current status and future directions. International Journal of Forecasting, 37(1), 388–427. https://doi.org/10.1016/j.ijforecast.2020.06.008
Hochreiter, S., & Schmidhuber, J. (1997). Long short-term memory. Neural Computation, 9(8), 1735–1780. https://doi.org/10.1162/neco.1997.9.8.1735
Kontopoulou, V. I., Panagopoulos, A. D., Kakkos, I., & Matsopoulos, G. K. (2023). A review of ARIMA vs. machine learning approaches for time series forecasting in data-driven networks. Future Internet, 15(8), Article 255. https://doi.org/10.3390/fi15080255
Lim, B., & Zohren, S. (2021). Time-series forecasting with deep learning: A survey. Philosophical Transactions of the Royal Society A, 379(2194), Article 20200209. https://doi.org/10.1098/rsta.2020.0209
Madhika, Y. R., Kusrini, K., & Hidayat, T. (2023). Gold price prediction using the ARIMA and LSTM models. Sinkron: Jurnal dan Penelitian Teknik Informatika, 8(3), 1255–1264. https://doi.org/10.33395/sinkron.v8i3.12461
Makala, D., & Li, Z. (2021). Prediction of gold price with ARIMA and SVM. Journal of Physics: Conference Series, 1767(1), Article 012022. https://doi.org/10.1088/1742-6596/1767/1/012022
Mun, W. K., Sufahani, S. F., Kamil, A. A., & Nawawi, M. K. M. (2025). Prediction of gold prices using hybrid model ARIMA-LSTM. Advances and Applications in Statistics, 92(5), 749–766. https://doi.org/10.17654/0972361725031
Nasir, J., Iftikhar, H., Aamir, M., Iftikhar, H., Rodrigues, P. C., & Rehman, M. Z. (2025). A hybrid LMD–ARIMA–machine learning framework for enhanced forecasting of financial time series: Evidence from the NASDAQ composite index. Mathematics, 13(15), Article 2389. https://doi.org/10.3390/math13152389
Nensi, A. I. E., Al Maida, M., Notodiputro, K. A., Angraini, Y., & Mualifah, L. N. A. (2025). Performance analysis of ARIMA, LSTM, and hybrid ARIMA-LSTM in forecasting the composite stock price index. CAUCHY: Jurnal Matematika Murni dan Aplikasi, 10(2), 588–604. https://doi.org/10.18860/cauchy.v10i2.33379
Pendaraki, K., & Charda, M. (2025). Investigating the dynamic connection between gold and stock markets during crises. Journal of Risk and Financial Management, 18(12), Article 694. https://doi.org/10.3390/jrfm18120694
Qiu, C., Zhang, Y., Qian, X., Wu, C., Lou, J., Chen, Y., et al. (2024). A two-stage deep fusion integration framework based on feature fusion and residual correction for gold price forecasting. IEEE Access, 12, 85565–85579. https://doi.org/10.1109/ACCESS.2024.3408837
Quang, P. D., & Thang, T. Q. (2025). Analysis and forecasting of daily global gold price: An SARIMA-LSTM approach with Random Forest technique. Cogent Economics & Finance, 13(1), 2568969. https://doi.org/10.1080/23322039.2025.2568969
Saini, A., Singh, R. K., & Sinha, P. (2025). Forecasting gold price using hybrid deep neural network LSTM-autoencoder. Discover Artificial Intelligence, 5, 281. https://doi.org/10.1007/s44163-025-00464-w
Tan, B., Gan, Z., & Wu, Y. (2023). The measurement and early warning of daily financial stability index based on XGBoost and SHAP: Evidence from China. Expert Systems with Applications, 227, 120375. https://doi.org/10.1016/j.eswa.2023.120375
Taneva-Angelova, G., Raychev, S., & Ilieva, G. (2025). A framework for gold price prediction combining classical and intelligent methods with financial, economic, and sentiment data fusion. International Journal of Financial Studies, 13(2), Article 102. https://doi.org/10.3390/ijfs13020102
Yi, S. N. C., Chew, L. M., & Yeng, O. L. (2023). Gold prices forecasting using bidirectional LSTM model based on SPX500 index, USD index, crude oil prices and CPI. Proceedings of the 2023 IEEE 11th International Conference on Information and Communication Technology (ICoICT), 539–544. https://doi.org/10.1109/ICoICT58202.2023.10262481
Zangana, H. M., & Obeyd, S. R. (2024). Deep learning-based gold price prediction: A novel approach using time series analysis. Sistemasi: Jurnal Sistem Informasi, 13(6), 2581–2591. https://doi.org/10.32520/stmsi.v13i6.4651
Zhan, Z., & Kim, S.-K. (2024). Versatile time-window sliding machine learning techniques for stock market forecasting. Artificial Intelligence Review, 57, Article 209. https://doi.org/10.1007/s10462-024-10851-x
Zhao, Y., Guo, Y., & Wang, X. (2025). Hybrid LSTM–Transformer architecture with multi-scale feature fusion for high-accuracy gold futures price forecasting. Mathematics, 13(10), 1551. https://doi.org/10.3390/math13101551
Zhou, J. (2025). A dynamic weighted fusion-based hybrid XGBoost-LSTM model for financial distress prediction. Proceedings of the 2nd Guangdong-Hong Kong-Macao Greater Bay Area International Conference on Digital Economy and Artificial Intelligence (DEAI 2025). https://doi.org/10.1145/3745238.3745276
Refbacks
- There are currently no refbacks.

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
The copyright is reserved to Research in Education, Technology, and Multiculture that is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Address:
CV. IMRECS: Jalan Gagak I, Kecamatan Larangan, Kota Tangerang. Postal Code: 15155
STKIP Al Islam Tunas Bangsa: Jalan Z.A. Pagar Alam No. 41 Gedong Meneng Bandar Lampung
