IDEAS home Printed from https://ideas.repec.org/a/gam/jjrfmx/v17y2024i7p293-d1431830.html
   My bibliography  Save this article

Assessing the Predictive Power of Transformers, ARIMA, and LSTM in Forecasting Stock Prices of Moroccan Credit Companies

Author

Listed:
  • Karima Lahboub

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

  • Mimoun Benali

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

Abstract

In this paper, we present a data-driven approach to forecasting stock prices in the Moroccan Stock Exchange. Our study tests three predictive models: ARIMA, LSTM, and transformers, applied to the historical stock price data of three prominent credit companies (EQD, LES, and SLF) listed on the Casablanca Stock Exchange. We carefully selected and optimized hyperparameters for each model to achieve optimal performance. Our results showed that the LSTM model achieved high accuracy, with R-squared values exceeding 0.99 for EQD and LES and surpassing 0.95 for SLF. These findings highlighted the effectiveness of LSTM in stock price forecasting. Our study offers practical insights for traders and investors in the Moroccan Stock Exchange, demonstrating how predictive modeling can aid in making informed decisions. This research contributes to advancing stock market forecasting in Morocco, providing valuable tools for navigating the Casablanca Stock Exchange.

Suggested Citation

  • Karima Lahboub & Mimoun Benali, 2024. "Assessing the Predictive Power of Transformers, ARIMA, and LSTM in Forecasting Stock Prices of Moroccan Credit Companies," JRFM, MDPI, vol. 17(7), pages 1-16, July.
  • Handle: RePEc:gam:jjrfmx:v:17:y:2024:i:7:p:293-:d:1431830
    as

    Download full text from publisher

    File URL: https://www.mdpi.com/1911-8074/17/7/293/pdf
    Download Restriction: no

    File URL: https://www.mdpi.com/1911-8074/17/7/293/
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Ahmed, Abdullahi D. & Huo, Rui, 2021. "Volatility transmissions across international oil market, commodity futures and stock markets: Empirical evidence from China," Energy Economics, Elsevier, vol. 93(C).
    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. Mensi, Walid & Rehman, Mobeen Ur & Vo, Xuan Vinh, 2022. "Spillovers and diversification benefits between oil futures and ASEAN stock markets," Resources Policy, Elsevier, vol. 79(C).
    2. Giang Thi Huong Vuong & Manh Huu Nguyen & Khanh Hoang, 2024. "Oil price uncertainty, oil pricing reform, and corporate profitability: The case of China," PLOS ONE, Public Library of Science, vol. 19(2), pages 1-25, February.
    3. Elgammal, Mohammed M. & Ahmed, Walid M.A. & Alshami, Abdullah, 2021. "Price and volatility spillovers between global equity, gold, and energy markets prior to and during the COVID-19 pandemic," Resources Policy, Elsevier, vol. 74(C).
    4. Wang, Kai-Hua & Su, Chi-Wei & Xiao, Yidong & Liu, Lu, 2022. "Is the oil price a barometer of China's automobile market? From a wavelet-based quantile-on-quantile regression perspective," Energy, Elsevier, vol. 240(C).
    5. Muñoz Mendoza, Jorge A. & Veloso Ramos, Carmen L. & Delgado Fuentealba, Carlos L. & Cornejo Saavedra, Edinson E. & Sepúlveda Yelpo, Sandra M., 2024. "Stock, foreign exchange and commodity markets linkages: Implications for risk diversification and portfolio management," Global Finance Journal, Elsevier, vol. 63(C).
    6. Coskun, Merve & Taspinar, Nigar, 2022. "Volatility spillovers between Turkish energy stocks and fossil fuel energy commodities based on time and frequency domain approaches," Resources Policy, Elsevier, vol. 79(C).
    7. Mensi, Walid & Aslan, Aylin & Vo, Xuan Vinh & Kang, Sang Hoon, 2023. "Time-frequency spillovers and connectedness between precious metals, oil futures and financial markets: Hedge and safe haven implications," International Review of Economics & Finance, Elsevier, vol. 83(C), pages 219-232.
    8. Xian Xi & Xiangyun Gao & Xiaotian Sun & Huiling Zheng & Congcong Wu, 2024. "Dynamic analysis and application of network structure control in risk conduction in the industrial chain," Palgrave Communications, Palgrave Macmillan, vol. 11(1), pages 1-13, December.
    9. Zhu, Yanli & Yang, Xian & Zhang, Chuanhai & Liu, Sihan & Li, Jiayi, 2024. "Asymmetric multi-scale systemic risk spillovers across international commodity futures markets: The role of infectious disease uncertainty," Journal of Commodity Markets, Elsevier, vol. 36(C).
    10. Cui, Jinxin & Maghyereh, Aktham, 2023. "Higher-order moment risk connectedness and optimal investment strategies between international oil and commodity futures markets: Insights from the COVID-19 pandemic and Russia-Ukraine conflict," International Review of Financial Analysis, Elsevier, vol. 86(C).
    11. Cagli, Efe Caglar & Mandaci, Pinar Evrim & Taskin, Dilvin, 2023. "The volatility connectedness between agricultural commodity and agri businesses: Evidence from time-varying extended joint approach," Finance Research Letters, Elsevier, vol. 52(C).
    12. Yousaf, Imran & Ohikhuare, Obaika M. & Li, Yong & Li, Yanshuang, 2024. "Interconnectedness between electricity and artificial intelligence-based markets during the crisis periods: Evidence from the TVP-VAR approach," Energy Economics, Elsevier, vol. 139(C).
    13. Kyriazis, Nikolaos & Papadamou, Stephanos & Tzeremes, Panayiotis & Corbet, Shaen, 2024. "Quantifying spillovers and connectedness among commodities and cryptocurrencies: Evidence from a Quantile-VAR analysis," Journal of Commodity Markets, Elsevier, vol. 33(C).
    14. Yousaf, Imran & Arfaoui, Nadia & Gubareva, Mariya, 2024. "Spillovers and hedging effectiveness between oil and US equity sectors: Evidence from the COVID pre- and post-vaccination phases," Research in International Business and Finance, Elsevier, vol. 69(C).
    15. Cui, Jinxin & Maghyereh, Aktham & Goh, Mark & Zou, Huiwen, 2022. "Risk spillovers and time-varying links between international oil and China’s commodity futures markets: Fresh evidence from the higher-order moments," Energy, Elsevier, vol. 238(PB).
    16. Chen, Lin & Min, Feng & Liu, Wenhua & Wen, Fenghua, 2022. "The Impact of the Infectious diseases and Commodity on Stock Markets," Finance Research Letters, Elsevier, vol. 47(PB).
    17. Sun, Guanglin & Li, Jianfeng & Shang, Zezhong, 2022. "Return and volatility linkages between international energy markets and Chinese commodity market," Technological Forecasting and Social Change, Elsevier, vol. 179(C).
    18. Huang, Jionghao & Li, Ziruo & Xia, Xiaohua, 2021. "Network diffusion of international oil volatility risk in China's stock market: Quantile interconnectedness modelling and shock decomposition analysis," International Review of Economics & Finance, Elsevier, vol. 76(C), pages 1-39.
    19. Zhang, Chuanguo & Mou, Xinjie & Ye, Shuping, 2022. "How do dynamic jumps in global crude oil prices impact China's industrial sector?," Energy, Elsevier, vol. 249(C).
    20. Sahoo, Satyaban, 2024. "Harmony in diversity: Exploring connectedness and portfolio strategies among crude oil, gold, traditional and sustainable index," Resources Policy, Elsevier, vol. 97(C).

    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:gam:jjrfmx:v:17:y:2024:i:7:p:293-:d:1431830. 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: MDPI Indexing Manager (email available below). General contact details of provider: https://www.mdpi.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.