IDEAS home Printed from https://ideas.repec.org/a/spr/annopr/v334y2024i1d10.1007_s10479-021-04187-w.html
   My bibliography  Save this article

Forecasting gold price with the XGBoost algorithm and SHAP interaction values

Author

Listed:
  • Sami Ben Jabeur

    (Confluence: Sciences Et Humanités - UCLY, ESDES)

  • Salma Mefteh-Wali

    (ESSCA School of Management)

  • Jean-Laurent Viviani

    (University of Rennes 1, CNRS)

Abstract

Financial institutions, investors, mining companies and related firms need an effective accurate forecasting model to examine gold price fluctuations in order to make correct decisions. This paper proposes an innovative approach to accurately forecast gold price movements and to interpret predictions. First, it compares six machine learning models. These models include two very recent methods: the eXtreme Gradient Boosting (XGBoost) and CatBoost. The empirical findings indicate the superiority of XGBoost over other advanced machine learning models. Second, it proposes Shapley additive explanations (SHAP) in order to help policy makers to interpret the predictions of complex machine learning models and to examine the importance of various features that affect gold prices. Our results illustrate that the utilization of XGBoost along with SHAP approach could provide a significant boost in increasing the gold price forecasting performance.

Suggested Citation

  • Sami Ben Jabeur & Salma Mefteh-Wali & Jean-Laurent Viviani, 2024. "Forecasting gold price with the XGBoost algorithm and SHAP interaction values," Annals of Operations Research, Springer, vol. 334(1), pages 679-699, March.
  • Handle: RePEc:spr:annopr:v:334:y:2024:i:1:d:10.1007_s10479-021-04187-w
    DOI: 10.1007/s10479-021-04187-w
    as

    Download full text from publisher

    File URL: http://link.springer.com/10.1007/s10479-021-04187-w
    File Function: Abstract
    Download Restriction: Access to the full text of the articles in this series is restricted.

    File URL: https://libkey.io/10.1007/s10479-021-04187-w?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    As the access to this document is restricted, you may want to search for a different version of it.

    References listed on IDEAS

    as
    1. Krauss, Christopher & Do, Xuan Anh & Huck, Nicolas, 2017. "Deep neural networks, gradient-boosted trees, random forests: Statistical arbitrage on the S&P 500," European Journal of Operational Research, Elsevier, vol. 259(2), pages 689-702.
    2. Sephton, Peter & Mann, Janelle, 2018. "Gold and crude oil prices after the great moderation," Energy Economics, Elsevier, vol. 71(C), pages 273-281.
    3. Reboredo, Juan C., 2013. "Is gold a safe haven or a hedge for the US dollar? Implications for risk management," Journal of Banking & Finance, Elsevier, vol. 37(8), pages 2665-2676.
    4. Behmiri, Niaz Bashiri & Manera, Matteo, 2015. "The role of outliers and oil price shocks on volatility of metal prices," Resources Policy, Elsevier, vol. 46(P2), pages 139-150.
    5. Elie, Bouri & Naji, Jalkh & Dutta, Anupam & Uddin, Gazi Salah, 2019. "Gold and crude oil as safe-haven assets for clean energy stock indices: Blended copulas approach," Energy, Elsevier, vol. 178(C), pages 544-553.
    6. Schweikert, Karsten, 2018. "Are gold and silver cointegrated? New evidence from quantile cointegrating regressions," Journal of Banking & Finance, Elsevier, vol. 88(C), pages 44-51.
    7. Baur, Dirk G. & McDermott, Thomas K., 2010. "Is gold a safe haven? International evidence," Journal of Banking & Finance, Elsevier, vol. 34(8), pages 1886-1898, August.
    8. Yu-Chin Chen & Kenneth S. Rogoff & Barbara Rossi, 2010. "Can Exchange Rates Forecast Commodity Prices?," The Quarterly Journal of Economics, President and Fellows of Harvard College, vol. 125(3), pages 1145-1194.
    9. Rossen, Anja, 2015. "What are metal prices like? Co-movement, price cycles and long-run trends," Resources Policy, Elsevier, vol. 45(C), pages 255-276.
    10. Singhal, Shelly & Choudhary, Sangita & Biswal, Pratap Chandra, 2019. "Return and volatility linkages among International crude oil price, gold price, exchange rate and stock markets: Evidence from Mexico," Resources Policy, Elsevier, vol. 60(C), pages 255-261.
    11. Bodart, Vincent & Candelon, Bertrand & Carpantier, Jean-Francois, 2015. "Real exchanges rates, commodity prices and structural factors in developing countries," Journal of International Money and Finance, Elsevier, vol. 51(C), pages 264-284.
    12. Dirk G. Baur & Brian M. Lucey, 2010. "Is Gold a Hedge or a Safe Haven? An Analysis of Stocks, Bonds and Gold," The Financial Review, Eastern Finance Association, vol. 45(2), pages 217-229, May.
    13. Sensoy, Ahmet, 2013. "Dynamic relationship between precious metals," Resources Policy, Elsevier, vol. 38(4), pages 504-511.
    14. Christian Pierdzioch & Marian Risse & Sebastian Rohloff, 2015. "Forecasting gold-price fluctuations: a real-time boosting approach," Applied Economics Letters, Taylor & Francis Journals, vol. 22(1), pages 46-50, January.
    15. Beckmann, Joscha & Czudaj, Robert, 2013. "Gold as an inflation hedge in a time-varying coefficient framework," The North American Journal of Economics and Finance, Elsevier, vol. 24(C), pages 208-222.
    16. Basak, Suryoday & Kar, Saibal & Saha, Snehanshu & Khaidem, Luckyson & Dey, Sudeepa Roy, 2019. "Predicting the direction of stock market prices using tree-based classifiers," The North American Journal of Economics and Finance, Elsevier, vol. 47(C), pages 552-567.
    17. Parisi, Antonino & Parisi, Franco & Díaz, David, 2008. "Forecasting gold price changes: Rolling and recursive neural network models," Journal of Multinational Financial Management, Elsevier, vol. 18(5), pages 477-487, December.
    18. Yinghao Chen & Xiaoliang Xie & Tianle Zhang & Jiaxian Bai & Muzhou Hou, 2020. "A deep residual compensation extreme learning machine and applications," Journal of Forecasting, John Wiley & Sons, Ltd., vol. 39(6), pages 986-999, September.
    19. Christian Pierdzioch & Marian Risse & Sebastian Rohloff, 2016. "Fluctuations of the real exchange rate, real interest rates, and the dynamics of the price of gold in a small open economy," Empirical Economics, Springer, vol. 51(4), pages 1481-1499, December.
    20. Foued SaÂdaoui, 2012. "A probabilistic clustering method for US interest rate analysis," Quantitative Finance, Taylor & Francis Journals, vol. 12(1), pages 135-148, November.
    21. Climent, Francisco & Momparler, Alexandre & Carmona, Pedro, 2019. "Anticipating bank distress in the Eurozone: An Extreme Gradient Boosting approach," Journal of Business Research, Elsevier, vol. 101(C), pages 885-896.
    22. Baker, Rose & Forrest, David & Pérez, Levi, 2020. "Modelling demand for lotto using a novel method of correcting for endogeneity," Economic Modelling, Elsevier, vol. 84(C), pages 302-308.
    23. Liu, Yanxin & Li, Huajiao & Guan, Jianhe & Liu, Xueyong & Guan, Qing & Sun, Qingru, 2019. "Influence of different factors on prices of upstream, middle and downstream products in China's whole steel industry chain: Based on Adaptive Neural Fuzzy Inference System," Resources Policy, Elsevier, vol. 60(C), pages 134-142.
    24. Batten, Jonathan A. & Ciner, Cetin & Lucey, Brian M., 2010. "The macroeconomic determinants of volatility in precious metals markets," Resources Policy, Elsevier, vol. 35(2), pages 65-71, June.
    25. Mahdavi, Saeid & Zhou, Su, 1997. "Gold and commodity prices as leading indicators of inflation: Tests of long-run relationship and predictive performance," Journal of Economics and Business, Elsevier, vol. 49(5), pages 475-489.
    26. Ewees, Ahmed A. & Elaziz, Mohamed Abd & Alameer, Zakaria & Ye, Haiwang & Jianhua, Zhang, 2020. "Improving multilayer perceptron neural network using chaotic grasshopper optimization algorithm to forecast iron ore price volatility," Resources Policy, Elsevier, vol. 65(C).
    27. Mercadier, Mathieu & Lardy, Jean-Pierre, 2019. "Credit spread approximation and improvement using random forest regression," European Journal of Operational Research, Elsevier, vol. 277(1), pages 351-365.
    28. Nicolas Huck, 2019. "Large data sets and machine learning: Applications to statistical arbitrage," Post-Print hal-02143971, HAL.
    29. Bedoui, Rihab & Braiek, Sana & Guesmi, Khaled & Chevallier, Julien, 2019. "On the conditional dependence structure between oil, gold and USD exchange rates: Nested copula based GJR-GARCH model," Energy Economics, Elsevier, vol. 80(C), pages 876-889.
    30. Pesaran, M. Hashem & Smith, Ron P., 2019. "A Bayesian analysis of linear regression models with highly collinear regressors," Econometrics and Statistics, Elsevier, vol. 11(C), pages 1-21.
    31. Bhatia, Vaneet & Das, Debojyoti & Tiwari, Aviral Kumar & Shahbaz, Muhammad & Hasim, Haslifah M., 2018. "Do precious metal spot prices influence each other? Evidence from a nonparametric causality-in-quantiles approach," Resources Policy, Elsevier, vol. 55(C), pages 244-252.
    32. Cologni, Alessandro & Manera, Matteo, 2008. "Oil prices, inflation and interest rates in a structural cointegrated VAR model for the G-7 countries," Energy Economics, Elsevier, vol. 30(3), pages 856-888, May.
    33. Risse, Marian, 2019. "Combining wavelet decomposition with machine learning to forecast gold returns," International Journal of Forecasting, Elsevier, vol. 35(2), pages 601-615.
    34. Sari, Ramazan & Hammoudeh, Shawkat & Soytas, Ugur, 2010. "Dynamics of oil price, precious metal prices, and exchange rate," Energy Economics, Elsevier, vol. 32(2), pages 351-362, March.
    35. Pukthuanthong, Kuntara & Roll, Richard, 2011. "Gold and the Dollar (and the Euro, Pound, and Yen)," Journal of Banking & Finance, Elsevier, vol. 35(8), pages 2070-2083, August.
    36. Jiang, Cuiqing & Wang, Zhao & Zhao, Huimin, 2019. "A prediction-driven mixture cure model and its application in credit scoring," European Journal of Operational Research, Elsevier, vol. 277(1), pages 20-31.
    37. Fenghua Wen & Xin Yang & Xu Gong & Kin Keung Lai, 2017. "Multi-Scale Volatility Feature Analysis and Prediction of Gold Price," International Journal of Information Technology & Decision Making (IJITDM), World Scientific Publishing Co. Pte. Ltd., vol. 16(01), pages 205-223, January.
    38. Lardic, Sandrine & Mignon, Valérie, 2008. "Oil prices and economic activity: An asymmetric cointegration approach," Energy Economics, Elsevier, vol. 30(3), pages 847-855, May.
    39. Akbar, Muhammad & Iqbal, Farhan & Noor, Farzana, 2019. "Bayesian analysis of dynamic linkages among gold price, stock prices, exchange rate and interest rate in Pakistan," Resources Policy, Elsevier, vol. 62(C), pages 154-164.
    40. Liu, Chang & Hu, Zhenhua & Li, Yan & Liu, Shaojun, 2017. "Forecasting copper prices by decision tree learning," Resources Policy, Elsevier, vol. 52(C), pages 427-434.
    41. Lago, Jesus & De Ridder, Fjo & De Schutter, Bart, 2018. "Forecasting spot electricity prices: Deep learning approaches and empirical comparison of traditional algorithms," Applied Energy, Elsevier, vol. 221(C), pages 386-405.
    42. Neill Fortune, J., 1987. "The inflation rate of the price of gold, expected prices and interest rates," Journal of Macroeconomics, Elsevier, vol. 9(1), pages 71-82.
    43. Du, Pei & Wang, Jianzhou & Yang, Wendong & Niu, Tong, 2020. "Point and interval forecasting for metal prices based on variational mode decomposition and an optimized outlier-robust extreme learning machine," Resources Policy, Elsevier, vol. 69(C).
    44. Kearney, Adrienne A. & Lombra, Raymond E., 2009. "Gold and platinum: Toward solving the price puzzle," The Quarterly Review of Economics and Finance, Elsevier, vol. 49(3), pages 884-892, August.
    45. Sami Ben Jabeur & Amir Sadaaoui & Asma Sghaier & Riadh Aloui, 2020. "Machine learning models and cost-sensitive decision trees for bond rating prediction," Journal of the Operational Research Society, Taylor & Francis Journals, vol. 71(8), pages 1161-1179, August.
    46. Roberts, Mark C., 2009. "Duration and characteristics of metal price cycles," Resources Policy, Elsevier, vol. 34(3), pages 87-102, September.
    47. Zhang, Pinyi & Ci, Bicong, 2020. "Deep belief network for gold price forecasting," Resources Policy, Elsevier, vol. 69(C).
    48. Kucher, Oleg & McCoskey, Suzanne, 2017. "The long-run relationship between precious metal prices and the business cycle," The Quarterly Review of Economics and Finance, Elsevier, vol. 65(C), pages 263-275.
    49. Huck, Nicolas, 2019. "Large data sets and machine learning: Applications to statistical arbitrage," European Journal of Operational Research, Elsevier, vol. 278(1), pages 330-342.
    50. Capie, Forrest & Mills, Terence C. & Wood, Geoffrey, 2005. "Gold as a hedge against the dollar," Journal of International Financial Markets, Institutions and Money, Elsevier, vol. 15(4), pages 343-352, October.
    51. Kang, Sang Hoon & McIver, Ron & Yoon, Seong-Min, 2017. "Dynamic spillover effects among crude oil, precious metal, and agricultural commodity futures markets," Energy Economics, Elsevier, vol. 62(C), pages 19-32.
    52. Alameer, Zakaria & Elaziz, Mohamed Abd & Ewees, Ahmed A. & Ye, Haiwang & Jianhua, Zhang, 2019. "Forecasting gold price fluctuations using improved multilayer perceptron neural network and whale optimization algorithm," Resources Policy, Elsevier, vol. 61(C), pages 250-260.
    53. Ciner, Cetin, 2017. "Predicting white metal prices by a commodity sensitive exchange rate," International Review of Financial Analysis, Elsevier, vol. 52(C), pages 309-315.
    54. He, Yanan & Wang, Shouyang & Lai, Kin Keung, 2010. "Global economic activity and crude oil prices: A cointegration analysis," Energy Economics, Elsevier, vol. 32(4), pages 868-876, July.
    55. Shafiee, Shahriar & Topal, Erkan, 2010. "An overview of global gold market and gold price forecasting," Resources Policy, Elsevier, vol. 35(3), pages 178-189, September.
    56. Christian Pierdzioch & Marian Risse, 2020. "Forecasting precious metal returns with multivariate random forests," Empirical Economics, Springer, vol. 58(3), pages 1167-1184, March.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Alameer, Zakaria & Elaziz, Mohamed Abd & Ewees, Ahmed A. & Ye, Haiwang & Jianhua, Zhang, 2019. "Forecasting gold price fluctuations using improved multilayer perceptron neural network and whale optimization algorithm," Resources Policy, Elsevier, vol. 61(C), pages 250-260.
    2. Ewees, Ahmed A. & Elaziz, Mohamed Abd & Alameer, Zakaria & Ye, Haiwang & Jianhua, Zhang, 2020. "Improving multilayer perceptron neural network using chaotic grasshopper optimization algorithm to forecast iron ore price volatility," Resources Policy, Elsevier, vol. 65(C).
    3. O'Connor, Fergal A. & Lucey, Brian M. & Batten, Jonathan A. & Baur, Dirk G., 2015. "The financial economics of gold — A survey," International Review of Financial Analysis, Elsevier, vol. 41(C), pages 186-205.
    4. Perry Sadorsky, 2021. "Predicting Gold and Silver Price Direction Using Tree-Based Classifiers," JRFM, MDPI, vol. 14(5), pages 1-21, April.
    5. Al-Yahyaee, Khamis Hamed & Mensi, Walid & Maitra, Debasish & Al-Jarrah, Idries Mohammad Wanas, 2019. "Portfolio management and dependencies among precious metal markets: Evidence from a Copula quantile-on-quantile approach," Resources Policy, Elsevier, vol. 64(C).
    6. Qureshi, Saba & Rehman, Ijaz Ur & Qureshi, Fiza, 2018. "Does gold act as a safe haven against exchange rate fluctuations? The case of Pakistan rupee," Journal of Policy Modeling, Elsevier, vol. 40(4), pages 685-708.
    7. Syed Abul, Basher & Perry, Sadorsky, 2022. "Forecasting Bitcoin price direction with random forests: How important are interest rates, inflation, and market volatility?," MPRA Paper 113293, University Library of Munich, Germany.
    8. Nekhili, Ramzi & Sultan, Jahangir & Mensi, Walid, 2021. "Co-movements among precious metals and implications for portfolio management: A multivariate wavelet-based dynamic analysis," Resources Policy, Elsevier, vol. 74(C).
    9. Thi Hong Van Hoang & Amine Lahiani & David Heller, 2016. "Is gold a hedge against inflation? New evidence from a nonlinear ARDL approach," Post-Print hal-02012307, HAL.
    10. Hoang, Thi Hong Van & Lahiani, Amine & Heller, David, 2016. "Is gold a hedge against inflation? New evidence from a nonlinear ARDL approach," Economic Modelling, Elsevier, vol. 54(C), pages 54-66.
    11. Pierdzioch, Christian & Risse, Marian & Rohloff, Sebastian, 2016. "A boosting approach to forecasting the volatility of gold-price fluctuations under flexible loss," Resources Policy, Elsevier, vol. 47(C), pages 95-107.
    12. Raza Syed Ali & Shah Nida & Ali Muhammad & Shahbaz Muhammad, 2021. "Do Exchange Rates Fluctuations Influence Gold Price in G7 Countries? New Insights from a Nonparametric Causality-in-Quantiles Test," Zagreb International Review of Economics and Business, Sciendo, vol. 24(2), pages 37-57.
    13. Zhao, Jue & Hosseini, Shahab & Chen, Qinyang & Jahed Armaghani, Danial, 2023. "Super learner ensemble model: A novel approach for predicting monthly copper price in future," Resources Policy, Elsevier, vol. 85(PB).
    14. Mensi, Walid & Hernandez, Jose Arroeola & Yoon, Seong-Min & Vo, Xuan Vinh & Kang, Sang Hoon, 2021. "Spillovers and connectedness between major precious metals and major currency markets: The role of frequency factor," International Review of Financial Analysis, Elsevier, vol. 74(C).
    15. Vigne, Samuel A. & Lucey, Brian M. & O’Connor, Fergal A. & Yarovaya, Larisa, 2017. "The financial economics of white precious metals — A survey," International Review of Financial Analysis, Elsevier, vol. 52(C), pages 292-308.
    16. Nguyen, Quynh Nga & Bedoui, Rihab & Majdoub, Najemeddine & Guesmi, Khaled & Chevallier, Julien, 2020. "Hedging and safe-haven characteristics of Gold against currencies: An investigation based on multivariate dynamic copula theory," Resources Policy, Elsevier, vol. 68(C).
    17. Risse, Marian, 2019. "Combining wavelet decomposition with machine learning to forecast gold returns," International Journal of Forecasting, Elsevier, vol. 35(2), pages 601-615.
    18. Ntim, Collins G. & English, John & Nwachukwu, Jacinta & Wang, Yan, 2015. "On the efficiency of the global gold markets," International Review of Financial Analysis, Elsevier, vol. 41(C), pages 218-236.
    19. Wen, Danyan & Wang, Yudong & Ma, Chaoqun & Zhang, Yaojie, 2020. "Information transmission between gold and financial assets: Mean, volatility, or risk spillovers?," Resources Policy, Elsevier, vol. 69(C).
    20. Dichtl, Hubert, 2020. "Forecasting excess returns of the gold market: Can we learn from stock market predictions?," Journal of Commodity Markets, Elsevier, vol. 19(C).

    More about this item

    Keywords

    Gold price; XGBoost; CatBoost; Shapley additive explanations;
    All these keywords.

    JEL classification:

    • C22 - Mathematical and Quantitative Methods - - Single Equation Models; Single Variables - - - Time-Series Models; Dynamic Quantile Regressions; Dynamic Treatment Effect Models; Diffusion Processes
    • C45 - Mathematical and Quantitative Methods - - Econometric and Statistical Methods: Special Topics - - - Neural Networks and Related Topics
    • C53 - Mathematical and Quantitative Methods - - Econometric Modeling - - - Forecasting and Prediction Models; Simulation Methods
    • G12 - Financial Economics - - General Financial Markets - - - Asset Pricing; Trading Volume; Bond Interest Rates

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:spr:annopr:v:334:y:2024:i:1:d:10.1007_s10479-021-04187-w. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Sonal Shukla or Springer Nature Abstracting and Indexing (email available below). General contact details of provider: http://www.springer.com .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.