Optimizing Gated Recurrent Unit (GRU) for Gold Price Prediction: Hyperparameter Tuning and Model Evaluation on Historical XAU/USD Data

Authors

  • Abdul Faqih Department of Informatics Engineering, University of Nahdlatul Ulama Sunan Giri
  • Muhammad Jauhar Vikri Department of Informatics Engineering, University of Nahdlatul Ulama Sunan Giri
  • Ita Aristia Sa’ida Department of Informatics Engineering, University of Nahdlatul Ulama Sunan Giri

DOI:

https://doi.org/10.32736/sisfokom.v14i2.2352

Keywords:

Gated Recurrent Unit (GRU), Gold Price Prediction, Hyperparameter Optimization, Time Series

Abstract

This study investigates the use of a Gated Recurrent Unit (GRU) model with a four-layer architecture for daily gold price closing prediction, motivated by the model's ability to effectively capture temporal dependencies in time series data. Gold price forecasting is highly challenging due to its volatility and external factors, making it an important area of research for investors and financial analysts. By systematically optimizing hyperparameters through 72 combinations of epochs, batch size, GRU layer units, and dropout rates, the study identifies the optimal configuration (100 epochs, batch size of 16, 256 units, dropout rate 0.1) based on MSE performance on validation data. The best model achieved MAE of 25.76, MSE of 954.97, and RMSE of 30.90, after inverse transformation on test data. These results highlight the potential of the GRU model in accurately forecasting gold prices, with implications for financial decision-making . However, the prediction error suggests that further improvements could be made by incorporating external factors or exploring advanced model architectures.

References

M. Fauzi, M. Jauhar Vikri, and S. Wahyudhi, ‘Sistem PendukungcKeputusan Pemilihan Jenis Investasi MenggunakanxMetode Analytical Hierarchy Process (AHP)’.

A. F. Yuliana and R. Robiyanto, ‘PERAN EMAS SEBAGAI SAFE HAVEN BAGI SAHAM PERTAMBANGAN DI INDONESIA PADA PERIODE PANDEMI COVID-19’, Jurnal Ilmiah Bisnis dan Ekonomi Asia, vol. 15, no. 1, pp. 1–11, Feb. 2021, doi: 10.32815/jibeka.v15i1.217.

S. Novianto and H. Akbar Wibowo, ‘The Implementation of Data Mining for Predicting XAU/USD Price Trends in the Forex Market on MetaTrader 5 using Naïve Bayes Method’, Intelmatics, vol. 3, no. 2, pp. 85–90, Sep. 2023, doi: 10.25105/itm.v3i2.17199.

R. Mattera, G. Athanasopoulos, and R. Hyndman, ‘Improving out-of-sample forecasts of stock price indexes with forecast reconciliation and clustering’, Quant Finance, vol. 24, no. 11, pp. 1641–1667, Nov. 2024, doi: 10.1080/14697688.2024.2412687.

C. Alkahfi, A. Kurnia, and A. Saefuddin, ‘Perbandingan Kinerja Model Berbasis RNN pada Peramalan Data Ekonomi dan Keuangan Indonesia’, MALCOM: Indonesian Journal of Machine Learning and Computer Science, vol. 4, no. 4, pp. 1235–1243, Jul. 2024, doi: 10.57152/malcom.v4i4.1415.

A. I. Putri, Y. Syarif, N. R. Aisyi, and N. Waeyusoh, ‘Implementation of Gated Recurrent Unit, Long Short-Term Memory and Derivatives for Gold Price Prediction’, vol. 2, no. 2, pp. 68–80, 2025, doi: 10.57152/predatecs.v2i2.1609.

M. F. Julianto, M. Iqbal, W. F. Hidayat, and Y. Malau, ‘PERBANDINGAN PENERAPAN ALGORITMA DEEP LEARNING DALAM PREDIKSI HARGA EMAS’, INTI Nusa Mandiri, vol. 19, no. 1, pp. 71–76, Aug. 2024, doi: 10.33480/inti.v19i1.5559.

A. Jamarani, S. Haddadi, R. Sarvizadeh, M. Haghi Kashani, M. Akbari, and S. Moradi, ‘Big data and predictive analytics: A sytematic review of applications’, Artif Intell Rev, vol. 57, no. 7, Jul. 2024, doi: 10.1007/s10462-024-10811-5.

R. Chaudhuri, S. Deb, and H. Das, ‘Noble Approach on Sensor Fused Bio Intelligent Path Optimisation and Single Stage Obstacle Recognition in Customized Mobile Agent’, Procedia Comput Sci, vol. 218, pp. 778–787, Jan. 2023, doi: 10.1016/J.PROCS.2023.01.058.

David Andrés, ‘Error Metrics for Time Series Forecasting - ML Pills’. Accessed: May 01, 2025. [Online]. Available: https://mlpills.dev/time-series/error-metrics-for-time-series-forecasting/

R. J. Hyndman and A. B. Koehler, ‘Another look at measures of forecast accuracy’, Int J Forecast, vol. 22, no. 4, pp. 679–688, Oct. 2006, doi: 10.1016/J.IJFORECAST.2006.03.001.

Downloads

Published

2025-05-26

Issue

Section

Articles