The interdependency structure in the Mexican stock exchange: A network approach

Our goal in this paper is to study and characterize the interdependency structure of the Mexican Stock Exchange (mainly stocks from Bolsa Mexicana de Valores) for the period 2000-2019 which provide a one shot big-picture panorama. To this end, we estimate correlation/concentration matrices from different models and then compute centralities and modularity from network theory.


Introduction
In this paper we investigate the interdependency structure of daily returns in the Mexican stock exchange market. To this end, we build a database of free and publicly available time series of main stocks for the period 2000-2019 and conduct our study in stages that are then put together to give a unified treatment to our main topic of interest here which is the interdependency structure of daily log-returns in the Mexican stock exchange.
In the first stage we focus on the estimation of partial correlations of log returns of daily prices. The reasons for focusing on partial correlations are the following. Given a collection of Gaussian series A 1 , . . ., A n , a zero partial correlation between A 1 and A 2 implies that A 1 and A 2 are conditionally independent, meaning that A 1 and A 2 could still be (unconditionally) correlated but only through a third factor adapted to the other series A 3 , . . ., A n . There are of course different methods of estimating a covariance/correlation/concentration matrix and we have selected a estimation based on a specific class of Markovian Random Fields (MRF) which in the statistical literature is well known under the name Gaussian Graphical models (GGm). The adjective "graphical" emphasizes the fact that attached to the probabilistic model there is a graph in which edges express conditional dependencies, from which a very convenient visual representation is obtained. There are three reasons for working with this model. First of all, the benefit of the already mentioned visual representation provided by the model. The second is that we have decided to study the period 2000-2019 on a yearly basis. There is a trade-off to this treatment. On the one hand, short periods of time reduce problems with heavy tails. On the other, the number of stocks in each year is a significant proportion of the available observations. Hence, a lasso-regularized estimation is useful in this context which is inbuilt in the estimation of a GGm. Third, we want an estimation that filters out a "noisy" correlation selecting only clear relationships between two series, again this is provided by the lasso-regularized a1111111111 a1111111111 a1111111111 a1111111111 a1111111111 estimation. Loosely speaking, we follow a partial correlations selection approach which conceptually is comparable to a covariance selection approach [1]. Once partial correlations matrices have been estimated we provide a list of stylized facts from them. Then, taking the graphs constructed from the matrix of partial correlations as its adjacency matrix, we compute eigen-, between-, and degree-centralities.
In a second stage we compute networks based on matrices of Tail-dependence coefficients ( [2]) of every pair of log returns. This coefficient quantifies the relationship of lower tails and captures dependencies in the events of negative returns.
In the third stage we estimate correlation matrices of time series (estimated through a Multivariate Dynamic Conditional Correlation GARCH specification). Then, we apply a technique from network-theory based on those correlation matrices known as the maximization of a modularity objective function. This procedure will provide a community structure.
As part of our main goal of studying the interdependency structure of the Mexican stock exchange we contribute to the existing literature on financial networks concerning the following aspects. First of all, many papers focus on financial networks constructed from Pearson correlation matrices but much less papers focus on financial networks constructed from partial correlations and/or Tail-dependence matrices, as we do here. Moreover, from the few papers focusing on partial correlation matrices, we are not aware of any of them applying the Gaussian Graphical model we consider in this paper. As a consequence no paper has previously compared network-structures from the three afore-mentioned different matrices (Pearson correlation, partial correlations and Tail-dependence) as we do in the present paper. The premise is that different underlying matrices yield different network-topologies.
Many papers study aggregated financial indices and do not go into the details of analyzing at the level of stocks in the selected market, hence missing the point of analyzing interdependency at the level of individual stocks, where the network perspective could represent an advantage to support financial decisions; see e.g., [3, pp. 8, inmediately before the section "Factor models"]. For example, we find that the main index in the Mexican stock exchange denoted IPC (not to be confused with the Index of Consumer Price level.) is "influential" with respect to degree-and eigen-centrality but the intensity varies with respect to which matrix the network is based on. However, it is not influential with respect to betweenness-centrality. Thus, the index does not convey all the information in the market; compare e.g., again with [3, pp. 10, first paragraph].
Few papers focus on the case of Mexico, a representative market in the region which some studies have found to be a connecting node between Latin American and US markets, hence playing a key role; see [4]. For example, [5] is an early paper studying stock market integration between Latin American countries and the US. This includes Mexico, but only as part of the region with no particular focus.

Background
The classical Markowitz theory of portfolio selection illustrates the relevance of asset correlation matrices for financial decisions. However, the nontriviality of correlation estimation from empirical data has been known for a long time, see e.g., [6]. Moreover, in contexts where sparse correlation (specially for partial correlation) matrices are expected, it is desirable to have a systematic method to discard "non-clear correlations" and account for a parsimonious model as motivated by [1]. As we mentioned in the introduction, in this paper we choose to apply a GGm for a parsimonious estimation of concentration/partial-correlation matrices.
Estimation of Tail-dependence coefficients are based on the non-parametric estimator in [7]. Pearson-correlation matrices are estimated from a multivariate GARCH model.
Beyond the estimation problem, it is useful to have tools that, starting from matrices, are able to generate metrics providing snapshots of the market from which quick but trustable diagnosis are available. Situations in which this is desirable include, from the point of view of an investor, the decision to rebalance a portfolio, and from the point of view of a regulator, interventions in the market in order to lessen the contagion of a shock in a specific sector.
We find those tools in the theory of random graphs, specially in the form of metrics (in this paper, degree-, eigen-and betweenness-centralities) which classify the interconnectedness of stocks and a global metric (the modularity computed from correlation matrices) to detect communities of stocks.
The approach described integrates into the outline of [8] and is a very active research area; see e.g., the survey in [9]. However for the Mexican stock exchange there has been little research in this direction. In the next section we present related literature. Note however that we do not pretend to provide an exhaustive revision of this active topic which deserves a survey by its own, but to give a brief panorama of current research in this area.

Stock markets from GGm, random graphs, and network-theory approaches
Gaussian graphical models, Random graphs, and Network theory approaches in a financial context is an active research area attracting more and more attention with an increasing number of papers; see e.g., the survey in [9]. The following is a non exhaustive list merely describing different approaches and applications.
Papers in finance reporting an approach related to a graphical model include [10,11] and [12]. However, none of these papers focus on asset prices. Theoretical background on graphical models can be found in [13,14] and [15].

Subprime crisis
According to [46] there indeed existed an impact from the 2007-2008 subprime crisis on the Mexican economy. Mainly due to two shocks, first, a decline in Mexico's exports and second, a constrained access to international financial markets, thus evidencing an integration of the Mexican stock exchange with the US market. A phenomenon documented by some authors; see e.g., [47][48][49].  [50] and [51]. Later we will go beyond a visual examination and confirm by a multivariate GARCH model through a shift from positive to negative intercepts on log returns of each time series of the period. However, quite interesting, we will show that the partial-correlations interdependency structure of the Mexican financial market does not exhibit a drastic change as consequence to that shock, see

Data
We constructed a database of daily closing prices from free and publicly available information at Yahoo.Finance website which we downloaded through the R package quantmod. The complete list of analyzed stocks can be found in the S1 Table. The frequency of data is daily in a span of time comprising 01-01-2000 to 31-12-2019. We have considered throughout the paper time series of log returns: Data is organized in windows of one year (from january to december) and we applied a filtering process in two steps. In the first step, for each year, stocks in the market with the most complete information were selected. The criterion was that only stocks with more than 90% of all the available dates were selected. Then, in a second step, stock prices not having a minimum of variance in moving windows spanning 30 dates were discarded. This filtering process already presents the interesting fact of a positive evolution of the Mexican stock exchange in the sense of an increase in activity. Indeed, as we go forward through the years, more and more time series of stock prices satisfy the filtering process, evidencing an evolution in terms of more activity in the market with more variability of prices and more quotes. Visual evidence can be found in Fig 3. An important aspect of this work will be to consider how industrial sectors are interconnected. Here we consider a list of sectors obtained from the Bolsa Mexicana de Valores (BMV) classification. These are listed in Table 1. Fig 2 presents an estimated network in which stocks can be identified in its sector.

Gaussian graph model
Markovian random fields. In this section we start with the basic definition of a MRF which is the fundamental probabilistic concept from which a GGm is defined. Let us introduce a graph G = (V, E) with a set of nodes V = {1, . . ., n} and edges E. Recall that a complete subgraph of G is called a clique. We denote by C the class of maximal cliques of the graph G. Let us start with a given a random vectorX ¼ ðX 1 ; . . . ; X n Þ with multivariate cumulative distribution function p. Then, the vectorX has a Gibbs distribution compatible with the graph G if its distribution has a representation where fc c g C2C are suitable functions and x C denotes a vector in which only the indexes of C appear. Gibbs distributions are characterized through different Markov properties. To this end, we need a notation. For A � V, A ¼ ðA i 1 ; . . . ; A i k Þ, the notationX A denotes the vector ðX i 1 ; . . . ; X i k Þ. The following list provides the Markov properties: 1.X is a MRF with respect to G if it has the Markov property: For any pair i, j 2 V with i 6 ¼ j and non adjacent in the graph G, the random variables X i and X j are conditionally independent on all the other variables. We denote this conditional independency by: 3.X is globally a MRF if: For two disjoint subsets A, B � V, the vectorsX A ,X B are conditionally independent on a separating set S � V. We denote this by: We continue with a fundamental equivalence result; see [52,Chapter 7]. Theorem 1 (Hammersley-Clifford). Assume that the cumulative distribution p ofX is defined in a finite state space and is positive valued. Then p is a Gibbs distribution if and onlyX satisfies any of the above listed Markov properties.

PLOS ONE
The interdependency structure in the Mexican stock exchange For a list of Gibbs distributions see [13,Section 3]. In this paper we will work with the following specific Gibbs distribution (hence, specific MRF and specific GGm) where n is the dimension of the random vectorX, and A(�) is a normalizing constant; see [13,Example 3.3] for more details. The MRF model in (1) also specifies the GGm we will work with. Indeed, (1) does not apriori specify any graph, but from the set of parameters Y i;j 2 R we derive a partial correlation matrix which indeed can be seen as the adjacency matrix of a weighted graph. Covariance selection. Let Σ ¼ ðS i;j Þ be the covariance matrix of a random vectorR ¼ ðR 1 ; . . . ; R n Þ with multivariate Gaussian distribution. A zero component S i,j = 0 expresses marginal independence between R i and R j . The inverse matrix J ≔ Σ À 1 is the so-called concentration matrix. It has the property that a zero component J i,j = 0 expresses conditional independence; see e.g., [ It is possible from further considerations that many components J i,j are expected to be zero. In this case, it is desirable to have a statistical procedure to estimate the distribution taking into account such information. One such procedure is the so-called covariance selection in [1]. Grounded on maximum likelihood, it provides a framework to test for zero partial correlations. Recent research on covariance selection focuses on sparse large dimensions in which the number of variables is large but there are also many variables which are conditionally independent; see [54]. Thus, for such structures the concentration matrix is sparse and the lasso (least absolute shrinkage and selection operator; also lasso or LASSO) method introduced by [55] is fundamental for statistical estimation and variable selection. Indeed, the Gaussian Graphical model that we are going to use is nodewise estimated through a lasso procedure. For the lasso implementation we use the R package mgm that builds on the package glmnet. The estimations of this last package are based on the algorithm of [56]. Then, the collection of nodewise regressions are combined through an AND rule to give a unique estimation of a multivariate vector. This approach is naturally based on the asymptotic consistency results due to [54]. In particular, the estimation yields a concentration matrix J. Systematic presentations for graphical models can be found in [13,14] and [15].
The GGm. Now we explain the specification of the GGm we are going to estimate. Let S be the covariance matrix of the log returns time series R(1), . . ., R(n). Denote by J the concentration matrix, J ≔ S −1 . The components of the matrix J are given in terms of the coefficients Θ i,j in Eq (1). Denote by ρ i,j the partial correlation of R(i) and R(j). Consider the linear regressions defining partial correlations: where μ i is the unconditional mean of R(i) and �(i) is a residual. Then b ij ¼ r i;j ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi varð�ðiÞÞvarð�ðjÞÞ

PLOS ONE
The interdependency structure in the Mexican stock exchange It is also true that The adjacency matrix P = (P i,j ) is defined by Remark 1 Let us emphasize now that the estimation of the GGm (1) will ultimately result in the matrix P and this matrix is our main input for the network based on the GGm.
Results from GGm estimation: Stylized facts. In this section we report the results of estimating a GGm for each year in the period 2000-2019 using (1). From this estimation exercise, we get a partial correlation matrix P for each year in the period 2000-2019, hence twenty matrices in total. A graphical representation of partial correlations is displayed in the panel of  Table 2 we display partial correlations in absolute value above the threshold 0.3.
Partial correlations in absolute value in the interval (0.2, 0.3] are displayed in Table 3.

PLOS ONE
The interdependency structure in the Mexican stock exchange In Tables 4 and 5 we provide information concerning most persistent links in the observed period.
We obtain the following stylized facts: • First of all we see in  indeed existed (e.g., dot.com bubble, the subprime crisis and the European soveregin debt crisis) it doesn't seem to produce large variations in network interdependency structures.
• There are several edges with a weight (partial-correlation) above the threshold 0.2 which frequently include the main index from the Mexican stock Exchange BMV denominated IPC (quoted as MXX in Yahoo.Finance); see the Tables 2 and 3.
• As we move forward in time, the market grows (with more nodes of stocks consistently quoted by year). However, it does not seem to be evidence that interconnectedness in the market changes drastically from one year to the next, even for the subprime crisis period.
• Connections must be due to exogenous factors to the market, but inherent to each stock, since the graph is based on partial correlations. However, for edges that include the IPC node, the other node may be a stock used in the construction of the index.
• A large number of links between stocks in different sectors wich is an empirical fact reported for other markets; see e.g., [16], and to our best knowledge, not previously documented for the Mexican stock market. Nonetheless, intrasectorial partial-correlations are also present.
• There are persistent links between pairs of stocks that appear frequently, but not systematically, over the twenty year period; see Tables 4 and 5.
• For the year 2000 we see a partial correlation of 0.98 between ICA and ELEKTRA which appears to be an odd finding, but it is actually supported by data; see  • FEMSA indeed has a persistent relationship with the IPC index with partial correlations above 0.3; see Tables 4 and 5. In this same tables we do not see an important stock such as AMX. This is an interesting confirmation of the strength of the GGm, since it captures real facts (see for example news stories from the mexican magazines expansion and el economista).
In Fig 5 we see a panel of barplots for degree-centralities separated into different ranges for all stocks in their respective period. Links with negative values are few in quantity and magnitude as more precisely illustrated in Fig 5(a). In Fig 5(b) we see a quite homogenous distribution in the range [0.01, 0.1]. An analogous situation is appreciated in Fig 5(c) in the interval

Centralities from partial correlations
Centrality is a metric designed in such a way that a vertex with high centrality can be considered highly influential. The first concept of centrality we use is the degree-centrality which for a vertex in a weighted network is the sum of weights of the connecting edges. For our graphs of partial correlations, the degree centrality gives information on the pattern of a shock's transmission. The idea is that if an influential (i.e., with high centrality) stock in the financial network is having a bad day, it will be accompanied by many other stocks in similar situations. Note that there is no causality claimed here. The second measure of centrality that we estimate is the eigen-centrality. This is a global measure in that scores for each node are assigned via a

PLOS ONE
The interdependency structure in the Mexican stock exchange comparison of the quality of its links. For example a node with just one link to another influential node could have a highest eigen-centrality than a node with two or more links. The computation of eigencentralities transfers to a spectral analysis of the adjacency matrix and in crucial steps is substantiated by Perron-Frobenius theory (see e.g., [57,Chapter 17]). The third concept that we estimate is betweenness-centrality for the absolute values of weights. For each vertex, it gives the proportion of shortest paths passing through it.
Shock transmissions. Let us explain in more detail eigencentrality and at the same time also clarify shock transmissions. Let V = {1, . . ., n} index our set of stocks and recall the matrix P defined in (4). The eigencentrality is a function f : V ! R satisfying where r is a non negative constant and N(v) denotes the neighbors of v. Note that since by definition w 2 N(v) if and only if P v,w 6 ¼ 0. Now this can be written in matricial notation as . Hence, f(V) is an eigenvector of P attached to r as its eigenvalue.
To continue we follow the discussion in [17], returning to the coefficients β i,j in Eq (3). The matrix of coefficients B = (β i,j ) with β ii = 0 is then connected to the adjacency matrix as We can write the linear regression in a compact matricial notation as LetRðiÞ ≔ RðiÞ À mðiÞ andR ¼ ðRð1Þ À mð1Þ; . . . ; RðnÞ À mðnÞÞ. Then, Hence the vectorX ≔ diagðJÞ 1 2R satisfies where Z ≔ diagðJÞ 1 2 �. Now assume that between times t 0 and t 1 there is a shock Δ = (0, . . ., 0, δ, 0, . . ., 0) affecting X(i). Then,X at time t 1 is given by PðX þ DÞ þ Z and the change is then PΔ. Note that PΔ does not need to be a scalar of Δ, meaning that the shock originally affecting X(i) has also an impact on other components, indicating that the shock propagates.
The spectral decomposition of P helps in assessing the scale of propagation and rationalizes the definition of eigencentrality. Let W 1 , . . ., W n be the set of eigenvectors of P and Λ = {λ 1 , . . ., λ n } the corresponding set of eigenvalues, which we assume is decreasingly ordered with respect to its modulus. Here is a common assumption: there is a unique eigenvalue attaining the spectral radius. This means |λ 1 |>|λ 2 |�|λ 2 |. . . � |λ n |. If the matrix P has only non-negative components, then the Perron-Frobenious theory guarantees we are in this situation and other properties besides; see e.g., [57,Chapter 17]. Represent Δ by Δ = ∑ i α i W i . Then, for k 2 N Then, as time passes the leading term indicating the effect of the initial shock Δ takes the form l k 1 a 1 W 1 . Fig 6 we see estimated centralities for our networks. The blue line is the largest modulus per year of eigenvalues. The green line represents the maximum degree-centrality for each year and unsurprising this maximum is always attained by the IPC index. The red (respectively red and dashed) line represents the average of each node's degreecentrality (respectively the average of each node's absolute value degree-centrality). The gray

PLOS ONE
The interdependency structure in the Mexican stock exchange line represents the maximum of betweenness-centrality which has been computed for absolute values of weights with the R package igraph.
These are the findings we observe from Fig 6: • The spectral radius is approximately bounded by two, which coincides with the range documented for other markets; see e.g., [16].
• The red line and the red dashed lined are almost indistinguishable. This happens as a consequence of the fact that almost all partial-correlations are non-negative. We also observe the stability on the metric represented by this line.
• The patterns of the green and blue lines are similar. As we mentioned, the green line is attained by the IPC index, so it could be expected that the blue line is also related to this index. Although we do not investigate this claim, assuming it is correct, in order to capture effects beyond the IPC index it might be necessary in this case to complement with the second eigenvalue together with its eigenvector for centrality and the analysis for a shock contagion. Indeed, Fig 7 shows that in many cases the dominant eigenvalue has a multiplicity of two or more, and in other cases that the second eigenvalue turns out to be close to the first.

PLOS ONE
The interdependency structure in the Mexican stock exchange Certainly, the idea of considering beyond the dominant eigenvector for eigencentrality is not new; see [58]. Analysis for the Mexican case will be addressed elsewhere.
• There is indeed variability for centralities, but changes from one year to the next are indeed relatively small. Thus, changes are subtle. For example, for the subprime crisis period, we see Discussion. The financial networks of partial correlations illustrated in Fig 3 present low degree centrality and are sparse. Below we construct financial networks based on Pearson correlation matrices and we will also compute their centralities; see Fig 12. A comparison of Figs 6 and 12 yield evidence that partial-correlations generate sparser networks, understood by the fact that comparing year by year, centralities for partial correlations are significantly lower than for Pearson correlations. This was expected and agrees with the findings in [16] and [17] which also compare networks based on Pearson and partial-correlations. Interestingly, estimations of matrices are done by different methods and different data, thus, providing evidence that sparsity of partial-correlation based networks are robust with respect to statistical procedures and data. Another paper that also compares networks based on Pearson and partial correlations is [4]. The authors conclude that networks based on Pearson correlations show different structures than partial correlation matrices, and in particular a different clustering structure. However, they construct Minimum Spanning Trees and the comparison of sparsity is unclear. They also compute betweenness-centrality. Although they report differences, these are not as marked as the ones presented here. We will elaborate on betweenness-centrality further after we also analyze Tail-dependence networks.
The IPC index has been found to be a vertex where edges consistently present their highest weight (partial-correlation). Indeed, the maximum of degree-and eigen-centralities are always attained at this vertex. If the analysis of the mean variance portfolio of [23] holds true also for partial correlations, then this would mean that in such a portfolio, the IPC seen as an asset on its own would receive a lower weight. Thus, any Exchange-Traded Fund (ETF) tracking the IPC index does not diversify investments from the point of view of the classical Markowitz portfolio theory and achieve a lower proportion of portfolio value. Whether the negative relationship found in [23] also holds true for partial correlations can be the subject of future research, however we find that the IPC index also has high degree-and eigen-centralities for networks based on Tail-dependence and Pearson correlation matrices.
In the period 2000-2019 there are three important financial episodes: The dot.com bubble, the subprime crisis and the European sovereign debt crisis. The time series of centralities in Fig 6 exhibit several local maximum which may connect with those episodes. Now here is a trade-off. Partial correlations and the lasso estimation of the GGm indeed result in a stringent sieve in which only the most significant and "clear" relationships pass through and as a consequence the centrality time series are quite stable. However, the aforementioned financial episodes are captured by centralities of partial-correlations and show moderate increases. We will see that Tail-dependence networks exhibit a more sensible topology for those market conditions. This is reasonable due to the symmetric nature of distributions in GGm while on Taildependence networks the emphasis is on lower tails.

Tail-dependence networks
For two random variables X and Y the Tail-dependence coefficient ( [2]) is the limit where F X represents the cumulative distribution of X, and similarly for F Y . It is clear that λ L quantifies the relationship of lower tails between X and Y. In this section we focus on networks based on matrices whose components are the coefficients λ L for pairs of stock time series. We estimate the Tail-dependence coefficient through the non-parametric estimator in [7] which is implemented in the R package FRAPO (Financial Risk Modelling and Portfolio Optimisation). In

PLOS ONE
1. The IPC index is also important with respect to eigen-centrality, just as it was for partialcorrelation networks.
2. For betweenness-centrality the 95% quantile is quite dynamic concentrated in a few stocks and consistently does not include the IPC index.
3. The 95% quantile is more distributed for eigen-centrality than for betweenness-centrality.
4. Fig 10 clearly shows that time series of centralities experience an increase in activity associated with the subprime and the European sovereign debt crisis.
Discussion. In Fig 10 we see an illustration of financial network's interdependency-evolution for the Mexican stock exchange. The first fact to note are the peaks in the years 2008 and 2011. It is reasonable to associate such increments in interconnectedness (as measured by degree-and eigen-centrality) to the subprime financial crisis and the European sovereign debt crisis. This is coherent with findings in the literature. It is worth emphasizing that in this literature, other data have been analyzed with different methods. For comparison, let us recall a few papers in this regard. A financial network from 100 selected stocks of financial institutions in the US is studied in [29]. Emphasis is on tail events from the point of view of systemic risk. They find that the banking sector is at the core of systemic risk between 2008 and 2010. In contrast, the insurance companies are less relevant for systemic risk. Their empirical results exhibit growing interconnectedness during the period of a financial crisis. A financial network based on Tail-distributions is studied by [30]. Data comes from a selection of 51 time series of large European banks and 17 sovereigns bonds during the period from 2006 through 2013. Their empirical results show that network densities increase from the intensity of the (subprime) financial crisis. More precisely, network densities increases from 2006 up to its (local) maximum around the peak of the global financial crisis and then decreases. A different approach based on entropy is studied by [28]. The empirical result reports that "node strengths peak in times of crisis".
Hence, there exists an empirical fact manifest along a variety of methods applied to different data: estimated network-interconnectedness increases at some point in the development of a crisis, it might indeed affect one sector more than other, yet it is going to be globally observable. We evidence this empirical fact for the Mexican stock exchange in Fig 10. This is already interesting, and going deeper into the details, we mention two subtleties about timing and the different centralities. We have observed in partial-correlation networks that degree-and eigen-centrality show the same pattern. This similarity in patterns happens also for the Taildependence networks analyzed in this section; compare Figs 6 and 10. It will be observed again for networks based on (filtered) Pearson correlations; see Fig 12 below. However, betweenness-centrality exhibits a different pattern, more so for Tail-dependence networks; see [59] for a similar finding with different data and statistical estimation. A relevant difference worth emphasizing concerns the timing of local extrema. Whether this difference is indeed robust with respect to data and statistical procedures certainly is an interesting question for future research.
Differences in patterns, discernible in the time series, is also visible in the networks in Figs 8 and 9. In the former, in which node size is a function of betweenness-centrality, the most influential nodes are linked exclusively through gray edges. These nodes have a lot of links although all of them have small weights. On the latter graph, where node size is a function of eigen-centrality, the most influential nodes are connected together by red links. This indicates weights in the interval (.3, 1].
Network theory: Community detection DCC multivariate Garch model. Let y ≔ fy t g N t¼1 denote a one dimensional time series with N observations. A GARCH specification for its volatility usually starts with a flux of information determined by a filtration fF t g N t¼1 in which F t is a σ-algebra representing information at time t and y follows the dynamic Here θ is a parameter vector whose definition specifies the model, while μ(θ) is the conditional mean of the time series at time t, usually modeled through an ARMA time series. For example an ARMA(1,1) (as we will consider here) is specified by where ϕ, ψ are parameters to be estimated and ε is white noise, i.e. an uncorrelated centered time series. The residual �(θ) captures the conditional volatility of y: Its specification is the essence of a GARCH model. We will consider the standard GARCH (1,1) model: where fz t g N t¼1 is white noise. Now consider a set of univariate time series y(1),. . .,y(n). A class of models in the multivariate GARCH literature known as Dynamic Conditional Correlation (DCC) was introduced by [60] and [61]. The DCC class builds upon univariate GARCH models and then specifies the dynamic of time varying conditional covariance matrix of the time series y(1),. . .,y(n). It has the general dynamics Here D t is a diagonal matrix of time varying standard deviations from univariate GARCH models and R t is a time varying correlation matrix. For estimation, the matrix R t is decomposed as where Q is specified in [62, Equation (2)]. Table 6 we report the coefficient μ in the specification (7) for each stock in the year 2006, and analogously for the Table 7 in the year 2008. The estimation of these coefficients provides further support to the claim made after the visual evidence of Fig 1. Modularity. Assume we are given an undirected and unweighted graph G with vertexes V = {1, . . ., n} and edges E. Community structure in the graph means that there exists a partition of V in groups of vertices in such a way that within groups vertices are highly connected and more edges exist among them, while at the same time, edges between groups are less observed; see [40] for a survey of methods in community detection. The aforementioned description presents a general idea and to make it operative, it is necessary to use a more quantitative formulation. A popular approach is through the famous concept of modularity as introduced by [63] and further developed in [64]. Following the notation of [64] we introduce the following objects. Let A = (A i,j ) be the adjacency matrix of G and let m ¼ 1

Means for the years 2006 and 2008. In
Further denote by s 2 {1, . . ., n} n a vector having the same dimension as A, and representing an allocation of vertexes to communities. Thus, s i represents the community assigned to vertex i. Now the idea is to compare the graph G with a graph G 0 having no community structure. A group V k = {i 2 V j s i = k} possesses an accumulated weight of P i;j2V k A i;j . Now for G 0 , assuming it is a random instance of an Erdős-Rényi graph, the set V k should have an accumulated weight of P i;j2V k k i k j 2m . Hence, the difference P i;j2V k A i;j À k i k j 2m quantifies how distant is the immersion of community V k in the graph G from G 0 . The modularity function is defined as the sum of these differences over all communities: where δ(s i , s j ) = 0 unless s i = s j in which case δ(s i , s j ) = 1. As such, the modularity function Q(�) is defined for unweighted, undirected graphs. In particular, for graphs obtained from a correlation matrix, which indeed is weighted, the modularity function Q(�) needs to be adjusted. Moreover, the null model (the graph G 0 ) is critical for the well-functioning of modularity; see the discussion in [40]. Hence, to deal with this problem, we choose to work with the formulation of [36] where the correlation matrix is filtered and modularity is adjusted for the right "null model" G 0 . The analysis is again based on a spectral analysis as we now explain. Let C be a correlation matrix and consider the set of eigenvalues λ 1 , . . ., λ n which we assume are displayed in increasing order. Let v 1 , . . ., v n be the corresponding eigenvectors. Moreover, let T be the number of observations and λ − , λ + be the critical values The values λ − , λ + are parameters for Marcenko-Pastur distribution in random matrix theory which is given by rðlÞ ¼ T n ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi . Let us introduce the matrices We have a decomposition of the correlation matrix C given by From the ordering of the eigenvalues, the matrix C r represents random noise, C m a global signal which in our financial context is attached to the market as a whole and C g represents information in a mesoscopic scale between C r and C m . Next, we explain how the modularity function Q(�) is adjusted. Accordingly, focusing on the matrix C g , and taking into account the decomposition (13), the null model is C r + C m and the modularity function takes the form for C norm = ∑ i,j C i,j a normalizing constant. However, the set of eigenvalues λ i satisfying λ + < λ i < λ n could be empty (as we will find for some years in our sample). In this case the matrix C g will be undefined and it makes no sense to consider it. For those cases we will consider a decomposition C = C s + C r with C s ≔ P l þ <l i l i v tr i � v i and then the modularity is defined by Hence, in this section we maximize the modularity functions Q 2 and Q 3 in order to define communities and report on them. It is known that the maximization of modularity functions is a NP-hard problem; see [65]. Consequently, the optimization is approached through several heuristic algorithms. We implement the popular Louvian algorithm, adjusted as described by [36] according to the modularity functions Q 2 and Q 3 .
Modularity function Q 2 . In Fig 11 we see the resulting communities obtained with the Louvian algorithm applied to the modularity function Q 2 defined in (15). During all the years of the period there are two communities. The first community is a "giant component" and the other community consists of a small number of isolated vertices. Hence, at this scale our procedure does not detect a complex community structure. This is unsurprising, since Q 2 is based on the matrix C s which includes the "market mode". Note however the stylized fact: • The turmoil at the subprime financial crisis and the European sovereign debt crisis periods are captured by a visually evident increase in interconnectedness. This can also be observed from the time series of centralities in Fig 12. Modularity function Q 3 . For the definition of the modularity function Q 3 the matrix C g is necessary and should not be a null matrix. For our data, this is the case for only a few years: 2000, 2010, 2016, 2018 and 2019. For them, a representation of communities can be seen from Fig 13. This is what we observe: • First of all, in each year, there are only two communities as can be seen from the color of the vertexes, or equivalently from their shape. Interestingly, there is no clear larger community.
• Second, for our data the industrial sector is non determinant for the community assignment. More clearly, each industrial sector has vertexes in each community. This fact should be compared with the finding based on partial correlations where there also existed intersectorial links.
• This is our explanation for the years in which there existed a non-trivial matrix C g . First of all recall that this matrix represents structure between the scales of individual stocks and the market as a whole, while in crisis periods this last structure is what prevails since stocks tend to be highly correlated at those times.
In However, none of these seems to be comparable to the magnitudes of the dot.com bubble and the subprime crisis. In particular for the Mexican stock market they didn't have a sufficient impact to hide the effects of a mesoscopic structure, inducing all stocks to move as a result of a common factor.

Discussion.
In this section we apply the methodology presented by [36]. The authors of that paper obtain the result that for stocks in the S&P500 index, the maximization of modularity without any sort of adjustment results in a unique community. This is uninteresting and also happens in our case with data from the Mexican stock exchange under the modularity function Q 2 . It is based on the Pearson correlation matrix after noise has been filtered out according to Random Matrix Theory. This is the matrix C s which includes, as we mentioned before, the "market mode" from which the result of a unique community is unsurprising. In the paper [36] communities under Q 3 are also determined. They obtain five communities for stocks in the S&P500 index. In our case there are only two communities, but it is also true that year by year we are considering on average less than one-fifth of the number of stocks in the S&P500 index. In this sense, magnitude in the number of communities seems to be coherent. The configuration of community-structure on both cases shares two properties: (a) communities are multisectorial and (b) negative links joining nodes belonging to different communities are mostly negative. This is already interesting for the objective of understanding the interdependency structure in a single trustable snapshot. It also provides information for applications. For example, the fact that inter-communities links are negative is a useful taxonomy for the tasks of portfolio-allocation and hedging.

Conclusion
In global crisis periods, price levels of stocks in the Mexican stock exchange indeed present obvious changes which are visually evident and confirmed by econometric models. We have shown this fact here and it is also documented by other authors. However, the interdependency structure is a more complex phenomenon and much less studied. Our findings show that as long as partial-correlations are concerned, the interdependency structure is quite stable and centrality metrics from network theory have the sensibility to quantify small variations. Degree-and eigen-centralities indeed present variations, an upwards jump at the peak of the crisis and then a downwards jump when the shock of the crisis has been absorbed in the market. Another interesting finding from studying interdependency structure from partial-correlations is that only a small number of negative partial correlations which are also in magnitude small are present. We argue this is an indicator of a positive synergy of an integrated market. Reinforcing this claim, we find that industrial sectors are strongly interconnected even at the level of partial correlations. This is a less studied property, in general and in particular for the Mexican case.
Estimation of networks based on different matrices successfully captures different aspects of interdependency. Tail-dependence networks and their centralities maxima have been shown to give the most concise timing for the crisis's heights (for the subprime and European debt crises).
Interdependency from the point of view of ("full") correlations confirms findings from partial correlations. It also provides evidence of an integrated market for the Mexican case. Indeed, this is what we learned from the estimation of modularities which determined community structure without separating industrial sectors. From filtered matrices with noise filtered out (the matrices C s ), a single giant component emerged. Moreover, here the effect of global episodes for interdependency structure was clear even by simple visual inspection. This is what we learned in Fig 11 and is perfect as evidence for the modeling strength. Indeed, correlations are more sensitive to trading activity than partial-correlations and capture relationships among stocks due to such activity which is even more pronounced at crisis periods. We also studied community structure from the matrices C g , which are the correlation matrices after noise and the global market mode have been filtered out. At this scale it happens that only a few observed years present a mesoscopic structure. For the years 2000 and 2010 in which mesoscopic structure is present, we observe a "local minimum" for interconnectedness in Fig 11. For the years 2016, 2018 and 2019 we also note a turmoil of stress periods (e.g., the Brexit,the US-China trade conflict, etc.) which nevertheless are not to be compared in severity with the episodes of the dot.com bubble and the subprime crisis. Hence they are not able to blur the presence of structure at the mesoscopic level.
Supporting information S1