Gold Price Forecasting Using Tuned Gated Recurrent Units: Comparing Random Search and Bayesian Optimization

Authors

  • Morteza Moradi * Department of Industrial Engineering, Urmia University of Technology, Urmia, Iran.

https://doi.org/10.48314/anowa.v3i2.71

Abstract

Gold price forecasting has long been a significant area of empirical and academic research, given gold's role as a safe-haven asset and a hedge against market instability for investors and central banks worldwide. This paper predicts today’s gold closing price based on the previous ten-day Open, High, Low, and Closing (OHLC) prices. The Gated Recurrent Unit (GRU) was utilized for this prediction. However, GRU, like many other deep learning models, has numerous hyperparameters, the tuning of which directly impacts its performance. To address this, two common hyperparameter tuning methods, namely Random Search (RS) and Bayesian Optimization (BO), were employed. To determine the superior tuning method, Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), Mean Absolute Percentage Error (MAPE), and R², as well as tuning time, were compared using the non-parametric Mann-Whitney U test. Statistical analysis indicates that with 95% confidence, there is no statistically significant difference in any of the evaluated metrics between the two tuning methods. Only with approximately 90% confidence can it be stated that BO tunes the GRU more rapidly. In terms of performance metrics, the best parameter setting was achieved through RS, resulting in MAPE = 1.79% and R² = 99.07%. To the best of my knowledge, no comprehensive study to date has compared RS and BO tuning strategies in GRU-based gold price forecasting using multi-day OHLC data and a statistical method, highlighting the novelty of this research.   

Keywords:

Gold price, Forecasting, Gated recurrent unit, Hyperparameter tuning, Random search, Bayesian optimization

References

  1. [1] Reboredo, J. C. (2013). Is gold a safe haven or a hedge for the US dollar? Implications for risk management. Journal of banking & finance, 37(8), 2665–2676. https://doi.org/10.1016/j.jbankfin.2013.03.020

  2. [2] Pangestu, P., Rochman, A., & Zuhdi, A. (2023). The comparison of gold price prediction techniques using long short term memory (LSTM) and fuzzy time series (FTS) method. Intelmatics, 3(2), 57–62. https://doi.org/10.25105/itm.v3i2.17325

  3. [3] Livieris, I. E., Pintelas, E., & Pintelas, P. (2020). A CNN-LSTM model for gold price time-series forecasting. Neural computing and applications, 32(23), 17351–17360. https://doi.org/10.1007/s00521-020-04867-x

  4. [4] Putri, A. I., Syarif, Y., Aisyi, N. R., & Waeyusoh, N. (2025). Implementation of gated recurrent unit, long short-term memory and derivatives for gold price prediction. Public research journal of engineering, data technology and computer science, 2(2), 68–80. https://doi.org/10.57152/predatecs.v2i2.1609

  5. [5] Sudiatmika, I. P. G. A., Putra, I. M. A. W., & Artana, W. W. (2024). The implementation of gated recurrent unit (GRU) for gold price prediction using Yahoo finance data: A case study and analysis. Brilliance: Research of artificial intelligence, 4(1), 176–184. https://doi.org/10.47709/brilliance.v4i1.3865

  6. [6] Dewi, N. P. J. R., Ginantra, N. L. W. S. R., Darma, I. W. A. S., & Indrawan, I. G. A. (2023). Application of long short-term memory (LSTM) and gated recurrent unit (GRU) algorithm in gold price prediction. 2023 11th international conference on Cyber and IT service management (CITSM) (pp. 1-6). IEEE. https://doi.org/10.1109/CITSM60085.2023.10455749

  7. [7] Sentiko, S. L., & Zakiyyah, A. Y. (2024). Gold price prediction using machine learning and deep learning. 2024 6th international conference on cybernetics and intelligent system (ICORIS) (pp. 1-5). IEEE. https://doi.org/10.1109/ICORIS63540.2024.10903557

  8. [8] Yurtsever, M. (2021). Gold price forecasting using LSTM, Bi-LSTM and GRU. Avrupa bilim ve teknoloji dergisi, (31), 341–347. https://doi.org/10.31590/ejosat.959405

  9. [9] Aljohani, H., Alshamrani, S., Aljojo, N., Tashkandi, A., & Alsahfi, T. (2024). Predicting monthly gold prices in indian rupees using ARIMA, LSTM, GRU, and simple linear regression models. Romanian journal of information technology and automatic control, 34(2), 35-48. https://doi.org/10.33436/v34i2y202403

  10. [10] Gkonis, V., & Tsakalos, I. (2025). A hybrid optimized deep learning model via the Golden Jackal optimizer for accurate stock price forecasting. Expert systems with applications, 278, 127287. https://doi.org/10.1016/j.eswa.2025.127287

  11. [11] Bergstra, J., & Bengio, Y. (2012). Random search for hyper-parameter optimization. Journal of machine learning research, 13(2), 282–305. https://www.jmlr.org/papers/volume13/bergstra12a/bergstra12a.pdf

  12. [12] Shekhar, S., Bansode, A., & Salim, A. (2021). A comparative study of hyper-parameter optimization tools. 2021 IEEE Asia-Pacific conference on computer science and data engineering (CSDE) (pp. 1-6). IEEE. https://doi.org/10.1109/CSDE53843.2021.9718485

  13. [13] Victoria, A. H., & Maragatham, G. (2021). Automatic tuning of hyperparameters using Bayesian optimization. Evolving systems, 12(1), 217–223. https://doi.org/10.1007/s12530-020-09345-2

  14. [14] Zulfiqar, M., Gamage, K. A. A., Kamran, M., & Rasheed, M. B. (2022). Hyperparameter optimization of Bayesian neural network using Bayesian optimization and intelligent feature engineering for load forecasting. Sensors, 22(12), 4446. https://doi.org/10.3390/s22124446

  15. [15] Dezhkam, A., Manzuri, M. T., Aghapour, A., Karimi, A., Rabiee, A., & Shalmani, S. M. (2023). A Bayesian-based classification framework for financial time series trend prediction. The journal of supercomputing, 79(4), 4622–4659. https://doi.org/10.1007/s11227-022-04834-4

  16. [16] Olaniyan, J., Olaniyan, D., Obagbuwa, I. C., Esiefarienrhe, B. M., Adebiyi, A. A., & Bernard, O. P. (2024). Intelligent financial forecasting with granger causality and correlation analysis using Bayesian optimization and long short-term memory. Electronics, 13(22), 4408. https://doi.org/10.3390/electronics13224408

  17. [17] Switrayana, I. N., Hammad, R., Irfan, P., Sujaka, T. T., & Nasri, M. H. (2025). Comparative analysis of stock price prediction using deep learning with data scaling method. Jurnal teknologi informasi dan multimedia, 7(1), 78–90. https://doi.org/10.35746/jtim.v7i1.650

  18. [18] Mienye, I. D., Swart, T. G., & Obaido, G. (2024). Recurrent neural networks: A comprehensive review of architectures, variants, and applications. Information, 15(9), 517. https://doi.org/10.3390/info15090517

  19. [19] Hoque, K. E., & Aljamaan, H. (2021). Impact of hyperparameter tuning on machine learning models in stock price forecasting. IEEE access, 9, 163815–163830. https://doi.org/10.1109/ACCESS.2021.3134138

  20. [20] Sheskin, D. J. (2003). Handbook of parametric and nonparametric statistical procedures. Chapman and Hall/CRC. https://doi.org/10.1201/9781420036268

Published

2026-06-11

How to Cite

Moradi, M. . (2026). Gold Price Forecasting Using Tuned Gated Recurrent Units: Comparing Random Search and Bayesian Optimization. Annals of Optimization With Applications, 2(2), 108-116. https://doi.org/10.48314/anowa.v3i2.71

Similar Articles

1-10 of 15

You may also start an advanced similarity search for this article.