ARRUS Journal of Engineering and Technology
Vol. 4 No. 1 (2024)

Comparison of LSTM and GRU Models Performance in Forecasting Gold Prices: A Case Study Using Historical Data from Yahoo Finance

Sudiatmika, I Putu Gede Abdi (Unknown)
Putra, I Made Agus Wirahadi (Unknown)



Article Info

Publish Date
27 Jul 2024

Abstract

This research aims to compare the performance of two types of recurrent neural network models, Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU), in forecasting gold prices based on historical closing price data. Historical gold price data from December 14, 2017, to March 14, 2024, was downloaded using the yfinance library. The data was normalized using MinMaxScaler and split into training and testing sets with an 80:20 ratio. LSTM and GRU models were constructed with two recurrent layers followed by a Dense layer for output. Both models were trained using the training data and evaluated using Mean Squared Error (MSE), Mean Absolute Error (MAE), and R-squared (R²) metrics. The experimental results indicate that the GRU model outperformed the LSTM model in predicting gold prices. GRU achieved an MSE of 337.70, MAE of 14.05, and R² of 0.933, whereas LSTM achieved an MSE of 808.98, MAE of 22.71, and R² of 0.839. Based on the model performance evaluation, it can be concluded that GRU consistently produced more accurate predictions closer to the actual values of gold prices compared to LSTM. This finding suggests that GRU may be a preferable choice in applications for forecasting gold prices using historical data.

Copyrights © 2024






Journal Info

Abbrev

jetech

Publisher

Subject

Computer Science & IT Electrical & Electronics Engineering Engineering Industrial & Manufacturing Engineering Library & Information Science

Description

ARRUS Journal of Engineering and Technology preserves prompt publication of manuscripts that meet the broad-spectrum criteria of scientific excellence. Areas of interest include, but are not limited to: Aerospace Engineering Architecture Evaluations Automation and Mechatronics Engineering ...