Perbandingan Model LSTM dan Temporal Fusion Transformer untuk Prediksi Harga Emas


  • Nilasari Nilasari * Mail Universitas Amikom Purwokerto, Purwokerto, Indonesia
  • Rujianto Eko Saputro Universitas Amikom Purwokerto, Purwokerto, Indonesia
  • Giat Karyono Universitas Amikom Purwokerto, Purwokerto, Indonesia
  • (*) Corresponding Author
Keywords: Gold Price; LSTM; Temporal Fusion Transformer; Time Series Forecasting

Abstract

This study compares the performance of Long Short-Term Memory (LSTM) and Temporal Fusion Transformer (TFT) in forecasting daily gold prices using multivariate data. The dataset was obtained from Kaggle (2005–2024) and includes ten key economic variables, such as stock indices, the US Dollar Index, crude oil prices, silver prices, and 10-year Treasury yields. The research stages consisted of data preprocessing through missing value interpolation, Z-score-based outlier clipping, normalization with MinMaxScaler on the training set, and data transformation tailored to each model architecture. Model performance was evaluated using four regression metrics: Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), R², and Mean Absolute Percentage Error (MAPE). Results indicate that TFT outperforms LSTM across all metrics, achieving RMSE of 19.35, MAE of 14.51, R² of 0.9906, and MAPE of 0.74%. The Diebold–Mariano (DM) test yielded a p-value of 0.02, confirming that the performance difference between the two models is statistically significant. These findings highlight the importance of the attention mechanism and variable selection network in TFT for enhancing multivariate predictive accuracy. However, this study is limited by the exclusion of non-economic external variables such as market sentiment and geopolitical factors. Future research should incorporate additional variables and explore hybrid approaches to achieve more robust gold price forecasting.

Downloads

Download data is not yet available.

References

R. Kumar, J. Moolchandani, A. Shukla, S. Sahu, V. Thada, and V. Chole, “Machine learning-based prediction of gold prices using economic indicators,” in Proc. 2024 13th Int. Conf. on System Modeling and Advancement in Research Trends (SMART), 2024, pp. 520–524. [Online]. Available: https://doi.org/10.1109/SMART63812.2024.10882507

K. Tp and S. Sultana, “Advanced techniques for daily gold price forecasting in India through statistical analysis and predictive modeling,” in Proc. 2024 8th Int. Conf. on Computer Systems and Information Technology for Sustainable Solutions (CSITSS), 2024, pp. 1–6. [Online]. Available: https://doi.org/10.1109/CSITSS64042.2024.10816779

S. L. Sentiko, A. Zakiyyah, and Meiliana, “Gold price prediction using machine learning and deep learning,” in Proc. 2024 6th Int. Conf. on Cybernetics and Intelligent Systems (ICORIS), 2024, pp. 1–5. [Online]. Available: https://doi.org/10.1109/ICORIS63540.2024.10903557

A. J. Amadeo, J. G. Siento, T. A. Eikwine, Diana, and I. H. Parmonangan, “Temporal fusion transformer for multi-horizon Bitcoin price forecasting,” in Proc. 2023 IEEE 9th Information Technology International Seminar (ITIS), 2023, pp. 1–7. [Online]. Available: https://doi.org/10.1109/ITIS59651.2023.10420330

K. Karthika, P. Balasubramanie, S. Harishmitha, P. Shanmugapriya, and T. E. Ramya, “Deep learning-based hybrid transformer model for stock price prediction,” in Proc. 2025 Int. Conf. on Multi-Agent Systems for Collaborative Intelligence (ICMSCI), 2025, pp. 1603–1608. [Online]. Available: https://doi.org/10.1109/ICMSCI62561.2025.10894439

G. Kirtika, R. Pandya, and S. Iyer, “Deep learning and natural language processing integrated gold price forecasting,” in Proc. 2025 IEEE Int. Conf. on Interdisciplinary Approaches in Technology and Management for Social Innovation (IATMSI), vol. 3, 2025, pp. 1–6. [Online]. Available: https://doi.org/10.1109/IATMSI64286.2025.10985530

P. Bairagi, S. Arora, and A. Chakraborty, “Comparing the best-fit and integrating generative deep learning with time series models for metal price forecasting: A predictive analysis,” in Proc. 2024 First Int. Conf. for Women in Computing (InCoWoCo), 2024, pp. 1–8. [Online]. Available: https://doi.org/10.1109/InCoWoCo64194.2024.10863422

M. S. Brown, E. M. Chen, S. Lee, J. Taylor, A. Kim, and R. C. Johnson, “Comparative analysis of LSTM and traditional time series models on oil price data,” Preprints, 2024. [Online]. Available: https://doi.org/10.20944/preprints202410.2355.v1

W. You, J. Chen, H. Xie, and Y. Ren, “Which uncertainty measure better predicts gold prices? New evidence from a CNN-LSTM approach,” The North American Journal of Economics and Finance, vol. 76, p. 102375, 2025. doi: https://doi.org/10.1016/j.najef.2025.102375

W. Huang, “Financial market linkages: Gold futures and the NASDAQ index,” in Proc. 2nd Int. Conf. Financial Technology and Business Analysis (ICFTBA), 2023, pp. 316–324. doi: https://doi.org/10.54254/2754-1169/61/20231291

H. Chen, Y. Wang, L. Yu, X. Zhang, and Z. Wang, “An improved VMD-LSTM model for time-varying GNSS time series prediction with temporally correlated noise,” Remote Sensing, vol. 15, 2023, Art. no. 3694. [Online]. Available: https://doi.org/10.3390/rs15143694

D. R. Sanjaya, B. Surarso, and T. Tarno, “Stock price forecasting on time series data using the long short-term memory (LSTM) model,” International Journal of Current Science Research and Review, vol. 7, no. 12, 2024. [Online]. Available: https://doi.org/10.47191/ijcsrr/v7-i12-26

S. Shao, “Stacked Block Analysis Based on LSTM for Stock Price Prediction”, TCSISR, vol. 5, pp. 227–235, Aug. 2024, doi: 10.62051/xh2b7w58.

B. Lim, S. Arik, N. Loeff, and T. Pfister, “Temporal fusion transformers for interpretable multi-horizon time series forecasting,” International Journal of Forecasting, vol. 37, no. 4, pp. 1748–1764, 2021. [Online]. Available: https://doi.org/10.1016/j.ijforecast.2021.03.012

J. Laborda, S. Ruano, and I. Zamanillo, “Multi-country and multi-horizon GDP forecasting using temporal fusion transformers,” Mathematics, vol. 11, no. 12, p. 2625, 2023. doi: https://doi.org/10.3390/math11122625

S. Joseph, A. A. Jo, and E. D. Raj, “Improving time series forecasting accuracy with transformers: A comprehensive analysis with explainability,” in Proc. 2024 3rd Int. Conf. on Electrical, Electronics, Information and Communication Technology (ICEEICT), 2024, pp. 1–7. [Online]. Available: https://doi.org/10.1109/ICEEICT61591.2024.10718609

T. Hodson, “Root-mean-square error (RMSE) or mean absolute error (MAE): When to use them or not,” Geoscientific Model Development, vol. 15, pp. 5481–5492, 2022. [Online]. Available: https://doi.org/10.5194/gmd-15-5481-2022

A. Vishwanath, M. Basheeruddin, and S. D., “Forecasting sales data using time series models and LSTM model,” in Proc. 2024 2nd Int. Conf. on Advanced Information Technology (ICAIT), vol. 1, 2024, pp. 1–6. [Online]. Available: https://doi.org/10.1109/ICAIT61638.2024.10690408

K. Li, “Informativeness of performance measures: Coefficients or R-squareds?,” Journal of Risk and Financial Management, vol. 17, 2024. [Online]. Available: https://doi.org/10.3390/jrfm17110481

A. Mishra, S. Kaintura, Y. S. Yadav, V. Joshi, H. Vaidya, and A. Kapruwan, “GANs and augmented reality in virtual clothing try-on,” in Proc. 2024 Int. Conf. on Intelligent Innovations in Technology, Computing, Electrical and Electronics (IITCEE), 2024, pp. 1–6. [Online]. Available: https://doi.org/10.1109/IITCEE59897.2024.10467813

V. L. T. Thuy, T. T. K. Oanh, and N. T. H. Ha, “The roles of gold, US dollar, and bitcoin as safe-haven assets in times of crisis,” Cogent Economics and Finance, vol. 12, 2024. [Online]. Available: https://doi.org/10.1080/23322039.2024.2322876

J. Changani, “Factors influencing gold price movements: A time series analysis perspective,” SSRN Electronic Journal, 2024. [Online]. Available: https://doi.org/10.2139/ssrn.4815102

M. Zou, “Study the relationship between VIX and COMEX gold futures price,” in Proc. 2024 4th Int. Conf. on Internet and E-Business, 2024. [Online]. Available: https://doi.org/10.1145/3690001.3690025

X.-P. Hu, “Stock price prediction based on temporal fusion transformer,” in Proc. 2021 3rd Int. Conf. on Machine Learning, Big Data and Business Intelligence (MLBDBI), 2021, pp. 60–66. [Online]. Available: https://doi.org/10.1109/MLBDBI54094.2021.00019

Q. Zhang, X. Li, and P. Gao, “Forecasting sales in live-streaming cross-border e-commerce in the UK using the temporal fusion transformer model,” J. Theor. Appl. Electron. Commerce Res., vol. 20, no. 2, p. 92, 2025. doi: https://doi.org/10.3390/jtaer20020092


Bila bermanfaat silahkan share artikel ini

Berikan Komentar Anda terhadap artikel Perbandingan Model LSTM dan Temporal Fusion Transformer untuk Prediksi Harga Emas

Dimensions Badge
Article History
Submitted: 2025-08-11
Published: 2026-03-31
Abstract View: 0 times
PDF Download: 0 times
How to Cite
Nilasari, N., Eko Saputro, R., & Karyono, G. (2026). Perbandingan Model LSTM dan Temporal Fusion Transformer untuk Prediksi Harga Emas. Building of Informatics, Technology and Science (BITS), 7(4), 2811-2820. https://doi.org/10.47065/bits.v7i4.8204
Issue
Section
Articles