IDEAS home Printed from https://ideas.repec.org/a/eco/journ2/2024-02-59.html
   My bibliography  Save this article

Modelling Stock Prices of Energy Sector using Supervised Machine Learning Techniques

Author

Listed:
  • Mimoun Benali

    (Laboratory of Research and Studies in Management, Entrepreneurship and Finance (LAREMEF), National School of Commerce and Management of Fez, Sidi Mohamed Ben Abdellah University, Fes 30050, Morocco.)

  • Lahboub Karima

    (Laboratory of Research and Studies in Management, Entrepreneurship and Finance (LAREMEF), National School of Commerce and Management of Fez, Sidi Mohamed Ben Abdellah University, Fes 30050, Morocco.)

Abstract

This paper aims at comparing the performance of the different state-of-the-art machine learning techniques in anticipating the performance of stock prices of the energy sector. The data collected cover the period from January 2020 to February 2023 with a daily frequency for the three most imported refined petroleum products in Morocco and trained four regression machines learning (linear regression, lasso regression, ridge regression, and SVR) and four classifiers machine learning (logistic regression, decision tree, extra tree and Random Forest) so that anticipating 1 day ahead prices direction can take place no matter whether they are negative or positive prices. The performance of regression algorithm is then evaluated using different evaluation metrics, especially MSE, RMSE, MAE, MAPE and R2 to evaluate the performance of regression algorithm while precision, recall and F1 scores are used to evaluate the performance of classifiers algorithm. The outcomes propose that the performance of linear regression and ridge regression takes place equally and outperform other single regression that is lasso regression and SVR for-1-day predictions as a whole. In addition to that, we have come to find that in the classifiers, algorithms group all machine learning display similar predictive accuracy, this is on one hand. On the other hand, the best of them is the logistic regression. In brief, this study suggests that all performance metrics are significantly improved by ensemble learning. Therefore, this study proves that critical information affecting stock movement can be captured by utilizing historical transactions.

Suggested Citation

  • Mimoun Benali & Lahboub Karima, 2024. "Modelling Stock Prices of Energy Sector using Supervised Machine Learning Techniques," International Journal of Energy Economics and Policy, Econjournals, vol. 14(2), pages 594-602, March.
  • Handle: RePEc:eco:journ2:2024-02-59
    as

    Download full text from publisher

    File URL: https://econjournals.com/index.php/ijeep/article/download/15553/7811/36465
    Download Restriction: no

    File URL: https://econjournals.com/index.php/ijeep/article/view/15553/7811
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Zhang, Xun & Lai, K.K. & Wang, Shou-Yang, 2008. "A new approach for crude oil price analysis based on Empirical Mode Decomposition," Energy Economics, Elsevier, vol. 30(3), pages 905-918, May.
    2. Jiang Wu & Yu Chen & Tengfei Zhou & Taiyong Li, 2019. "An Adaptive Hybrid Learning Paradigm Integrating CEEMD, ARIMA and SBL for Crude Oil Price Forecasting," Energies, MDPI, vol. 12(7), pages 1-23, April.
    3. Li, Xuerong & Shang, Wei & Wang, Shouyang, 2019. "Text-based crude oil price forecasting: A deep learning approach," International Journal of Forecasting, Elsevier, vol. 35(4), pages 1548-1560.
    4. Yu, Lean & Wang, Shouyang & Lai, Kin Keung, 2008. "Forecasting crude oil price with an EMD-based neural network ensemble learning paradigm," Energy Economics, Elsevier, vol. 30(5), pages 2623-2635, September.
    5. Jian Li & Zhenjing Xu & Huijuan Xu & Ling Tang & Lean Yu, 2017. "Forecasting Oil Price Trends with Sentiment of Online News Articles," Asia-Pacific Journal of Operational Research (APJOR), World Scientific Publishing Co. Pte. Ltd., vol. 34(02), pages 1-22, April.
    6. Hamilton, James D., 2003. "What is an oil shock?," Journal of Econometrics, Elsevier, vol. 113(2), pages 363-398, April.
    7. Hooker, Mark A., 1996. "What happened to the oil price-macroeconomy relationship?," Journal of Monetary Economics, Elsevier, vol. 38(2), pages 195-213, October.
    8. Fan, Dongyan & Sun, Hai & Yao, Jun & Zhang, Kai & Yan, Xia & Sun, Zhixue, 2021. "Well production forecasting based on ARIMA-LSTM model considering manual operations," Energy, Elsevier, vol. 220(C).
    9. Jammazi, Rania & Aloui, Chaker, 2012. "Crude oil price forecasting: Experimental evidence from wavelet decomposition and neural network modeling," Energy Economics, Elsevier, vol. 34(3), pages 828-841.
    10. Paresh Kumar Narayan & Seema Narayan, 2014. "Psychological Oil Price Barrier and Firm Returns," Journal of Behavioral Finance, Taylor & Francis Journals, vol. 15(4), pages 318-333, October.
    11. Hal R. Varian, 2014. "Big Data: New Tricks for Econometrics," Journal of Economic Perspectives, American Economic Association, vol. 28(2), pages 3-28, Spring.
    12. Narayan, Paresh Kumar & Sharma, Susan Sunila, 2014. "Firm return volatility and economic gains: The role of oil prices," Economic Modelling, Elsevier, vol. 38(C), pages 142-151.
    13. Pradhan, Rudra P. & Arvin, Mak B. & Ghoshray, Atanu, 2015. "The dynamics of economic growth, oil prices, stock market depth, and other macroeconomic variables: Evidence from the G-20 countries," International Review of Financial Analysis, Elsevier, vol. 39(C), pages 84-95.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Mostafa, Mohamed M. & El-Masry, Ahmed A., 2016. "Oil price forecasting using gene expression programming and artificial neural networks," Economic Modelling, Elsevier, vol. 54(C), pages 40-53.
    2. Cakan, Esin & Demiralay, Sercan & Ulusoy, Veysel, 2021. "Oil Prices and Firm Returns in an Emerging Market," American Business Review, Pompea College of Business, University of New Haven, vol. 24(1), pages 166-187, May.
    3. Lang, Korbinian & Auer, Benjamin R., 2020. "The economic and financial properties of crude oil: A review," The North American Journal of Economics and Finance, Elsevier, vol. 52(C).
    4. Jiangwei Liu & Xiaohong Huang, 2021. "Forecasting Crude Oil Price Using Event Extraction," Papers 2111.09111, arXiv.org.
    5. Wu, Yu-Xi & Wu, Qing-Biao & Zhu, Jia-Qi, 2019. "Improved EEMD-based crude oil price forecasting using LSTM networks," Physica A: Statistical Mechanics and its Applications, Elsevier, vol. 516(C), pages 114-124.
    6. Guo, Jingjun & Zhao, Zhengling & Sun, Jingyun & Sun, Shaolong, 2022. "Multi-perspective crude oil price forecasting with a new decomposition-ensemble framework," Resources Policy, Elsevier, vol. 77(C).
    7. Kaijian He & Rui Zha & Jun Wu & Kin Keung Lai, 2016. "Multivariate EMD-Based Modeling and Forecasting of Crude Oil Price," Sustainability, MDPI, vol. 8(4), pages 1-11, April.
    8. Kumeka, Terver Theophilus & Uzoma-Nwosu, Damian Chidozie & David-Wayas, Maria Onyinye, 2022. "The effects of COVID-19 on the interrelationship among oil prices, stock prices and exchange rates in selected oil exporting economies," Resources Policy, Elsevier, vol. 77(C).
    9. Qi Zhang & Yi Hu & Jianbin Jiao & Shouyang Wang, 2022. "Exploring the Trend of Commodity Prices: A Review and Bibliometric Analysis," Sustainability, MDPI, vol. 14(15), pages 1-22, August.
    10. Yu, Lean & Wang, Zishu & Tang, Ling, 2015. "A decomposition–ensemble model with data-characteristic-driven reconstruction for crude oil price forecasting," Applied Energy, Elsevier, vol. 156(C), pages 251-267.
    11. Jiang, He & Hu, Weiqiang & Xiao, Ling & Dong, Yao, 2022. "A decomposition ensemble based deep learning approach for crude oil price forecasting," Resources Policy, Elsevier, vol. 78(C).
    12. Ling Tang & Shuai Wang & Kaijian He & Shouyang Wang, 2015. "A novel mode-characteristic-based decomposition ensemble model for nuclear energy consumption forecasting," Annals of Operations Research, Springer, vol. 234(1), pages 111-132, November.
    13. Smyth, Russell & Narayan, Paresh Kumar, 2018. "What do we know about oil prices and stock returns?," International Review of Financial Analysis, Elsevier, vol. 57(C), pages 148-156.
    14. Ding, Yishan, 2018. "A novel decompose-ensemble methodology with AIC-ANN approach for crude oil forecasting," Energy, Elsevier, vol. 154(C), pages 328-336.
    15. Martin Enilov, 2024. "The predictive power of commodity prices for future economic growth: Evaluating the role of economic development," International Journal of Finance & Economics, John Wiley & Sons, Ltd., vol. 29(3), pages 3040-3062, July.
    16. Li, Jinchao & Zhu, Shaowen & Wu, Qianqian, 2019. "Monthly crude oil spot price forecasting using variational mode decomposition," Energy Economics, Elsevier, vol. 83(C), pages 240-253.
    17. Li, Mingchen & Cheng, Zishu & Lin, Wencan & Wei, Yunjie & Wang, Shouyang, 2023. "What can be learned from the historical trend of crude oil prices? An ensemble approach for crude oil price forecasting," Energy Economics, Elsevier, vol. 123(C).
    18. Wang, Yudong & Liu, Li & Diao, Xundi & Wu, Chongfeng, 2015. "Forecasting the real prices of crude oil under economic and statistical constraints," Energy Economics, Elsevier, vol. 51(C), pages 599-608.
    19. Wang, Yudong & Hao, Xianfeng, 2022. "Forecasting the real prices of crude oil: A robust weighted least squares approach," Energy Economics, Elsevier, vol. 116(C).
    20. Lin, Ling & Jiang, Yong & Xiao, Helu & Zhou, Zhongbao, 2020. "Crude oil price forecasting based on a novel hybrid long memory GARCH-M and wavelet analysis model," Physica A: Statistical Mechanics and its Applications, Elsevier, vol. 543(C).

    More about this item

    Keywords

    Machine Learning; Stock Price; Energy Sector; Regression; Price Prediction;
    All these keywords.

    JEL classification:

    • Q4 - Agricultural and Natural Resource Economics; Environmental and Ecological Economics - - Energy
    • C54 - Mathematical and Quantitative Methods - - Econometric Modeling - - - Quantitative Policy Modeling

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:eco:journ2:2024-02-59. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Ilhan Ozturk (email available below). General contact details of provider: http://www.econjournals.com .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.