This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Gold price prediction using Convolutional Neural Network-Long Short-Term Memory (CNN-LSTM)
Corresponding Author(s) : I Wayan Krisna Gita Santika
Kinetik: Game Technology, Information System, Computer Network, Computing, Electronics, and Control,
Vo. 6, No. 3, August 2021
Abstract
Gold has an important role in worldwide economics. Gold is not only used in jewelry but also can be a good deal for investment however several factors can affect the fluctuation in gold which can make the risk of investing in gold is bigger for many people. Therefore, is very important to predict the gold price for people who invest in gold in order to help reduce the investment risk. This study will implement a hybrid method from Convolutional Neural Network (CNN) and Long Short-Term Memory (LSTM). CNN can extract useful knowledge and learn the internal representation of time-series data, and LSTM networks will identify short-term and long-term dependencies effectively. This research will use daily time frame data and weekly time frame data. This research also tried some experiments to find the best hyperparameters of batch size and epochs in ratio data 60:40 and 80:20. The best result obtained in the daily time of ratio data 60:40 with RMSE 13.67953 and MAE 9,40998, while in ratio data 80:20 has RMSE 15,53199 and MAE 12,78120. In weekly time has obtained the RMSE 38,01949 and MAE 28,32035 for ratio data 60:40 while in ratio data 80:20 the result was RMSE 32,61283 and MAE 22,74638. Those results shows that CNN-LSTM model can predict the trend of daily time frame gold price.
Keywords
Download Citation
Endnote/Zotero/Mendeley (RIS)BibTeX
- E. Bouri, A. Jain, P. C. Biswal, and D. Roubaud, “Cointegration and nonlinear causality amongst gold, oil, and the Indian stock market: Evidence from implied volatility indices,” Resour. Policy, vol. 52, no. March, pp. 201–206, 2017. https://doi.org/10.1016/j.resourpol.2017.03.003
- P. K. Mishra, J. R. Das, and S. K. Mishra, “Gold Price Volatility and Stock Market Returns in India,” Am. J. Sci. Res. ISSN, vol. 1450, no. 9, pp. 47–55, 2010.
- D. C. North and R. P. Thomas, The Rise of the Western World. Cambridge University Press, 1973.
- I. E. Livieris, E. Pintelas, and P. Pintelas, “A CNN–LSTM model for gold price time-series forecasting,” Neural Comput. Appl., vol. 32, 2020. https://doi.org/10.1007/s00521-020-04867-x
- N. A. Zainal and Z. Mustaffa, “A literature review on gold price predictive techniques,” 2015 4th Int. Conf. Softw. Eng. Comput. Syst. ICSECS 2015 Virtuous Softw. Solut. Big Data, pp. 39–44, 2015. https://doi.org/10.1109/ICSECS.2015.7333120
- X. Yang, “The Prediction of Gold Price Using ARIMA Model,” Adv. Soc. Sci. Educ. Humanit. Res., vol. 196, no. Ssphe 2018, pp. 273–276, 2019. https://dx.doi.org/10.2991/ssphe-18.2019.66
- Z. Xie, X. Lin, Y. Zhong, and Q. Chen, “Research on gold etf forecasting based on lstm,” Proc. - 2019 IEEE Intl Conf Parallel Distrib. Process. with Appl. Big Data Cloud Comput. Sustain. Comput. Commun. Soc. Comput. Networking, ISPA/BDCloud/SustainCom/SocialCom 2019, pp. 1346–1351, 2019. https://doi.org/10.1109/ISPA-BDCloud-SustainCom-SocialCom48970.2019.00193
- G. DeepikaM, G. Nambiar, M. Rajkumar, and A. Vishwavidhyapeetham, “Forecasting Price and Analysing Factors Influencing The Price of Gold Using ARIMA Model and Multiple Regression Analysis,” vol. 2, no. 11, 2012.
- A. D. Dubey, “Gold price prediction using support vector regression and ANFIS models,” 2016 Int. Conf. Comput. Commun. Informatics, ICCCI 2016, 2016. https://doi.org/10.1109/ICCCI.2016.7479929
- W. Zou and Y. Xia, “Back propagation bidirectional extreme learning machine for traffic flow time series prediction,” Neural Comput. Appl., vol. 31, no. 11, pp. 7401–7414, 2019. https://doi.org/10.1007/s00521-018-3578-y
- J. Zheng, X. Fu, and G. Zhang, “Research on exchange rate forecasting based on deep belief network,” Neural Comput. Appl., vol. 31, pp. 573–582, 2019. https://doi.org/10.1007/s00521-017-3039-z
- H. H. Zahrah, S. Sa’adah, and R. Rismala, “Foreign Exchange Rate Prediction Using Long-Short Term Memory: A Case Study in COVID-19 Pandemic,” vol. 6, no. 2, pp. 94–105, 2021.
- J. Wong, T. Manderson, M. Abrahamowicz, D. L. Buckeridge, and R. Tamblyn, “Can Hyperparameter Tuning Improve the Performance of a Super Learner?: A Case Study,” Epidemiology, vol. 30, no. 4, pp. 521–531, 2019. https://doi.org/10.1097/EDE.0000000000001027
- N. Lavesson and P. Davidsson, “Quantifying the impact of learning algorithm parameter tuning,” Proc. Natl. Conf. Artif. Intell., vol. 1, no. 1, pp. 395–400, 2006.
- K. Chen, Y. Zhou, and F. Dai, “A LSTM-based method for stock returns prediction: A case study of China stock market,” Proc. - 2015 IEEE Int. Conf. Big Data, IEEE Big Data 2015, pp. 2823–2824, 2015. https://doi.org/10.1109/BigData.2015.7364089
- D. A. Nasution, H. H. Khotimah, and N. Chamidah, “Perbandingan Normalisasi Data untuk Klasifikasi Wine Menggunakan Algoritma K-NN,” Comput. Eng. Sci. Syst. J., vol. 4, no. 1, p. 78, 2019. https://doi.org/10.24114/cess.v4i1.11458
- Y. Lecun, Y. Bengio, and G. Hinton, “Deep learning,” Nature, vol. 521, no. 7553, pp. 436–444, 2015. https://doi.org/10.1038/nature14539
- K. O’Shea and R. Nash, “An Introduction to Convolutional Neural Networks,” pp. 1–11, 2015.
- Suyanto, Machine Learning Tingkat Dasar dan Lanjut. Bandung: Informatika, 2018.
- Suyanto, Modernisasi Machine Learning untuk Big Data. Bandung: Informatika, 2019.
- Z. He, J. Zhou, H. N. Dai, and H. Wang, “Gold price forecast based on LSTM-CNN model,” Proc. - IEEE 17th Int. Conf. Dependable, Auton. Secur. Comput. IEEE 17th Int. Conf. Pervasive Intell. Comput. IEEE 5th Int. Conf. Cloud Big Data Comput. 4th Cyber Sci., pp. 1046–1053, 2019. https://doi.org/10.1109/DASC/PiCom/CBDCom/CyberSciTech.2019.00188
- L. Seymour, P. J. Brockwell, and R. A. Davis, Introduction to Time Series and Forecasting., vol. 92, no. 440. 1997.
- S. Hochreiter and J. Schmidhuber, “Long Short-Term Memory,” Neural Comput., vol. 9, no. 8, pp. 1735–1780, Nov. 1997. https://doi.org/10.1162/neco.1997.9.8.1735
- R. Dey and F. M. Salemt, “Gate-variants of Gated Recurrent Unit (GRU) neural networks,” Midwest Symp. Circuits Syst., vol. 2017-Augus, no. 2, pp. 1597–1600, 2017. https://doi.org/10.1109/MWSCAS.2017.8053243
- Z. Chang, Y. Zhang, and W. Chen, “Effective Adam-Optimized LSTM Neural Network for Electricity Price Forecasting,” Proc. IEEE Int. Conf. Softw. Eng. Serv. Sci. ICSESS, vol. 2018-Novem, no. Figure 1, pp. 245–248, 2019. https://doi.org/10.1109/ICSESS.2018.8663710
- D. P. Kingma and J. L. Ba, “Adam: A method for stochastic optimization,” 3rd Int. Conf. Learn. Represent. ICLR 2015 - Conf. Track Proc., pp. 1–15, 2015.
- T. Chai and R. R. Draxler, “Root mean square error (RMSE) or mean absolute error (MAE)? -Arguments against avoiding RMSE in the literature,” Geosci. Model Dev., vol. 7, no. 3, pp. 1247–1250, 2014. https://doi.org/10.5194/gmd-7-1247-2014, 2014
References
E. Bouri, A. Jain, P. C. Biswal, and D. Roubaud, “Cointegration and nonlinear causality amongst gold, oil, and the Indian stock market: Evidence from implied volatility indices,” Resour. Policy, vol. 52, no. March, pp. 201–206, 2017. https://doi.org/10.1016/j.resourpol.2017.03.003
P. K. Mishra, J. R. Das, and S. K. Mishra, “Gold Price Volatility and Stock Market Returns in India,” Am. J. Sci. Res. ISSN, vol. 1450, no. 9, pp. 47–55, 2010.
D. C. North and R. P. Thomas, The Rise of the Western World. Cambridge University Press, 1973.
I. E. Livieris, E. Pintelas, and P. Pintelas, “A CNN–LSTM model for gold price time-series forecasting,” Neural Comput. Appl., vol. 32, 2020. https://doi.org/10.1007/s00521-020-04867-x
N. A. Zainal and Z. Mustaffa, “A literature review on gold price predictive techniques,” 2015 4th Int. Conf. Softw. Eng. Comput. Syst. ICSECS 2015 Virtuous Softw. Solut. Big Data, pp. 39–44, 2015. https://doi.org/10.1109/ICSECS.2015.7333120
X. Yang, “The Prediction of Gold Price Using ARIMA Model,” Adv. Soc. Sci. Educ. Humanit. Res., vol. 196, no. Ssphe 2018, pp. 273–276, 2019. https://dx.doi.org/10.2991/ssphe-18.2019.66
Z. Xie, X. Lin, Y. Zhong, and Q. Chen, “Research on gold etf forecasting based on lstm,” Proc. - 2019 IEEE Intl Conf Parallel Distrib. Process. with Appl. Big Data Cloud Comput. Sustain. Comput. Commun. Soc. Comput. Networking, ISPA/BDCloud/SustainCom/SocialCom 2019, pp. 1346–1351, 2019. https://doi.org/10.1109/ISPA-BDCloud-SustainCom-SocialCom48970.2019.00193
G. DeepikaM, G. Nambiar, M. Rajkumar, and A. Vishwavidhyapeetham, “Forecasting Price and Analysing Factors Influencing The Price of Gold Using ARIMA Model and Multiple Regression Analysis,” vol. 2, no. 11, 2012.
A. D. Dubey, “Gold price prediction using support vector regression and ANFIS models,” 2016 Int. Conf. Comput. Commun. Informatics, ICCCI 2016, 2016. https://doi.org/10.1109/ICCCI.2016.7479929
W. Zou and Y. Xia, “Back propagation bidirectional extreme learning machine for traffic flow time series prediction,” Neural Comput. Appl., vol. 31, no. 11, pp. 7401–7414, 2019. https://doi.org/10.1007/s00521-018-3578-y
J. Zheng, X. Fu, and G. Zhang, “Research on exchange rate forecasting based on deep belief network,” Neural Comput. Appl., vol. 31, pp. 573–582, 2019. https://doi.org/10.1007/s00521-017-3039-z
H. H. Zahrah, S. Sa’adah, and R. Rismala, “Foreign Exchange Rate Prediction Using Long-Short Term Memory: A Case Study in COVID-19 Pandemic,” vol. 6, no. 2, pp. 94–105, 2021.
J. Wong, T. Manderson, M. Abrahamowicz, D. L. Buckeridge, and R. Tamblyn, “Can Hyperparameter Tuning Improve the Performance of a Super Learner?: A Case Study,” Epidemiology, vol. 30, no. 4, pp. 521–531, 2019. https://doi.org/10.1097/EDE.0000000000001027
N. Lavesson and P. Davidsson, “Quantifying the impact of learning algorithm parameter tuning,” Proc. Natl. Conf. Artif. Intell., vol. 1, no. 1, pp. 395–400, 2006.
K. Chen, Y. Zhou, and F. Dai, “A LSTM-based method for stock returns prediction: A case study of China stock market,” Proc. - 2015 IEEE Int. Conf. Big Data, IEEE Big Data 2015, pp. 2823–2824, 2015. https://doi.org/10.1109/BigData.2015.7364089
D. A. Nasution, H. H. Khotimah, and N. Chamidah, “Perbandingan Normalisasi Data untuk Klasifikasi Wine Menggunakan Algoritma K-NN,” Comput. Eng. Sci. Syst. J., vol. 4, no. 1, p. 78, 2019. https://doi.org/10.24114/cess.v4i1.11458
Y. Lecun, Y. Bengio, and G. Hinton, “Deep learning,” Nature, vol. 521, no. 7553, pp. 436–444, 2015. https://doi.org/10.1038/nature14539
K. O’Shea and R. Nash, “An Introduction to Convolutional Neural Networks,” pp. 1–11, 2015.
Suyanto, Machine Learning Tingkat Dasar dan Lanjut. Bandung: Informatika, 2018.
Suyanto, Modernisasi Machine Learning untuk Big Data. Bandung: Informatika, 2019.
Z. He, J. Zhou, H. N. Dai, and H. Wang, “Gold price forecast based on LSTM-CNN model,” Proc. - IEEE 17th Int. Conf. Dependable, Auton. Secur. Comput. IEEE 17th Int. Conf. Pervasive Intell. Comput. IEEE 5th Int. Conf. Cloud Big Data Comput. 4th Cyber Sci., pp. 1046–1053, 2019. https://doi.org/10.1109/DASC/PiCom/CBDCom/CyberSciTech.2019.00188
L. Seymour, P. J. Brockwell, and R. A. Davis, Introduction to Time Series and Forecasting., vol. 92, no. 440. 1997.
S. Hochreiter and J. Schmidhuber, “Long Short-Term Memory,” Neural Comput., vol. 9, no. 8, pp. 1735–1780, Nov. 1997. https://doi.org/10.1162/neco.1997.9.8.1735
R. Dey and F. M. Salemt, “Gate-variants of Gated Recurrent Unit (GRU) neural networks,” Midwest Symp. Circuits Syst., vol. 2017-Augus, no. 2, pp. 1597–1600, 2017. https://doi.org/10.1109/MWSCAS.2017.8053243
Z. Chang, Y. Zhang, and W. Chen, “Effective Adam-Optimized LSTM Neural Network for Electricity Price Forecasting,” Proc. IEEE Int. Conf. Softw. Eng. Serv. Sci. ICSESS, vol. 2018-Novem, no. Figure 1, pp. 245–248, 2019. https://doi.org/10.1109/ICSESS.2018.8663710
D. P. Kingma and J. L. Ba, “Adam: A method for stochastic optimization,” 3rd Int. Conf. Learn. Represent. ICLR 2015 - Conf. Track Proc., pp. 1–15, 2015.
T. Chai and R. R. Draxler, “Root mean square error (RMSE) or mean absolute error (MAE)? -Arguments against avoiding RMSE in the literature,” Geosci. Model Dev., vol. 7, no. 3, pp. 1247–1250, 2014. https://doi.org/10.5194/gmd-7-1247-2014, 2014