Forecasting and modeling time series is a crucial aspect of economic research for academics and business practitioners. The ability to predict the direction of stock prices is vital for creating an investment plan or determining the optimal time to make a trade. However, market movements can be complex to predict, non-linear, and chaotic, making it difficult to forecast their evolution. In this paper, we investigate modeling and forecasting the daily prices of the new Morocco Stock Index 20 (MSI 20). To this end, we propose a comparative study between the results obtained from the application of the various Machine Learning (ML) methods: Support Vector Regression (SVR), eXtreme Gradient Boosting (XGBoost), Multilayer Perceptron (MLP), and Long Short-Term Memory (LSTM) models. The results show that using the Grid Search (GS) optimization algorithm, the SVR and MLP models outperform the other models and achieve high accuracy in forecasting daily prices.
This paper investigates the nature of the associations and the potential existence of both short-run and long-run relationships between the stock market indices of Morocco, France, Germany, the United Kingdom, China, and the United States from January 2014 to January 2024. The purpose of analyzing dynamic interconnections and contagion effects is to determine how the stock markets of these countries influence and relate to each other. The study employs a time series Vector Error Correction Model (VECM) approach, incorporating stationarity, cointegration, and Granger causality tests. Additionally, the Impulse Response Function (IRF) is used to analyze the response of variables to shocks. The bivariate Granger causality test reveals significant causal influences: from France, Germany, and the USA to Morocco; from the USA to the DAX and France; and from the UK to Germany. After establishing the Granger causal relationships, long-run and short-run relationships are further examined. Using the Johansen multivariate cointegration approach, the study suggests a long-term equilibrium among the six stock market indices over time. The short-run adjustments are analyzed using the VECM, which reveals that adjustments in the CAC 40, DAX, and MASI tend to correct deviations from equilibrium, indicating a tendency to move towards equilibrium. For the FTSE 100, S&P 500, and SSEC, the VECM captures the speed and direction of adjustments as these indices respond to short-term disruptions and work towards restoring equilibrium. The findings underscore the importance of closely connected global stock markets, which means that international regulators must coordinate their efforts to reduce the risks of contagion. Policymakers should prioritize improving financial stability through integrated frameworks considering short-term disruptions and long-term equilibrium trends.