Comparative Analysis of LSTM and XGBoost for Crude Oil Price Forecasting Under Market Volatility

Imam Saputra(1*), Mesran Mesran(2),

(1) Sekolah Tinggi Ilmu Manajemen Sukma Medan, Medan
(2) Sekolah Tinggi Ilmu Manajemen Sukma Medan, Medan
(*) Corresponding Author

Abstract


Crude oil price forecasting is vital for global economic planning and financial risk management, yet it remains challenging due to inherent market volatility and macroeconomic anomalies. This study presents a rigorous comparative evaluation of Long Short-Term Memory (LSTM) networks and Extreme Gradient Boosting (XGBoost) for predicting daily West Texas Intermediate (WTI) crude oil futures prices. Utilizing a 20-year historical dataset (2003–2023) comprising 5,213 observations, a unified feature-engineering pipeline was constructed to incorporate technical indicators, including Simple Moving Averages, Relative Strength Index, rolling volatility, and autoregressive lags. Both algorithms were evaluated over a 1,013-day out-of-sample chronological test set (2019–2023) using Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), Mean Absolute Percentage Error (MAPE), and Coefficient of Determination ( ) Score. Empirical results demonstrate that XGBoost systematically outperformed the LSTM network across all evaluation dimensions, achieving an MAE of  3.499/bbl, MAPE of 4.019%, and an   of 0.9751, compared to LSTM’s MAE of  4.220/bbl, MAPE of 4.799%, and   of 0.9637. This represents a 30.95% reduction in absolute forecast error by XGBoost alongside an 18-fold training speedup. Furthermore, residual density analysis revealed that while both models captured post-pandemic market rallies, both encountered transient generalization limits during the April 2020 negative price crash (-$37.63/bbl). Overall, regularized gradient boosting on domain-engineered features provides a more precise and computationally efficient architecture for daily commodity price forecasting


Keywords


Karyawan, Metode WASPAS, SistemPendukung Keputusan

Full Text:

PDF

References


R. Zhang, H. Zhang, W. Gao, T. Li, and S. Yang, “The Dynamic Effects of Oil Price Shocks on Exchange Rates—From a Time-Varying Perspective,” Sustainability (Switzerland), vol. 14, no. 14, pp. 1–20, 2022, doi: 10.3390/su14148452.

Y. Akdi, S. Varlik, and H. Berument, “The long-run relationship between the prices of WTI and Brent crude oils – Periodogram based cointegration analyses,” Energy Economics Letters, vol. 10, no. 1, pp. 35–43, 2023, doi: 10.55493/5049.v10i1.4715.

X. Yin, J. Peng, and T. Tang, “Improving the forecasting accuracy of crude oil prices,” Sustainability (Switzerland), vol. 10, no. 2, pp. 1–9, 2018, doi: 10.3390/su10020454.

L. Jovanovic et al., “Multi-Step Crude Oil Price Prediction Based on LSTM Approach Tuned by Salp Swarm Algorithm with Disputation Operator,” Sustainability (Switzerland), vol. 14, no. 21, pp. 1–29, 2022, doi: 10.3390/su142114616.

A. Bâra, S. V. Oprea, and A. C. Băroiu, “Forecasting the Spot Market Electricity Price with a Long Short-Term Memory Model Architecture in a Disruptive Economic and Geopolitical Context,” International Journal of Computational Intelligence Systems, vol. 16, no. 1, pp. 1–22, 2023, doi: 10.1007/s44196-023-00309-3.

K. Drachal and M. Pawłowski, “Forecasting Selected Commodities’ Prices with the Bayesian Symbolic Regression,” International Journal of Financial Studies, vol. 12, no. 2, pp. 1–56, 2024, doi: 10.3390/ijfs12020034.

F. R. Alharbi and D. Csala, “A Seasonal Autoregressive Integrated Moving Average with Exogenous Factors (SARIMAX) Forecasting Model-Based Time Series Approach,” Inventions, vol. 7, no. 4, pp. 1–21, 2022, doi: 10.3390/inventions7040094.

M. Sahiner, Forecasting volatility in Asian financial markets: evidence from recursive and rolling window methods, vol. 2, no. 10. Springer International Publishing, 2022. doi: 10.1007/s43546-022-00329-9.

F. Jawadi, D. Bourghelle, P. Rozin, A. I. Cheffou, and G. S. Uddin, “Sentiment and energy price volatility: A nonlinear high frequency analysis,” Energy Econ., vol. 133, no. March, pp. 1–19, 2024, doi: 10.1016/j.eneco.2024.107465.

M. M. Kumbure, C. Lohrmann, P. Luukka, and J. Porras, “Machine learning techniques and data for stock market forecasting: A literature review,” Expert Syst. Appl., vol. 197, no. February, pp. 1–41, 2022, doi: 10.1016/j.eswa.2022.116659.

B. Dou et al., “Machine Learning Methods for Small Data Challenges in Molecular Science,” Chem. Rev., vol. 123, no. 13, pp. 8736–8780, 2023, doi: 10.1021/acs.chemrev.3c00189.

H. S. R. Rajula, G. Verlato, M. Manchia, N. Antonucci, and V. Fanos, “Comparison of conventional statistical methods with machine learning in medicine: Diagnosis, drug development, and treatment,” Medicina (Lithuania), vol. 56, no. 9, pp. 1–10, 2020, doi: 10.3390/medicina56090455.

I. M. A. I. Agusta, A. Barakbah, and A. Fariza, “Technical Analysis Based Automatic Trading Prediction System for Stock Exchange using Support Vector Machine,” EMITTER International Journal of Engineering Technology, vol. 10, no. 2, pp. 279–293, 2022, doi: 10.24003/emitter.v10i2.740.

W. Chen, W. Hussain, F. Cauteruccio, and X. Zhang, “Deep Learning for Financial Time Series Prediction: A State-of-the-Art Review of Standalone and Hybrid Models,” CMES - Computer Modeling in Engineering and Sciences, vol. 139, no. 1, pp. 187–224, 2023, doi: 10.32604/cmes.2023.031388.

V. Dakić, M. Kovač, and J. Slovinac, “Evolving High-Performance Computing Data Centers with Kubernetes, Performance Analysis, and Dynamic Workload Placement Based on Machine Learning Scheduling,” Electronics (Switzerland), vol. 13, no. 13, pp. 1–30, 2024, doi: 10.3390/electronics13132651.

M. R. Miah and Md. M. Islam, “Data Preprocessing and Feature Engineering Strategies for Large-Scale Predictive Modeling Applications,” Review of Applied Science and Technology, vol. 03, no. 01, pp. 263–302, 2024, doi: 10.63125/tqqqed47.

M. Mustafa, “Understanding of Machine Learning with Deep Learning :,” Computers MDPI, vol. 12, no. 91, pp. 1–26, 2023.

I. D. Mienye and T. G. Swart, “A Comprehensive Review of Deep Learning: Architectures, Recent Advances, and Applications,” Information (Switzerland), vol. 15, no. 12, pp. 1–45, 2024, doi: 10.3390/info15120755.

S. M. Al-Selwi et al., “RNN-LSTM: From applications to modeling techniques and beyond—Systematic review,” Journal of King Saud University - Computer and Information Sciences, vol. 36, no. 5, pp. 1–34, 2024, doi: 10.1016/j.jksuci.2024.102068.

A. Jahandoost, F. Abedinzadeh Torghabeh, S. A. Hosseini, and M. Houshmand, “Crude oil price forecasting using K-means clustering and LSTM model enhanced by dense-sparse-dense strategy,” J. Big Data, vol. 11, no. 1, pp. 1–22, 2024, doi: 10.1186/s40537-024-00977-8.

H. Dhake, Y. Kashyap, and P. Kosmopoulos, “Algorithms for Hyperparameter Tuning of LSTMs for Time Series Forecasting,” Remote Sens. (Basel)., vol. 15, no. 8, pp. 1–17, 2023, doi: 10.3390/rs15082076.

M. Klaiber, “A Fundamental Overview of SOTA-Ensemble Learning Methods for Deep Learning: A Systematic Literature Review,” Science in Information Technology Letters, vol. 2, no. 2, pp. 1–14, 2021, doi: 10.31763/sitech.v2i2.549.

D. Tarwidi, S. R. Pudjaprasetya, D. Adytia, and M. Apri, “An optimized XGBoost-based machine learning method for predicting wave run-up on a sloping beach,” MethodsX, vol. 10, no. March, pp. 1–12, 2023, doi: 10.1016/j.mex.2023.102119.

S. R. Al-Taai, N. M. Azize, Z. A. Thoeny, H. Imran, L. F. A. Bernardo, and Z. Al-Khafaji, “XGBoost Prediction Model Optimized with Bayesian for the Compressive Strength of Eco-Friendly Concrete Containing Ground Granulated Blast Furnace Slag and Recycled Coarse Aggregate,” Applied Sciences (Switzerland), vol. 13, no. 15, pp. 1–23, 2023, doi: 10.3390/app13158889.

D. Li, C. Pan, J. Zhao, and A. Luo, “A penalized variable selection ensemble algorithm for high-dimensional group-structured data,” PLoS One, vol. 19, no. 2 February, pp. 1–19, 2024, doi: 10.1371/journal.pone.0296748.

A. Ardana, “Performance Analysis of XGBoost Algorithm to Determine the Most Optimal Parameters and Features in Predicting Stock Price Movement,” Telematika, vol. 20, no. 1, pp. 91–102, 2023, doi: 10.31315/telematika.v20i1.9329.

S. Maleki Varnosfaderani and M. Forouzanfar, “The Role of AI in Hospitals and Clinics: Transforming Healthcare in the 21st Century,” Bioengineering, vol. 11, no. 4, pp. 1–38, 2024, doi: 10.3390/bioengineering11040337.

T. M. Wanjuki, V. W. Lumumba, E. K. Kimtai, M. K. Mbaluka, and E. W. Njoroge, “Comparative Analysis of GARCH-Based Volatility Models of Financial Market Volatility: A Case of Nairobi Security Market PLC, Kenya,” European Journal of Mathematics and Statistics, vol. 5, no. 4, pp. 1–18, 2024, doi: 10.24018/ejmath.2024.5.4.310.

A. Haxhimusa and M. Liebensteiner, “Effects of electricity demand reductions under a carbon pricing regime on emissions: lessons from COVID-19,” Energy Policy, vol. 156, no. June, pp. 1–10, 2021, doi: 10.1016/j.enpol.2021.112392.

U. O. Ogbuonyalu, K. Abiodun, S. Dzamefe, E. N. Vera, A. Oyinlola, and I. Emmanuel, “Assessing Artificial Intelligence Driven Algorithmic Trading Implications on Market Liquidity Risk and Financial Systemic Vulnerabilities,” International Journal of Scientific Research and Modern Technology, vol. 3, no. 4, pp. 18–21, 2024, doi: 10.38124/ijsrmt.v3i4.433.

W. Semmler, J. Henry, and H. Maurer, “Pandemic meltdown and economic recovery – A multi-phase dynamic model, empirics, and policy,” Research in Globalization, vol. 6, no. December 2022, pp. 1–19, 2023, doi: 10.1016/j.resglo.2022.100106.

R. Chaudhary, P. Bakhshi, and H. Gupta, “Volatility in International Stock Markets: An Empirical Study during COVID-19,” Journal of Risk and Financial Management, vol. 13, no. 9, pp. 1–17, 2020, doi: 10.3390/jrfm13090208.

A. Gifty and Dr. Yang Li, “A Comparative Analysis of LSTM, ARIMA, XGBoost Algorithms in Predicting Stock Price Direction,” Engineering and Technology Journal, vol. 09, no. 08, pp. 4978–4986, 2024, doi: 10.47191/etj/v9i08.50.

P. Topiwala and W. Dai, “Surviving Black Swans: The Challenge of Market Timing Systems,” Journal of Risk and Financial Management, vol. 15, no. 7, pp. 1–25, 2022, doi: 10.3390/jrfm15070280.

J. Aladwani, “Oil Volatility Uncertainty: Impact on Fundamental Macroeconomics and the Stock Index,” Economies, vol. 12, no. 6, pp. 1–23, 2024, doi: 10.3390/economies12060140.

M. Beghini and T. Grossi, “Towards a Reliable Uncertainty Quantification in Residual Stress Measurements with Relaxation Methods: Finding Average Residual Stresses is a Well-Posed Problem,” Exp. Mech., vol. 64, no. 6, pp. 851–874, 2024, doi: 10.1007/s11340-024-01066-w.




DOI: http://dx.doi.org/10.61944/bids.v3i2.98

Refbacks

  • There are currently no refbacks.


Copyright (c) 2024 Imam Saputra, Mesran Mesran

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.

Bulletin of Informatics and Data Science
Asosiasi Peneliti Data Science Indonesia
Email: pdsi.bids@gmail.com
This work is licensed under a Creative Commons Attribution 4.0 International License.