## Abstract

Extraction of interaction networks from multi-variate time-series is one of the topics of broad interest in complex systems. Although this method has a wide range of applications, most of the previous analyses have focused on the pairwise relations. Here we establish the potential of such a method to elicit aggregated behavior of the system by making a connection with the concepts from percolation theory. We study the dynamical interaction networks of a financial market extracted from the correlation network of indices, and build a weighted network. In correspondence with the percolation model, we find that away from financial crises the interaction network behaves like a critical random network of Erdős-Rényi, while close to a financial crisis, our model deviates from the critical random network and behaves differently at different size scales. We perform further analysis to clarify that our observation is not a simple consequence of the growth in correlations over the crises.

## Introduction

Classical inverse statistical mechanics has been applied to determine properties of pairwise interaction potentials from ensemble properties in complex networks^{1}. The maximum entropy model characterizes the correlation structure of a network activity without assumptions about its mechanistic origin and enables predictions of the collective effects^{2}. These maximum entropy models are equivalent to Ising models in statistical physics and, as we show in the following, it allows us to explore critical behavior of the network.

Despite wide range application of maximum entropy model in the recent decade^{1,2,3,4,5}, the main focus has been made on characterization of specific interaction between two elements or community structure of networks. However, global dynamical response of an evolving network based on its inherent symmetries has not been addressed yet. Here we apply percolation theory to measure the strength of interactions in a time-dependent evolving network of financial market and show that away from financial crisis the interaction network is self-similar and exhibits a geometrical criticality at a certain size-independent interaction threshold while during the crisis the network responses differently at different size-scales.

Percolation theory^{6} is the simplest fundamental model in statistical physics that displays phase transitions and explains the behavior of connected clusters in a random graph. The geometric critical behavior is dominated by the emergence of a giant connected component which controls the global response of the network. Resilience of networks under attack^{7,8}, spreading phenomena and epidemics^{9,10,11,12,13,14} are examples of diverse problems that can be treated using percolation theory.

The concept of random graphs^{9,10} was put forward by Erdös-Rényi^{15} who introduced the simplest imaginable random graph ER_{
n
}(*p*) including *n* vertices in which an edge is placed between any pair of distinct vertices with some fixed probability *p*. This random graph exhibits a continuous phase transition at a critical threshold *p*
_{
c
} which leads to a sharp global connectivity of the network components and serves as the mean-field model of percolation.

We find that despite seemingly strong correlations in the interaction network of financial market away from a global crisis, it can be modeled, to a good extent, by an ER_{
n
}(*p*) random graph of *n* interacting stock markets when the control parameter *p* is taken to be the strength of pairwise interactions.

In this paper, we study the critical behavior of a financial network consist of about 400 indices (or vertices) in S&P 500 whose activities are available as time series. We first build up a time-dependent correlation matrix of the stocks from the time-series. Then, we extract the interaction matrix among system’s elements in which the non-direct correlations are eliminated. This interaction matrix is the adjacency matrix of elements’ interaction network. Given the interaction network of a system, we can reduce the full system to some disjoint components which have positive intra-interactions (compared with a given strength threshold, see below). The collective and large-scale information of the system is somehow encoded in the statistics of the largest component which can also control the dynamics of the system. This collective behavior can also result in large-scale deviations in system states. For example, in financial market all stock indices may fall down and influence global index of the market^{16}.

Our analysis of the time series for indices in S&P 500 as the system elements and its mapping to the percolation problem on networks, unravels that for a network of stock markets, the dynamics can be well modeled by a critical random network theory of ER_{
n
}(*p*) away from a global financial crisis, while around and at the crisis the network departures from criticality. This observation is in contrast with the ordinary critical phenomena in which the large-scale fluctuations play a crucial role in the behavior of systems in the vicinity of the critical state and the fluctuations are actually responsible for the criticality. Despite large fluctuations in stock’s prices over a crisis period (Fig. 1, light blue bars), the underlying network model shows a non-critical behavior and fluctuations drive the system out of criticality.

## Data preparation

We analyse the available data for “adjusted closing prices” in S&P 500 index between 2000 and 2017. The time-series \(\overrightarrow{X}(t)=({X}_{1}(t),{X}_{2}(t),\,\mathrm{...,}\,{X}_{n}(t{))}^{T}\) of \(n=396\) stocks’ prices are extracted from *finance.yahoo.com*. We only consider the data for working days and use linear interpolation method to treat the sparsity of our data. For each stock *i*, as shown in Fig. 1, we work with the normalized log-return \({x}_{i}(t)\) of data^{17} defined as

where *μ*(*t*) and \(\sigma (t)\) denote the average and standard deviation of \(x^{\prime} \), respectively.

## Interaction network

For a given time *t* and a time window *τ* (see Fig. 1), we construct a multivariate \(n\times \tau \) matrix \({D}_{\tau }(t)\) for *n* time series as

We then build up the correlation matrix \({C}_{\tau }(t)\) among the time-series for each time window as

In order to also monitor the time evolution of the correlation matrix we move the time *t* by steps of duration 30 days over the whole period between 2000 to 2017.

Based on the above correlation matrix Eq. (3), we extract the interaction matrix \({J}_{\tau }(t)\)
^{1,2,3,4,5}

whose symmetric elements \({j}_{lk}={j}_{kl}\) represent the strength of interaction between stocks *l* and *k* in the time window [t, t + *τ*). Due to the finite sample size in our data sets, we used “Graphical LASSO” technique^{18,19} to evaluate interaction matrix \({J}_{\tau }(t)\) (we set regularization penalty of GLASSO to 0.1. We have also used the output Θ of graphical LASSO, as an estimator of inverse co-variance matrix. This matrix appears in multi-variate Gaussian distribution and determines the strength of the interactions among the different dimensions of PDF. In comparison with the Ising model, the coupling coefficients are minus sign of this matrix^{1,18,19}.).

Interaction matrix has an important advantage over the correlation matrix in which all mediated correlations are eliminated in the interaction matrix. Therefore, if a high correlation between indices A and B would be due to their high correlation with an index C, this effect will be eliminated in the interaction matrix.

This concept is related to the partial correlation matrix in multivariate Gaussian noise^{18}. It is also related to the maximum entropy network in the inverse statistical physics^{1}. Based on this fact, elements of the interaction matrix are independent of each other and one can remove them during the attack process (percolation model).

## Percolation model analysis

For each interaction matrix \({J}_{\tau }(t)\) at time *t*, we have an adjacent network \(G(t)=(n,E)\) with weighted links. In order to establish a connection with ordinary percolation problem on networks, we consider a threshold *θ* for the weights on the links to transform the network to an unweighted one \({G}_{\theta }(t)=(n,{E}_{\theta })\). This means that we remove the links whose weights are smaller than the considered threshold *θ*, and keep other links in the network by setting their weights equal to 1^{20,21}, i.e.,

Figure 2 illustrates this procedure on a sample network for four different threshold levels. It demonstrates how the giant component is born as the threshold level decreases. For a given graph *G*
_{
θ
} we define the percolation strength \({P}_{\infty }(\theta )\) as the probability that a randomly chosen node belongs to the largest connected component of the graph. Based on the percolation theory, the network may undergo a geometrical phase transition during which the size of the giant connected component jumps to a size of order \({\mathscr{O}}(n)\)
^{9,10}. To be more comparable with the ER*n* random networks, we interchange our percolation parameter *θ* with the corresponding mean degree \(\bar{k}({G}_{\theta })\) of the graph. For the ER_{
n
} graphs, the critical point is known to be \({\bar{k}}_{c}\mathrm{=1}\)
^{9,10}.

The first quantity of interest is \({P}_{\infty }(\bar{k})\) for a given interaction network \(G(t)\). In order to investigate the self-similarity of the network at different length scales, we also consider several sub-graphs \(g(t,s)\) of size \(s\le n\) which are randomly chosen from the original network \(G(t)\). We then measure \({P}_{\infty }(\bar{k})\) for different size scales which is averaged over an appropriate number (about 100) of independent realizations for each size *s*. In Fig. 3, we present the results of our measurements of \({P}_{\infty }(\bar{k})\) for two time periods far from (Fig. 3a) and close to (Fig. 3c) the financial crisis (In the Supplementary we present the same quantity measured for various time periods). As it is obvious from the Fig. 3a and c, \({P}_{\infty }(\bar{k})\) clearly behaves differently within these two time periods. Our further investigation shows that the difference between these two relies on the difference in the structure of the interaction network. To this aim, we shuffle the networks and repeat our analysis. Since a link’s weight comes from the correlation of agents actions on two stocks, shuffling links is equivalent to a situation where agents buy or sell randomly. We find that away from the crises, the shuffled network is very similar to the original network (Fig. 3b) as for the ER_{
n
} random networks, while close to the crises, the original network substantially deviates from the shuffled one (Fig. 3d).

The other quantity of interest is the mean cluster size (or susceptibility) \(\chi (\bar{k})\) defined as^{22}

where \({\langle \ldots \rangle }_{i}\) denotes averaging over the number (about 100 for each size *s* < *n*) of independent realizations and \({P}_{\infty }^{i}\) is the percolation strength computed for the *i*-th realization. Figure 4 shows the results of our computations of \(\chi (\bar{k})\) for two time periods, as in the Fig. 3 above, far from (Fig. 4a) and close to (Fig. 4c) the financial crisis (Supplementary presents the same quantity for various time periods). Figure 4a indicates that far from the crisis, all curves \(\chi (\bar{k})\) for different size scales maximize near a single size-independent critical point \({\bar{k}}_{c}\approx 1\), which is very similar to its shuffled variant shown in the Fig. 4b. Close to the crisis, in contrast, \(\chi (\bar{k})\) behaves differently at different size scales with an observable shift from the critical point (Fig. 4c). It also differs from its shuffled version as is evident in the (Fig. 4d).

To quantify the amount of deviation from the critical behavior near the crisis, let us now measure the difference between the strength of the giant component and its prediction based on the random network theory^{9,10} which states that it is possible to compute the giant component probability \({P}_{\infty }^{theo}(\bar{k})\) by solving the following self-consistent equation (see the Supplementary for more description)

Next, we measure the mean absolute difference \(d(t,s)\) between the theory and our numerical computations as

We have plotted \(d(t,s)\) for different sub-graph sizes *s* in Fig. 5 for both original and shuffled networks. Close to the crisis periods (highlited in the Fig. 5 by light blue bars) \(d(t,s)\) increases. It shows that the critical behavior of the interacting financial network (which shown to behave like a random network) disappears close to a crisis.

## Conclusion

Efficiency of financial markets is a hot debate in financial economics. Some studies support the hypothesis of market efficiency–see for example^{23,24}. According to this hypothesis, the stock prices fluctuate mostly like uncorrelated random variables. In other words, it states that it is impossible to extract information from the past history of the prices of a stock to predict its future and earn money.

Despite early observations which supported the hypothesis of efficiency, some later works challenged it and revealed deviations from it. Although it was hard to find correlations in time series of an individual stock, noticeable information could be captured if some other parameters such as cross correlations or earning price ratio were brought into account–see for example^{17,25,26} and references therein.

The studied methods have mostly focused on the individual indices or their cross correlations and the analysis based on an aggregated behavior is still lacking. In the present work, we studied the global behavior of indices as an example of an interaction network by using the concepts of percolation theory. We find that away from financial crises the interaction network behaves like a random network of Erdös and Rényi^{15} which similarly exhibits the properties of scale invariance and self-similarity at the critical point of a continuous phase transition. When the financial market approaches a crisis, our observation is that the interaction network model deviates from the critical random network and looses its scale invariance, i.e., the system behaves differently at different size scales. The deviations are summarized in Fig. 5 in which our data signals at major crashes of the markets namely, “Stock market downturn of 2002”, “Financial crisis of 2007–08”, “2010 Flash Crash”, “August 2011 stock markets fall”, and “2015–16 stock market sell off”, by a noticeable growth of difference with respect to the random networks.

During the financial crises, usually because of the spreading fear in the market, the stocks move together and correlation grows amongst them. This fact raises a natural question if our main result is just another derivation of the previous observations concerning the growth of correlation between the indices. In order to address this appropriately, let us compute the largest eigenvalue of the correlation matrix^{27,28,29}. As shown in Fig. 6, in accordance with our previous observations, over the crises the largest eigenvalue grows significantly. But this time, when we look at the largest eigenvalues of the “shuffled” correlation matrix, they behave exactly as in the original (unshuffled) matrix, i.e., in both cases the largest eigenvalues significantly grow over the crises (see Fig. 6). This means that the largest eigenvalues of the correlation matrix do not necessarily carry information about the structure of the interaction network. This is while in our analysis, we observe two totally different behaviors between the interaction network and its shuffled one which provides a systematic way for a structural differentiation. Therefore we conclude that the off-critically over the crises is not a simple consequence of the growth in the correlations.

It should be notified that our observation close to the crises does not contradict the efficient market hypothesis, since it is not still clear if it can help one to extract money. Should we be able to extract money from such structure is left as an open question for the future works.

Extraction of real system’s interaction networks is a rapid growing field. Beside the statics features of these networks, they could be used to deduce some dynamic features of the system. In this work, we established a correspondence between the critical phenomena and the external macroscopic state of a system. This approach could however be generalized to other fields where maximum entropy network is used like gene regulatory networks, neural networks, protein interactions and etc.

### Data Availability

The datasets analysed during the current study are available in the Yahoo Finance, http://finance.yahoo.com.

## Additional information

**Publisher's note:** Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## References

- 1.
Lezon, T. R., Banavar, J. R., Cieplak, M., Maritan, A. & Fedoroff, N. V. Using the principle of entropy maximization to infer genetic interaction networks from gene expression patterns.

*PNAS***103**, 50 (2006). - 2.
Schneidman, E., Berry, M. J., Segev, R., Bialek, W. Weak pairwise correlations imply strongly correlated network states in a neural population.

*Nature*,**440**(2006). - 3.
Roudi, Y., Aurell, E. & Hertz, J. A. Statistical physics of pairwise probability models.

*Frontiers in computational neuroscience***3**, 22 (2009). - 4.
Jafari, G. R., Shirazi, A. H., Namaki, A. & Raei, R. Coupled time-series analysis: methods and applicagtions.

*Computing in Science and Engineering***3**, 6 (2011). - 5.
Borysov, S. S., Roudi, Y. & Balatsky, A. V. US stock market interaction network as learned by the Boltzmann machine.

*EPJB***88**, 12 (2015). - 6.
Saberi, A. A. Recent advances in percolation theory and its applications.

*Physics Reports***578**, 1–32 (2015). - 7.
Cohen, R., Erez, K., ben-Avraham, D. & Havlin, S. Resilience of the internet to random breakdowns.

*Phys. Rev. Lett.***85**, 4626 (2000). - 8.
Albert, R., Jeong, H. & Barabási, A. L. Error and attack tolerance of complex networks.

*Nature***406**, 378–382 (2000). - 9.
Barabási, A. L.

*Network Science*, Chapter 3, (Cambridge University Press, 2016). - 10.
Newman, M. E. J.

*Networks: An introduction*, Chapter 12, (Oxford University Press, 2010). - 11.
Pastor-Satorras, R. & Vespignani, A. Epidemic spreading in scale-free networks.

*Phys. Rev. Lett.***86**, 3200 (2001). - 12.
Pastor-Satorras, R., Castellano, C., Van Mieghem, P. & Vespignani, A. Epidemic processes in complex networks.

*Rev. Mod. Phys.***87**, 925 (2015). - 13.
Grassberger, P. On the critical behavior of the general epidemic process and dynamical percolation.

*Mathematical Biosciences***63**(2), 157–172 (1983). - 14.
Newman, M. E. J. Spread of epidemic disease on networks.

*Physical Review E***66**(1) (2002). - 15.
Erdös, P. & Rényi, A. On the evolution of random graphs.

*Publ. Math. Inst. Hung. Acad. Sci.***5**, 17–61 (1960). - 16.
Sornette, D. Why Stock Markets Crash: Critical Events in Complex Financial Systems, Chapter 3, (Princeton University Press, 2004).

- 17.
Mantegna, R. N. & Stanley, H. E.

*An Introduction to Econophysics*, Chapter 5, (Cambridge University Press, 2000). - 18.
Friedman, J., Hastie, T. & Tibshirani, R. Sparse inverse covariance estimation with the graphical lasso.

*Biostatistics, December*12 (2007). - 19.
Stein, R. R., Marks, D. S. & Sander, C. Inferring pairwise interactions from biological data using maximum-entropy probability models.

*PLoS computational biology***11**(7), e1004182 (2015). - 20.
Saberi, A. A. Percolation description of the global topography of earth and the moon.

*Phys. Rev. Lett.***110**, 178501 (2013). - 21.
Saberi, A. A. Geometrical phase transition on WO 3 surface.

*Appl. Phys. Lett.***97**, 154102 (2010). - 22.
Radicchi, F. & Castellano, C. Breaking of the site-bond percolation universality in networks.

*Nature Communications*, 10196 (2015). - 23.
Fama, E. F. The behavior of stock-market prices.

*J. Business***38**, 34–105, https://doi.org/10.1086/294743 (1965). - 24.
Fama, E. F. Efficient capital markets: a review of theory and empirical work.

*J. Finance***25**, 383–417 (1970). - 25.
Lo, A. W. & Mackinlay, A. C. When Are Contrarian Profits Due to Stock Market Overreaction? Rev.

*Financial Stud.***3**, 175–205 (1990). - 26.
Jegadeesh, N. & Titman, S. Returns to buying winners and selling losers: Implications for stock market efficiency.

*The Journal of finance***48**, 65–91 (1993). - 27.
Huang, Z. G., Zhang, J. Q., Dong, J. Q., Huang, L. & Lai, Y. C. Emergence of grouping in multi-resource minority game dynamics.

*Scientific Reports***2**, 703 (2012). - 28.
Borghesi, C., Marsili, M. & Micciche, S. Emergence of time-horizon invariant correlation structure in financial returns by subtraction of the market mode.

*Physical Review E***76**(2), 026104 (2007). - 29.
Plerou, V.

*et al*. Random matrix approach to cross correlations in financial data.*Physical Review E***65**(6), 066126 (2002).

## Author information

### Affiliations

#### Department of Physics, Shahid Beheshti University, G.C., Evin, Tehran, 19839, Iran

- Amir Hossein Shirazi
- , Ali Hosseiny
- , Ehsan Amirzadeh
- & Pourya Toranj Simin

#### Department of Physics, University of Tehran, Tehran, 14395-547, Iran

- Abbas Ali Saberi

#### Institut für Theoretische Physik, Universitat zu Köln, Zülpicher Strasse 77, 50937, Köln, Germany

- Abbas Ali Saberi

#### School of Physics and Accelerators, Institute for research in Fundamental Science (IPM) PO Box, 19395-5531, Tehran, Iran

- Abbas Ali Saberi
- & Ali Hosseiny

### Authors

### Search for Amir Hossein Shirazi in:

### Search for Abbas Ali Saberi in:

### Search for Ali Hosseiny in:

### Search for Ehsan Amirzadeh in:

### Search for Pourya Toranj Simin in:

### Contributions

A.H.S., A.A.S., A.H. and E.A. designed the project. A.A.S. proposed the analysis and statistical methods. A.H.S. and P.T.S. has done the numerical computations. A.H.S., A.A.S. and A. H. analyzed the results and drafted the manuscript.

### Competing Interests

The authors declare that they have no competing interests.

### Corresponding authors

Correspondence to Amir Hossein Shirazi or Abbas Ali Saberi.

## Electronic supplementary material

## Rights and permissions

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.

## About this article

## Comments

By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.