2021
On the Ollivier-Ricci curvature as fragility indicator of the stock markets
Abstract
Recently, an indicator for stock market fragility and crash size in terms of the Ollivier-Ricci curvature has been proposed in Sandhu-Georgiou-Tannenbaum . We study analytical and empirical properties of such indicator, test its elasticity with respect to different parameters and provide heuristics for the parameters involved. We show when and how the indicator accurately describes a financial crisis. We also propose an alternate method for calculating the indicator using a specific sub-graph with special curvature properties.
keywords:
Ollivier-Ricci, curvature, finance, stock market, fragility, Wasserstein, stock correlations, optimal transport on graphs1 Introduction
Since the advent of quantitative finance, there has been an increasing need for fragility estimators which study hidden connections between entities. The 2008-2009 financial crisis is perhaps the best example of how catastrophic the consequences of a crash can be. While the mathematical and economical definition of a financial crisis varies from one reference to another, it is imperative to have good metrics and indicators to evaluate the fragility of the market in a given period. We require an estimator to:
-
1.
Be able to capture the current state of the stock market and adapt quickly.
-
2.
Take into consideration possible hidden interconnections.
-
3.
Be simple but robust.
The recent works Sandhu-Georgiou-Tannenbaum and Samal et. al have proposed a very interesting object as an indicator of market fragility: the average Ollivier-Ricci curvature of a specific network. The network is constructed using the correlations of the closing stock prices, obtaining a Minimum Spanning Tree (MST) via a specific distance function and adding back “high-value links”. In this work we further study the analytical properties and empirical results of this indicator. In particular, we seek to verify whether or not this estimator satisfies the aforementioned properties (1-3).
The Ollivier-Ricci () curvature of the associated network of Sandhu-Georgiou-Tannenbaum (based on Boginski et. al. and Tse-Liu-Lau ) is called a “crash hallmark”. In this document we argue that the proposed object is not an economic risk indicator but rather a good ex-post metric which can show the size and periods of a financial crisis. More specifically, we will show that the curvature of the constructed network does not indicate tendencies towards a crisis but rather accurately identifies the size and length of the crisis.
The difference between being a crash hallmark or an economic risk indicator is fundamental in nature. The former allows us to understand the past and further improves our understanding of historical data, while the latter sends a fragility signal to the market agents prior to a potential crash. Only the indicator can be in a predictive manner, but this should not undermine the interest on the hallmark as a mathematical tool which helps us to characterize and understand crashes.
Analysis of the stock market using correlation networks was proposed in Tse-Liu-Lau . Since then, there has been a lot of interest in obtaining knowledge of the stock market from this network. In Sandhu-Georgiou-Tannenbaum we see the first appearance of curvature as an indicator for fragility. Intuitively, the deep connections between Ricci curvature bounds and entropy, recently discovered by the Lott-Villani-Sturm program (see Villani , McCann ), justify using curvature as a measure of fragility, see Sandhu-Georgiou-Tannenbaum .
Samal et. al presents a comprehensive list of possible indicators of fragility using different definitions of curvature. We focus on analyzing analytical and numerical properties of the indicator proposed in Sandhu-Georgiou-Tannenbaum .
2 Precise description of the algorithm
In this section we present the algorithm for the hallmark proposed and used in Sandhu-Georgiou-Tannenbaum and Samal et. al . We denote the hallmark for a given network by , which will depend on the size of the time period chosen and the edge threshold (see below).
Intuitively, one uses a function of correlations of data in the period of size to obtain a schematic sub-graph of the market. After a MST is chosen to be the representation of the market, edges with high correlation are added to the graph. Then, one computes the average curvature of the sub-graph using the hop distance as the cost function (and not the weighted distance).
2.1 The main algorithm
To obtain the fragility indicator .
(1) |
(2) |
Intuitively, for an edge we observe if the weights and edges for neighbors of are such that it seems like is pulled away from . That is, and may be connected by an edge but the weights of neighbors of away from neighbors of are relatively high.
In equation (1), denotes the Wasserstein distance between probability measures, defined via
(3) |
where again is the hop distance, the minimum number of steps needed to traverse the graph from verrtex to vertex . The Wasserstein distance can be computed with numerical packages, like Python Optimal Transport (POT), which was used in the simulations in Section 4.
From Algorithm 2.1, we can formulate several questions.
-
1.
How well does the indicator measure crisis?
-
2.
What happens if one does not add high-value links?
-
3.
What is the - elasticity? How does one choose ?
-
4.
As grows does the time series regularize?
-
5.
As decreases do we approach white noise?
-
6.
What is the impact of using the MST? Are there other better subgraphs?
-
7.
What happens for different distance functions functions ?
-
8.
Is the average the most efficient way to measure risk?
-
9.
Is it optimal to use only the hop distance to obtain the MST structure or should the hop distance be used to compute the curvature too?
We aim to answer all these questions throughout this work.
3 Model dependence on parameters
3.1 Theory on the curvature of MST
Question: If is weighted graph and is it’s minimum spanning tree, what is the relation between and ?
Answer At the moment there is no apparent relation between curvature of the MST and the curvature of the original graph. We can construct simple examples with opposite results.
Example 1.
(One edge at the time)
As a toy model, consider a simple graph with 4 vertices, we add a single edge and compute the curvature. Observe that the leftmost graph is a MST for the remaining graphs. Although the connectivity of the 3 graphs is significantly different, the MST does not capture that behaviour.

Example 2.
(Very centralized node) In the general case of a graph consisting of nodes where nodes are connected by one edge to one centralized node, one can immediately see that if ,
(4) |
Thus there are edges with curvature and the remainder, of which there are , have curvature . Therefore
(5) |

Example 3.
(Complete Graph) In fact, we can compute the average curvature in the general case of a complete (fully connected) graph as follows. For we have , so . The curvature of each edge is the same, so
(6) |
From Example 1, it becomes apparent that the curvature of the Minimum Spanning Tree (MST) and the original graph are not directly correlated. Consequently, in Algorithm 2.1, the decision to measure fragility using the MST represents a significant choice. Moreover, it remains unclear whether the edges removed during the MST selection process significantly contribute to fragility. To address this uncertainty, we consider two potential alternatives:
-
1.
Computing the of the complete graph with the weights , though this approach is computationally very costly.
-
2.
Opting for a different sub-graph instead of the MST that better captures curvature inheritance (see Section 4.4).
3.2 Adding or removing an edge
Consider an undirected weighted graph , where is the set of nodes, the set of edges and is the set of weights for all edges. Assume that for , , and let us define where and . In other words, the graph modified by adding the edge joining and with weight .
Let denote the Hop distance in and denote the Hop distance in . Observing that adding an edge can only decrease the number of steps between nodes, for every it follows that
(7) |
Keeping the notation of Algorithm 1, for every we define the measures and by
(8) |
where is the set of neighbors of in and is the set of neighbors of in . The difference between and relies only on the condition , as
(9) |
As a result, the measures in (8) only change if , or equivalently if . Even if the measure remains unchanged from , the Wasserstein distance may change from as the distance function has changed.
Denote by (respectively ) the Ollivier-Ricci curvature computed with the induced Hop distance on (respectively on ), as described in Section 2.
Our first result, Proposition 1, measures the total change in edge-curvature in terms of the relative error between and . As we add a single edge to the graph, the only control on the curvature depends on how much the hop distances change.
Proposition 1.
(Bound on single-edge curvature change)
For any nodes , the difference in the curvature of and of is bounded, with upper bound
(10) |
Moreover, if and there exists a minimizing , then
(11) |
where
(12) |
and are as in (8).
Proof: Directly from the definition of in (1),
(13) |
Plugging the inequality (7) into (13) yields (10). To obtain inequality (11), note that if is a minimizer for , then
(14) |
Unless one applies more conditions to the graphs and , we expect the above inequalities to be sharp, based on the following example.
Example 4 (Inequalities (10) and (11) are attained for every vertex pair.).
Let denote a complete graph of vertices with all edge weights equal to , and let be the graph created by removing the edge from . In this case, a quick computation shows that the estimates (10) and (11) are attained for every possible vertex pair.
Recalling Example 3, we know that each edge of the graph has the same curvature and hence this is . In particular, . Then, it is easy to see that and hence . Since is complete, . We can now easily verify that both sides of the inequality (10) are .
After removing one edge from the complete graph , the curvature of all unaffected vertices is unchanged,
(15) |
and there are such edges. In this case both sides of both inequalities (10) and (11) are .
It remains to compute the curvature for and for (we already computed above that as ). There are such cases and by symmetry they are all identical, so without loss of generality consider . To compute , we distinguish two possibilities: sending mass from to the vertices equally which has cost , and sending all mass from to which also has cost . Thus , and hence . Since clearly , the both sides of the inequality (10) are .
Now, we can compute
(16) |
Compare this with example 3, where .
Our next proposition explores the relationship between the curvature and the connectivity of the graph via the degrees of the affected nodes. In what follows, let denote the degree of a node , and recall that by we specifically denote the edge added to the graph to obtain the graph (and by we denote the affected nodes). We first establish the following lemma, which features the key idea (see Figure 3).
Lemma 1.
(Change in affected nodes)
For the affected nodes , we have
(17) |
Proof: By the definition (8),
(18) |
so the map which keeps in each vertex different than and transports onto is an admissible map, see Figure 3. Hence,
(19) |

Since we do not take the graphs and to be directed, the argument for and is also valid for and .
Proposition 2.
(Bound on curvature in terms of degrees)
For the added edge , we have
(20) |
Furthermore, if there exists a minimizer for , then
(21) |
Proof: By the triangle inequality,
(22) |
The result then follows from the previous lemma. The second statement is obtained as in the proof of Proposition 1.
Note that because , we immediately get a more familiar type of bound:
(23) |
Equation (23) shows a direct connection between connectivity and curvature, via the right hand-side which involves the degrees of and .
3.3 Time parameter and smoothing
In practice, one does not want to wait too long to compute good indicators of the dynamical properties of the market. However, for an indicator to demonstrate relative consistency, it must exhibit clearer trends with increased data availability.






In Figure 4 we observe that (as expected) the indicator shows a stronger auto-correlation as increases. As a measure of economical ex-post analysis, higher values of are preferred.
3.3.1 Statistical Test: Significance vs White Noise
We now show via auto-correlation plots that in the limit the indicator behaves increasingly as white noise.




From Figure 5 it is clear that taking small values of for the computation of may result in short-term mistakes in trends. These mistakes are fundamental when trying to use as a measure of fragility.
3.4 Different metric to obtain MST and the choice of the ultra metric
In Bonnano et. al it was shown that the MST obtained from is relatively stable with respect to changes of for financial networks constructed as in Algorithm 2.
In this section we plot different distance functions for a randomly chosen subset of the data to compare the impact on the MST and . As theorized in Bonnano et. al , similar distances did not present significant changes in their plots, except when considering logarithms. Hence, we think it is reasonable to use as it is commonly used in literature (where it is sometimes referred to as an “ultrametric”).
Plots for different functions of




In Figures 6(a), 6(b), 6(c), and 6(d) we observe that for simple functions of the form for some power , the behaviour of the indicator can be similar. Nevertheless, a bad choice of cost function can result in noise, as exemplified by . Notice that is concave in but Figure 6(d) does not show the behaviour of the previous choices (in Figures 6(a), 6(b), and 6(c)). The study of general properties of functions such that is a reasonable indicator is an interesting future line of research.
Example 5.
(Weight independence)
Consider the following network:

Example 5 shows that using the average Ricci curvature can be justified as a way of getting rid of the dependence of the weights used to obtain the MST. Of course, this independence is not the rule but a motivation for the use of the average. Below is another such example.
Example 6.
(Independence again)
Consider the following network.

The associated curvature is , independently of the weights and . The computations follow in the same manner as in Example 5,
Then,
(27) |
In Algorithm 2.1, the weights are used to obtain the MST and to define the measures via (8). An argument similar to those presented in (Rubleva, , Theorem 1) and (Rubleva, , Theorem 3) shows that the average Ricci curvature on a tree is independent of the weights if we use the hop distance as the metric. This fact (except for the schematic construction of the tree) is an excellent motivation for the use of the average curvature rather than a different statistic like the maximum or minimum Ricci curvature.
We conclude that the weight function should be chosen according to a prior knowledge of relative centralization of nodes. A promising line of investigation is to consider a Bayesian approach, adding prior information on node-centralization of a market to obtain better estimates for .
3.5 Adding high-value links
In Algorithm 2.1, we obtain the MST and then add back edges satisfying
(28) |
If , where is positive and continuous function with , then (28) adds the edges whose corresponding weights are small. From this observation, we expect to be similar to due to the stability result of Bonnano et. al . The exact nature of this similarity remains an open question.
4 Results
As in Sandhu-Georgiou-Tannenbaum we start by studying the American market. We compute the average curvature using historical closing prices for all companies in the S&P 500, obtained via the Yahoo Finance Python API. The complete sample yields 388 companies for the 1997-2014 period.
from 1998-2012.

In Figure 9 we observe the value of the indicator from 1998-2012. We use all data available for S&P listed companies, and . We see a huge spike during September 2008, during the Lehman Brothers collapse.
In Sandhu-Georgiou-Tannenbaum , the algorithm of section 2.1 is presented as a measure of fragility in which the cases of most interest correspond to the biggest financial crisis (the 2008-2009 crisis being the most infamous). In Figure 9 we see the value of Algorithm 2.1 peak at the same time as the financial crisis of 2008-2009. In the next figure, we observe the behaviour during the 2008-2009 year.
during the financial crisis of 2008-2009 for and .

Figure 10 shows that the seems to have returned to it’s usual values by February or March 2009. Nevertheless, the instability of the market seems to be different when we analyze with smaller values of .
during the financial crisis of 2008-2009 for and .

In Figure 11, we see the analysis of the year 2008-2009. The 2008 crisis corresponds to the period of instability, the variance and height of the average curvature did not return to it’s pre-crisis values until April-May 2009.
4.1 American market: Change of threshold
In the works Boginski et. al. and Tse-Liu-Lau it was argued that adding high-value links tends to give a more accurate schematic picture of the actual state of the market. For the method of Algorithm 2.1 to be robust, we need to analyze the -elasticity of the indicator. By Proposition 1 we can estimate the effect of adding a single edge. In particular, the edges associated to high-value links can only decrease the hop distance in the new graph (because any path of less steps remains in the graph).
In the following figures we observe that as we increase , the average curvature decreases. Although we see this behaviour on the general level of the plots, it is not true on a “point-to-point” basis. This observation, rooted in the fact that depends on the ratio of and , indicates that an apparent trend in a small period of time is not reliable unless is somehow prescribed or fixed. Two experiments with similar values and can indicate short-term tendencies in opposite directions.
We start with an extreme value of and then we show that the same behaviour is observed in the cases and , which are much noisier by default.




Figures 12, 14, 13 and 15 show that although the general trend is captured by the indicator, changes in are extremely significant for short-period analysis.
Next, we show the same behaviour is observed in the noisy case (arguably the case of most interest) corresponding to smaller values of .



We continue the same simulations for in order to show that the phenomena explained in the previous section prevails in a slightly smoother case.




4.2 Different market: The Canadian experience
In this section we choose companies from the S&P ETFs for Canadian companies and evaluate the estimator.
Canadian experience 2008-2024

Figure 23 shows the relative difference (according to ) of the financial crisis of 2008 and the impact of the Covid-19 pandemic on . From 23 we see that the impact of the 2008 crisis on correlations of the stock market is higher than that of the pandemic. In the following figure (Figure 24) we see this difference replicated for most values of , making the analysis much more robust.
Canadian experience 2008-2024 changing

Average Curvature of the top 20 Canadian companies from 1997-2024.




4.3 Not a country: The Tech-sector crunch
In this section we look at the curvature of a specific subgraph of the market. We look at the technology sector in order to analyze it’s fragility before the famous Tech crunch resulting in the lay-offs of 2023-2024. As before, for values of the plot seems more stable. Nevertheless, the indicator does not show the fragility of the sector in a predictive manner (one possible explanation for the decrease in curvature are the lay-offs themselves). We use the time period 2018-2024 instead of 1997-2024 as most current tech companies have had their IPOs in more recent times.
Technology Sector
Technology Sector

Figure 28 shows the complexity of choosing the parameters for the indicator. While we expect large () to show a clearer picture, for the Tech Industry it seems to be “too big”. In the case different values of show different behaviours, while successfully captures some peaks for most values of . One possible explanation for this phenomena is that this sector is deemed to be more volatile, in some underlying sense, so large values of “average out” the local tendencies.
4.4 Implementation of Ollivier-Ricci Gradient Sub-Sampling
As argued in Section 3.1, the curvature of the MST seems to have no direct relation to the curvature of the original graph. It is reasonable to study a sub-graph which maximizes or minimizes . Given a random initial vertex and a size , one can generate a sub0graph with vertices and minimal following the algorithm in Wu et. al . Whether computing such an indicator performs better than the one presented in Sandhu-Georgiou-Tannenbaum is an interesting open question left for further research (with higher available computational power).
4.4.1 Algorithm for maximized curvature
To obtain a fragility indicator from gradient descent using nodes.
(29) |
(30) |
We see in the next figure that the behaviour for small number is similar to the indicator of algorithm 2.1. The technique of algorithm of section 4.4.1 has the extra advantage of inheriting minimal curvature. In risk modelling and heavy-tail phenomena it is common to consider as best policy the one related to the worst case scenario. Minimum curvature sub-graphs do exactly that. We note that by computational restrictions our numerical results are not optimal. Two possible remedies are:
-
1.
Increase available computational power.
-
2.
Perform a stochastic gradient descent on curvature.
We leave both of these directions for forthcoming research.
4.4.2 Results for deterministic gradient sub-sampling
indicator from minimum curvature sub-graph, American market.




We remark that similar graphs using the maximum curvature sub-graph yielded noisy graphs with no apparent trends.
5 Conclusions and Further work
In section 2 we posed the following questions, which we now answer:
-
1.
Q: How well does the indicator measure crisis?
Answer: For certain values of (whose precise determination is not an easy task), the indicator measures times of financial crisis in length and depth. The indicator allows us to compare different crisis in terms of the hidden interconnections of financial agents. -
2.
Q: What happens if one does not add high-value links using ?
Answer: As observed in section 3.5, if (i.e. no link is added), the MST is not capable of showing the crashes. -
3.
Q: What is the - elasticity? How does one choose ?
Answer: The choice of is fundamental to the analysis and depends not only on the distance function used, but also on the underlying financial market. The determination of should be empirical (or probably Bayesian) and heuristically can perform well. -
4.
Q: As grows does the time series regularize?
Answer: In all cases bigger values of showed a clearer representation of the crisis. As is supposed to be used as an ex-post tool rather than a predictor element, considering the biggest available is recommended. -
5.
Q: As decreases do we approach white noise?
Answer: Yes, as shown in section 3.3.1. This observation should alert a modeller that choosing a small value of (while desirable in applications) comes with bigger risk. -
6.
Q: What is the impact of using the MST? Are there other better subgraphs?
Answer: If computationally plausible, one should attempt to use the closest representation of the original network graph. This is viable when studying interactions between sectors or small markets. In the case of large amounts of data, one can use MST, keeping in mind the examples in Section 3.1. -
7.
Q: What happens for different cost functions ?
Answer: By relative stability of MST to weights (see Bonnano et. al ) the dependence on the cost is not crucial. Similar costs yield similar MSTs and when high-value links are added, the graphs behave similarly (the adding is done through correlations and not weights). -
8.
Q: Is the average the most efficient way to measure risk?
Answer: As explained in Example 5, there are many benefits of using the average Ricci curvature but there are interesting properties of other estimators which could be useful. The weight independence explained in Section 3.4 is the main motivation. -
9.
Q: Is using the hop distance the only way to obtain the optimal structure or should it be used to compute the curvature too?
Answer: Numerical experiments not included in this work have shown that using the weighted curvature is even less precise than the algorithm presented in section 2.
5.1 Interpretation of the indicator
Throughout this work we have shown that is a good indicator of crisis periods. The trends in the average Ollivier-Ricci curvature reliably indicate the size and duration of the instability periods of financial markets. For this reason, the indicator can be an important tool for economical and financial analysis.
Due to it’s dependence on the threshold variable , as indicated in section 3.5, one should be careful when using to predict short time tendencies of the market. In sections 4.2 and 4.3 we observed that the value of the modeller should use depends on the underlying financial market. Thus, it is reasonable to use a Bayesian approach to the determination the threshold. After calibration, should be understood as a hypothesis on which the inference of crisis from depends on. As long as this hypothesis is fully assumed, the indicator adds value to our understanding of the random dynamics of financial systems.
Note that Algorithm 2.1 depends on parameters and together with the use of the MST as the skeleton approach to the underlying network. The use of the MST is currently the most computationally feasible approach to markets with large amounts of data. If the market of interest is of small enough size one can use (1) directly from the constructed network, avoiding having to reduce to the MST and adding links via .
5.2 Taking away data could be crucially unfair
One important observation about Algorithm 2.1 is that one should try to avoid dropping incomplete data. Say you want to analyze a market in a period of time where a crash happened, the crash may be a result of subsequent bankruptcy of entities with hidden connections. Computing the indicator after removing such entities misses the dependence on entities which can be fundamental to the crisis. For example, if several banks declare bankruptcy in the time period of study, one does not have complete data after their individual crashes, but it is these crashes that may explain the financial default of the system. Therefore, given a period of time, one should consider every entity which has participated in that period.
5.3 Further research
In this section we present the lines of investigation which remain open and we believe are of most interest.
5.3.1 Relation between curvature and connectivity of a graph.
We can understand Proposition 2 as a connection between curvature and connectivity. If a graph is highly connected, then the degrees of the vertices are very high, and the majority of edges should not significantly increase the hop distance if removed. In this case, (21) tells us that adding an edge will not result in a big change in curvature.
5.3.2 The exponential moving average
If we want to give the most recent data more influence, it is common practice in mathematical finance to use the exponential moving average. What happens if the exponential moving average is applied to the time series before any other calculation? Does it yield a better indicator in the hopes of avoiding the white noise in the limit?
5.3.3 The Beckman Problem
Although equation (21) is a good connection between curvature and connectivity, there might be a stronger connection. The relation between the Beckmann and the Kantorovich Problem in the continuous case (see (Santambrogio, , Theorem 4.6)) is well-known, whether or not similar relations hold in the discrete case (relating the max-flow min-cut problem would to the Wasserstein (Kantorovich) formulation of curvature) is unbeknownst to the authors. In the case where the weighted distance is used (different to the hop distance), (Rubleva, , Theorems 1,2) are well known. We expect similar results for the hop-case.
References
- (1) S. Miccichè, G. Bonanno, F. Lillo, R. Mantegna, Degree stability of a minimum spanning tree of price return and volatility, Physica A: Statistical Mechanics and its Applications, Volume 324, Issues 1–2,2003,Pages 66-73.
- (2) V. Boginski, S. Butenko, P. M. Pardalos, Mining market data: A network approach., Comput. Oper. Res. 33, 3171–3184 (2006).
- (3) R.J. McCann, Displacement convexity of Boltzmann’s entropy characterizes the strong energy condition from general relativity, Camb. J. Math. 8:3, (2020) 609-681.
- (4) Y. Ollivier, Ricci curvature of metric spaces, C. R. Acad. Sci., Paris, Ser. I 345 (2007) 643–646.
- (5) O.V. Rubleva, The Ricci curvature of a weighted tree, Math Notes, 100, 597–606 (2016). https://doi.org/10.1134/S0001434616090315
- (6) A. Samal , H. Pharasi, J.S. Ramaia, H. Kannan, E. Saucan, J. Jost, A. Chakraborti Network geometry and market instability R. Soc. Open Sci. 8201734 2021
- (7) R. Sandhu , T. T. Georgiou, A.R. Tannenbaum, Ricci curvature: An economic indicator for market fragility and systemic risk, Sci. Adv.2, e1501495, (2016).
- (8) F. Santambrogio, Optimal Transport for Applied Mathematicians Calculus of Variations, PDEs, and Modeling, Progress in Nonlinear Differential Equations and Their Applications (PNLDE, volume 87), Springer.
- (9) C. K. Tse, J. Liu, F. C. M. Lau, A network perspective of the stock market., J. Empir. Financ. 17, 659–667 (2010).
- (10) C. Villani, Optimal Transport: Old and New, Springer, A series of Comprehensive Studies in Mathematics, 2009, Berlin.
- (11) S. Wu, H. Cheng, J. Cai, P. Ma, w.Zhong, Subsampling in Large Graphs Using Ricci Curvature, The Eleventh International Conference on Learning Representations , 2023.
- (12) X-G. Yan, C. Xie, G-J Wang, Stock market network’s topological stability: Evidence from planar maximally filtered graph and minimal spanning tree, International Journal of Modern Physics B, 29,22, Pg.155-161,2015.