“The impact of COVID-19 on the topological properties of the Moroccan stock market network”

This paper investigates the topological evolution of the Casablanca Stock Exchange (СSE) from the perspective of the Coronavirus 2019 (COVID-19) pandemic. Cross-correlations between the daily closing prices of the Moroccan most active shares (MADEX) index stocks from March 1, 2016 to February 18, 2022 were used to compute the minimum spanning tree (MST) maps. In addition to the whole sample, the analysis also uses three sub-periods to investigate the topological evolution before, during, and after the first year of the COVID-19 pandemic in Morocco. The findings show that, compared to other periods, the mean correlation coefficient increased remarkably through the crisis period; inversely, the mean distance decreased in the same period. The MST and its related tree length support the evidence of the star-like structure, the shrinkage of the MST in times of market turbulence, and an expansion in the recovery period. Besides, the CSE network was less clustered and homogeneous before and after the crisis than in the crisis period, where the banking sector held a key role. The degree and betweenness centrality analysis showed that Itissalat Al-Maghrib and Auto Hall were the most prominent stocks before the crisis. On the other hand, Attijariwafa Bank, Banque Populaire, and Cosumar were the leading stocks during and after the crisis. Indeed, the results of this study can be used to assist policymakers and investors in incorporating subjective judgment into the portfolio optimization problem during extreme events.


INTRODUCTION
The COVID-19 pandemic disrupted the global economy, suspending many economic activities and creating a dramatic and abrupt decline in demand and employment.As a result, global stock market prices experienced the worst slump since the global financial crisis (GFC).In Morocco, severely affected by the COVID-19 pandemic, the Casablanca Stock Exchange slumped during the year's first quarter.Indeed, according to the electronic magazine "MapNews" (MapNews | Actualité marocaine et internationale, n.d.), the Casablanca Stock Exchange (CSE) positively started the year; its leading index, the MASI, achieved on January 22 a high of 12,633.57points and ended the first month of 2020 with a net gain of 2.96%.However, in March 2020, the CSE crashed due to coronavirus-associated psychosis.MASI and MADEX, the two main indices of the CSE dropped to 9,704.85 and 7,876.80 points, recording declines of 20.85% and 21.26%, respectively.These two indicators showed negative performances of -20.27% and -20.59%, respectively.In just three months, the capitalization of 123.67 billion dirhams vanished.
Investment Management and Financial Innovations, Volume 19, Issue 2, 2022 http://dx.doi.org/10.21511/imfi.19(2).2022.21 been used to describe features of financial dynamics (Mantegna & Stanley, 1999).Indeed, the classical theories of rational agents and efficient markets proved insufficient, especially during times of crisis.Network theory provides an unusual tool for investigating stock market network and recognizing trends in a graphical tree topology (Chakrabarti et al., 2006).The interaction and evolution of stock markets are studied using a traditional network approach, which is the minimum spanning tree (MST) method.The main idea is to decrease the complexity of the system by filtering the main information included in the topological structure of the stock market, at the same time, retain the markets' core information.
The COVID-19 pandemic created an entirely new economic environment; the implemented restrictions have significantly influenced the stock markets.Therefore, the present work could help asset managers diversify their portfolios by recognizing the reaction of the network topology of the CSE to extreme events and identifying the essential stocks and companies that influence each other.Although the COVID-19 pandemic caused the crash of many economies around the world, it is not the main threat.Instead, its effects on vital sectors are the most important.Thus, studying the topological evolution of finance, telecommunication, foods, distributors, and the real estate participation stocks is a central focus that provides more insight into the effect of the pandemic.

LITERATURE REVIEW
Thanks to financial globalization, stock markets around the world are highly intertwined.In a local stock market, the spread of risks and the complicated character of internal and external events require an extensive study of the dynamics of the stock market networks.In the financial network literature, researchers have most often deployed correlation-based networks to examine the effect of various events (Mantegna, 1999).Indeed, the concept of networks has proven to be a valuable tool for analyzing the static and dynamic characteristics of the stock market.
Based on a network approach to analyze developed markets worldwide, Onnela et al. (2003) used the MST approach to examine the impact of the Black Monday on 116 companies from 1982 to 2000.Their results showed that the normalized tree length decreased, and the stock market network rearranged during the downturn.In the same way, between January 2006 and November 2010, MST and HT (hierarchical tree) were applied to the first 40 UK companies listed on the London Stock Exchange (Ulusoy et al., 2012).Again, their findings showed a considerable contribution of the economic factors affecting a specific group of clustered stocks.Bonanno et al. (2001) also analyzed the high-frequency cross-correlation that existed in a group of 100 stocks traded in the US stock exchange using the MST and HT methods from 1995 to 1998.Their finding revealed clustering of stocks according to their sector of activity, an explicit role for the topological properties of the MST in portfolio optimization and risk.Also, Brida and Risso (2010) examined 29 leading German stocks listed in the DAX30 Index from January 2003 to November 2008.Their findings showed clustering of companies from the same economic sector after using MST and HT.In addition, after running bootstrap simulations, they discovered structural changes in the expansion of global distances.The financial consequences of the COVID-19 pandemic on the world's exchange markets are significant because the disease's rapid spread affected almost every economic sector.In this way, network theory provides an innovative and powerful tool to investigate the topological evolution of stock exchanges during the COVID-19 outbreak.Specifically, the MST, as a standard network approach, is widely used to study the complex topology of stock market exchanges.After the COVID-19 pandemic declaration, several scientists used MST to study the complex topology of stock market networks in the context of the pandemic.For example, Kanno (2021) evaluated the impact of the pandemic on Japanese companies between April 7 and May 25, 2020.The author discovered that the TOPIX Index evolved in the opposite sense of COVID-19 measures using correlation analysis.In addition, after analyzing the credit risk, they showed that the COVID-19 policies are approximately the one variable that affects a company's credit risk at this time.Zhang et al. (2020) used the MST approach to examine the impact of the COVID-19 pandemic on financial markets.From their results, the COVID-19 pandemic has important effects on global financial markets, mainly reflected in the considerable increases in volatility.Furthermore, their results revealed an apparent difference between the patterns before and after the pandemic announcement in global stock market linkages.Mbatha and Alovokpinhou (2022) analyzed 134 South African companies listed in the ALSI index between October 2019 and October 2020.Analysis of MST and centrality measurements showed that the consumer services, basic materials, and financial sectors are relatively more influential than the other sectors.Furthermore, the findings reveal that the MST expands during the level 5-lockdown and shrinks after it.This review reveals several shortcomings in the literature.Indeed, the existing evidence mainly comes from developed and emerging markets; however, very few studies examine the topology of stock market networks in frontier markets from the perspective of the COVID-19 pandemic, e.g. the Moroccan stock market.

AIMS
Using the MST and other centrality measurements, this study aims to examine the effect of the COVID-19 pandemic on the CSE network topology and compare the Moroccan market topology before, during, and after the first year of the COVID-19 pandemic.To grasp the stock market's reactions to the COVID-19 outbreak, in addition to the full sample (

Minimum spanning tree
By considering companies as nodes and the distance separating them (edges) as a unique function of the correlation coefficient, the MST was created using the methodological approach described by Mantegna and Stanley (Mantegna & Stanley, 1999).First, the following equation is used to calculate the log returns of MSE stock prices: where,

( )
i Pt is the stock price of company ( ) Second, to obtain standardized data, the daily price returns are log-transformed.Following that, the cross-correlation coefficient was calculated using the equation: .
In equation 2, the correlation coefficient , t ij ρ rep- resents the weight allocated to the edge connecting the vertices i and j, and t i r signifies the statistical mean of t i r during the study.The correlation coef- ficients range between -1 and 1, i.e. , 1 1.
To create the MST, the distance between nodes must meet the following three pre-requisite conditions, which are: , .
Third, the metric distance, is used to construct the stock price network, where ij ρ represents the correlation between the log-re- turns of stocks i and j.The MST, designated as T, is finally obtained from an ( ) -links data metric to a minimized total weight of V − 1 isolated edges using Prim's algorithm (Prim, 1957), and the distances ij d between stocks i and j.

Weighted network measures
Normalized tree lengths, degree centrality, and betweenness centrality are three sub-metrics used to examine the MADEX index stocks' importance changes.The normalized tree length is used to evaluate MST tree length over the study period.Its formula is: The degree centrality of a node refers to the number of its neighbors (Freeman, 1978), and is used to determine a stock's strength to influence other stocks directly and is given as follows: where kh A = if the stock i and stock j are linked, and 0 otherwise, and N is the total number of stocks.Betweenness centrality is the ability of a node to control other nodes by regulating information flows between them (Freeman, 1977).The greater the node's impact on the network, the higher its value.It is calculated as: where ( ) σ denotes the number of shortest paths that cross stock k from stock s to stock t.While st σ is the total number of shortest links be- tween s and t, such that sk ≠ and .tk ≠

RESULTS AND DISCUSSION
This section synthesizes the findings obtained from the correlation matrix of MADEX stocks by using the log return of the daily closing price from March 1, 2016 to February 18, 2022.The analysis and discussion concern the correlation coefficients, distances and tree lengths, minimum spanning trees, degree centrality and betweenness centrality measures.

Correlation coefficient and distance
Table 1 shows the correlation coefficients and distance values between the MADEX stocks during the three periods.
The overall sample average correlation between MADEX stocks is 0.077, which is less than the whole sample mean correlation of 0.128 for the Pakistan stock market (Memon & Yao, 2019) and is lower than the mean correlation of 0.145 for the South African stock market (Majapa & Gossel, 2016) during the GFC.As a result, the CSE network seems less clustered and homogeneous than the South African stock market and the Pakistan stock market.Furthermore, the findings suggest a decreased mean correlation before the crisis period, indicating weaker clusters.However, the mean stock correlation increased by nearly seven times during the crisis period compared to before the crisis, stabilizing at 0.048 after the crisis period, which is somewhat higher than the mean correlation of 0.031 before the crisis.Therefore, although the CSE showed a low correlation during the overall period, its response to the COVID-19 crisis was rather impressive.The data sets were equally partitioned into windows (W) of 247 trading days approximately across the total period to explore the dynamic evolution of the correlations and distances among the stocks included on the MADEX index, as proposed by Situngkir and Surya (2005) (Table 2).Table 3 shows the six windows with the corresponding average correlation and distances during the total studied period.The findings indicate that the mean correlation in W1, W2, W3, and W4 (the post-crisis period) is extremely low and peaks in W5, which matches the crisis period, and decrease dramatically in W6, which was the start of recovery proceedings in Morocco.The highest tree distance is observed in W4 just before the downturn.The smaller distance values during the first year of COVID-19 pandemic resulted in the shrinkage of the tree, whereas it was more extended before the crisis in W4.

Dynamic evolution of correlations and distances
The dynamic evolution of the normalized tree length, total distance, and hub adjustment is shown in Table 4.The results highlight the impact of three major sectors in the MST: real estate, distributors, and banking, where companies from these sectors occupy a central posi-tion in the MST.The findings imply that during the W5, the normalized tree length decreases considerably.Increasing correlation during the W5 crisis stretches the node and compresses the MST.It expands at W6, justified by the declined correlation coefficient and causing the most significant distances.This expansion means that the Moroccan economy has entered the recovery period.

Minimum spanning tree
To investigate the dynamics and the efficiency of nodes, three MSTs of the CSE network were plotted for three periods around the first year of COVID-19 in Morocco, nodes are colored based on their respective sector (due to a large number of sectors, only nodes which sector include two or more companies are colored).Figure 1 illustrates the MST in the period before the  Therefore, the MST emphasizes that the distributors, the telecommunications, and the oil and gas sectors play a major role in the Moroccan economy before the crisis period.The MST shows a lower clustering and homogeneity compared to other stock markets.However, to some extent stocks belonging to the financial, construction and building, distributors, mining, and real estate sectors are linked, forming groups of stocks.The other stocks are dispersed through the tree.Financial companies operating in the banking sector are placed in the middle of the MST, while the insurance companies are scattered on the outskirts.
The MST corresponding to the crisis period is given in Figure 2. As can be observed, Attijariwafa Bank (ATW) and La Banque Populaire (BCP) are the two key nodes with the most connections.Their degrees climbed from tree connections before the crisis to ten and eight respectively in the crisis period.Due to the COVID-19 crisis, these companies represent the central nodes of the MST.Therefore, they are directly exposed to any network shock.Indeed, compared to the MST before the crisis, the crisis MST displays an increase in connections.Microdata (MIC) is another key node with five links.Effectively, despite the COVID-19 pandemic, the Microdata's net income increased in 2020 by 8.9% compared to 2019.This can be explained by the fact that banks, which are the most resilient companies to the impact of a financial crisis, are the main customers of Microdata.It is evident that during the downturn, the financial sector played a crucial role.eral stocks form homogeneous groups of companies belonging to same sectors.These sectors are the real estate participation and promotion, the mining, the material software and computer, and the construction and building sectors.Concerning the other sectors, the stocks are dispersed throughout the tree.
Figure 3 shows the MST after the crisis period.Similar to the downturn period, the results show the emergence of the Attijariwafa Bank (ATW, 5) as a critical node.This finding is eventual, since the Moroccan economy has not recovered from the COVID-19 crisis yet.The most significant exception is the Banque Populaire (BCP) node, which connection was reduced from eight to four connections and replaced by Cosumar (CSR,5), a food sector stock.As a result, the MST after the crisis shows a decrease in links number (node's degrees) compared to the crisis period.Again, this behavior is similar to what has been observed in the South African stock exchange network after the crisis (Mbatha & Alovokpinhou, 2022).

Degree and betweenness centrality
Based on two measures of centrality, which are the degree and betweenness centrality, the relativistic strength of every node in the MSE network is calculated.Table 5 shows the first five nodes with the highest degree of centrality for each period.Due to the smaller number of edges connected to nodes during the three periods, the MST presents a decline in the average degree of centrality.Indeed, Attijariwafa Bank has a lower degree value of 0,063 before the crisis period.However, it achieves the top values during and after the crisis with a degree value of 0,208 and 0,104, respectively.Similarly, Banque Populaire (BCP) degree centrality increased from 0,063 before the crisis to 0,167 and 0,104 in the period of crisis and after it, respectively.Moreover, CSR (Cosumar) suddenly appeared in the first three stocks after the crisis.Besides, apart from Attijariwafa Bank (ATW) and Banque Populaire (BCP), there are no long-term stocks in the ten most important degree centrality values during the three periods.This classification signifies a reorganization of the network to adapt during challenging times.Indeed, companies from the distributors and telecommunications sectors were the strongest before the crisis.However, the banking and food companies replaced them during and after this downturn.The analysis of the betweenness centrality during the three periods ( According to the results, there are no constant stocks included in the top five throughout the three periods.However, before and during the crisis period, Itissalat Al-Maghrib (IAM) was in the top five, while Attijariwafa Bank (ATW) was in the top five during the crisis and after it.Indeed, Itissalat Al-Maghrib (IAM), which belongs to the telecommunications sector, was a good mediator before the crisis.But then, companies from the banking sector replaced it during and after the crisis.Besides, Douja prom addoha (ADH), which belongs to the real estate participation and promotion sector, was influential after the crisis.

CONCLUSION
Using the daily closing price of the 49 companies listed in the MADEX from March during the crisis, resulting in a tree's compression during this period.During a stock decline, companies act simultaneously, and their correlations are much higher than those of a regular period.Furthermore, centrality measures suggest that hub nodes were moving away from the distributors and telecommunications sectors before the crisis to the banking and food sectors during and after the crisis.
All of these results on the network dynamics and the relative importance of specific stocks could support CSE local and foreign investors in handling their portfolios as well as the regulatory authority in assessing the stock market's stability.Further research could exploit the complexity and self-similarity of the MSE network.
March 1, 2016 to February 18, 2022), the data (March 1 2019, to February 18, 2022) were split into three periods of equal length.The first one starts on March 1, 2019, and ends on February 28, 2020.The second sub-period is from March 2, 2020, which coincides with the announcement date of the first case of COVID-19 in Morocco, until February 16, 2021.Finally, the third sub-period runs from March 1, 2021 to February 18, 2022.The study tests the following hypothesis: H1: The Moroccan stock market network has reacted to the COVID-19 pandemic.

Figure 1 .
Figure 1.Before crisis minimum spanning tree of the MSE network (March 1, 2019 to February 28, 2020) The MST confirms the research conclusions on the UK stock market conducted by Coelho et al. (2007) and Coronnello et al. (2005), which found that the financial sector was the tree's backbone.Compared to the period before the crisis, sev-

Figure 3 .
Figure 3.After crisis minimum spanning tree of the MSE network (March 1, 2021 to February 18, 2022) (Prim, 1957)rvations of N = 49 stocks were evaluated using daily closing prices from March 1, 2016 to February 18, 2022.The analyzed stocks are included in the MADEX index, consisting of the most active stocks listed on the Casablanca Stock Exchange.Among the 53 listed stocks in the MADEX index, only those were selected whose data were available during the analyzed period.Two computer programs were used to process the data; firstly, the time series data were collected from the Casablanca Stock Exchange's official website and saved in a Microsoft excel file (Bourse de Casablanca, n.d.).Secondly, the files were transferred to the R-Studio software to apply the Prim algorithm(Prim, 1957)and generate the MST.The variable sector assumed twenty-one values determined according to the Casablanca Stock Exchange.The company's tick symbols, names, and corresponding sectors are listed in TableA1of the appendix.

Table 2 .
Partition of the data sets into six windows

Table 3 .
Dynamic variation of the mean correlation and distances

Table 1 .
Summary observations before, during, and after the first year of the COVID-19 pandemic in Morocco and the overall period

Table 4 .
Topological characteristics of the MST corresponding to the six equal windows

Table 5 .
The five highest values of degree centrality for the three periods

Table 6 .
The five highest values of betweenness centrality for the three periods

Table 6
1, 2016 to February 18, 2022, this study investigate the effect of the COVID-19 pandemic on the CSE network topology.The data (March 1, 2019 to February 18, 2022) were divided into three periods: before (March 1, 2019 to February 28, 2020), during (March 2, 2020 to February 16, 2021), and after the first year of the COVID-19 in Morocco (March 1, 2021 toFebruary 18, 2022).The relative importance of each stock in the MADEX network is estimated using two centrality measures: degree and betweenness centrality.Roughly, the results reveal that, during the overall period, the correlation coefficients across the MADEX companies are weak.The correlation would be higher if the CSE were more efficient, allowing short selling or developing derivative trading.Furthermore, foreign investors' access to the CSE was liberalized only in the last years.
The study results supported the research hypothesis that suggests a CSE network reaction to the COVID-19 crisis.Indeed, the MST showed a shrinking during the first year of the COVID-19 pandemic in Morocco compared to the MST before and after this year.The topological transformation of the MST in time of crisis represents a specific result of the COVID-19 pandemic.The correlation coefficients rise Investment Management and Financial Innovations, Volume 19, Issue 2, 2022 http://dx.doi.org/10.21511/imfi.19(2).2022.21