Preparing Better Data for Oil Price Prediction Using Long Short-Term Memory

Authors

  • Raymond Sunardi Oetama Universitas Multimedia Nusantara, Indonesia

DOI:

https://doi.org/10.70609/gtech.v8i4.5668

Keywords:

LSTM, Machine Learning, Oil price prediction, Split Data, Window Size

Abstract

Fluctuating oil prices require a prediction model that can capture complex patterns more accurately than traditional methods. This study aims to apply the Long Short-Term Memory (LSTM) model to predict crude oil prices by assessing the effect of the training-test data ratio and window size on model performance. Daily data from 2000 to 2023 were taken from Yahoo Finance, which was then trained and tested on five data ratios and various window sizes. The evaluation was carried out using Mean Squared Error (MSE), Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), Mean Absolute Percentage Error (MAPE), and R². The results show that the 90:10 ratio with a window size of 3 provides the best performance, with an MSE of 6.2100, RMSE of 2.4920, MAE of 1.8430, MAPE of 2.1363%, and R² of 0.9606. These findings confirm that LSTM can effectively capture temporal dependencies and outperform traditional statistical methods.

References

Alqahtani, A., & Klein, T. (2021). Oil price changes, uncertainty, and geopolitical risks: On the resilience of GCC countries to global tensions. Energy, 236, 121541. https://doi.org/10.1016/j.energy.2021.121541

Amer, A.-K. A. (2022). World Oil Prices: Dynamics Of Markets And Politics. International Journal of Social Sciences, 4(1).

Asher, M. (2023). Improving Crude Oil Price Prediction with CEEMDAN-Hilbert Transform and LSTM Models. Journal of Computer Technology and Software, 2(1).

Bagastio, K., Oetama, R. S., & Ramadhan, A. (2023). Development of stock price prediction system using Flask framework and LSTM algorithm. Journal of Infrastructure, Policy and Development, 7(3). https://doi.org/10.24294/jipd.v7i3.2631

Bouazizi, T., Lassoued, M., & Hadhek, Z. (2021). Oil price volatility models during coronavirus crisis: Testing with appropriate models using further univariate garch and monte carlo simulation models. International Journal of Energy Economics and Policy, 11(1), 281–292. https://doi.org/10.32479/ijeep.10374

Bukhari, A. H., Raja, M. A. Z., Sulaiman, M., Islam, S., Shoaib, M., & Kumam, P. (2020). Fractional neuro-sequential ARFIMA-LSTM for financial market forecasting. IEEE Access, 8, 71326–71338. https://doi.org/10.1109/ACCESS.2020.2985763

Dong, L., Fang, D., Wang, X., Wei, W., Damaševičius, R., Scherer, R., & Woźniak, M. (2020). Prediction of streamflow based on dynamic sliding window lstm. Water (Switzerland), 12(11), 1–11. https://doi.org/10.3390/w12113032

El Bourakadi, D., Yahyaouy, A., & Boumhidi, J. (2022). Intelligent energy management for micro-grid based on deep learning LSTM prediction model and fuzzy decision-making. Sustainable Computing: Informatics and Systems, 35, 100709. https://doi.org/10.1016/j.suscom.2022.100709

Fong, S. J., Li, G., Dey, N., Crespo, R. G., & Herrera-Viedma, E. (2020). Finding an accurate early forecasting model from small dataset: A case of 2019-nCoV novel coronavirus outbreak. International Journal of Interactive Multimedia and Artificial Intelligence, 6(1), 132–140. https://doi.org/10.9781/ijimai.2020.02.002

Guo, Q., Lei, S., Ye, Q., & Fang, Z. (2021). MRC-LSTM: A Hybrid Approach of Multi-scale Residual CNN and LSTM to Predict Bitcoin Price. Proceedings of the International Joint Conference on Neural Networks, 2021-July. https://doi.org/10.1109/IJCNN52387.2021.9534453

Hedgpeth, B. M., McFarlin, K. M., & Prince, R. C. (2021). Crude Oils and their Fate in the Environment. Petrodiesel Fuels, 891–910. https://doi.org/10.1201/9780367456252-5

Kilian, L., & Zhou, X. (2022). The impact of rising oil prices on US inflation and inflation expectations in 2020–23. Energy Economics, 113, 106228. https://doi.org/10.1016/j.eneco.2022.106228

Kristiyanti, D. A., Pramudya, W. B. N., & Sanjaya, S. A. (2024). How can we predict transportation stock prices using artificial intelligence? Findings from experiments with Long Short-Term Memory based algorithms. International Journal of Information Management Data Insights, 4(2), 100293. https://doi.org/10.1016/j.jjimei.2024.100293

Li, R., Hu, Y., Heng, J., & Chen, X. (2021). A novel multiscale forecasting model for crude oil price time series. Technological Forecasting and Social Change, 173, 121181. https://doi.org/10.1016/j.techfore.2021.121181

Makalesi, A., Güleryüz, D., & Özden, E. (2020). The Prediction of Brent Crude Oil Trend Using LSTM and Facebook Prophet. Avrupa Bilim ve Teknoloji Dergisi, 20, 1–9. https://dergipark.org.tr/tr/pub/ejosat/issue/56357/759302

Nguyen, Q. H., Ly, H. B., Ho, L. S., Al-Ansari, N., Van Le, H., Tran, V. Q., Prakash, I., & Pham, B. T. (2021). Influence of data splitting on performance of machine learning models in prediction of shear strength of soil. Mathematical Problems in Engineering, 2021(1), 4832864. https://doi.org/10.1155/2021/4832864

Preeti, Bala, R., & Singh, R. P. (2022). A dual-stage advanced deep learning algorithm for long-term and long-sequence prediction for multivariate financial time series. Applied Soft Computing, 126, 109317. https://doi.org/10.1016/j.asoc.2022.109317

Rokhsatyazdi, E., Rahnamayan, S., Amirinia, H., & Ahmed, S. (2020). Optimizing LSTM Based Network for Forecasting Stock Market. 2020 IEEE Congress on Evolutionary Computation, CEC 2020 - Conference Proceedings. https://doi.org/10.1109/CEC48606.2020.9185545

Rosenquist, H., Hasselquist, D., Arlitt, M., & Carlsson, N. (2024). On the Dark Side of the Coin: Characterizing Bitcoin Use for Illicit Activities. Lecture Notes in Computer Science (Including Subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 14538 LNCS, 37–66. https://doi.org/10.1007/978-3-031-56252-5_3

Rusman, J. A., Chunady, K., Makmud, S. T., Setiawan, K. E., & Hasani, M. F. (2023). Crude Oil Price Forecasting: A Comparative Analysis of ARIMA, GRU, and LSTM Models. 2023 IEEE 9th International Conference on Computing, Engineering and Design, ICCED 2023, 1–6. https://doi.org/10.1109/ICCED60214.2023.10425576

Safa, R. P., & Oetama, R. S. (2024). Hybrid LSTM Model for Predicting Indonesian Telecommunication Companies Stock Price. 2024 International Conference on Artificial Intelligence, Blockchain, Cloud Computing, and Data Analytics (ICoABCD), 184–189.

Downloads

Published

2024-10-31

How to Cite

Preparing Better Data for Oil Price Prediction Using Long Short-Term Memory. (2024). G-Tech: Jurnal Teknologi Terapan, 8(4), 2946-2955. https://doi.org/10.70609/gtech.v8i4.5668

Most read articles by the same author(s)