Extracted main text — title through conclusion, appendix excluded. This is what our citation measures are computed over, published so the extraction can be checked by eye.
57,586 characters · 24 sections · 30 citation commands
On the Ollivier-Ricci curvature as fragility indicator of the stock markets
\setcounter{page}{0}
\email{[email removed]}
\abstract{Recently, an indicator for stock market fragility and crash size in terms of the Ollivier-Ricci curvature has been proposed in RicciFinance. 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.}
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:
The recent works RicciFinance and ManyCurvaturesFinance 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 ((ref)-(ref)).
The Ollivier-Ricci ($\operatorname{O-Ricci}$) curvature of the associated network of RicciFinance (based on MarketMining and NetworkPerspective) 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 $\operatorname{O-Ricci}$ 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 NetworkPerspective. Since then, there has been a lot of interest in obtaining knowledge of the stock market from this network. In RicciFinance 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 VillaniOldAndNew, McCann), justify using curvature as a measure of fragility, see RicciFinance. \\ ManyCurvaturesFinance 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 RicciFinance.
In this section we present the algorithm for the hallmark proposed and used in RicciFinance and ManyCurvaturesFinance. We denote the hallmark for a given network by $\operatorname{O-Ricci}^{Net}$, which will depend on the size of the time period chosen $T$ and the edge threshold $\xi$ (see below).
Intuitively, one uses a function of correlations of data in the period of size $T$ 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 $\operatorname{O-Ricci}$ curvature of the sub-graph using the hop distance as the cost function (and not the weighted distance).
Intuitively, for an edge $xy$ we observe $k(x,y) < 0$ if the weights and edges for neighbors of $x$ are such that it seems like $x$ is pulled away from $y$. That is, $x$ and $y$ may be connected by an edge but the weights of neighbors of $x$ away from neighbors of $y$ are relatively high. \\ In equation (ref), $W_1$ denotes the Wasserstein distance between probability measures, defined via
where again $d(i,j)$ is the hop distance, the minimum number of steps needed to traverse the graph from verrtex $i$ to vertex $j$. The Wasserstein distance can be computed with numerical packages, like Python Optimal Transport (POT), which was used in the simulations in Section (ref). \\
From Algorithm (ref), we can formulate several questions.
We aim to answer all these questions throughout this work.
Question: If $(G,N,E,W)$ is weighted graph and $(MST(G),N,E',W\lvert_E)$ is it's minimum spanning tree, what is the relation between $\operatorname{O-Ricci}^{G}$ and $\operatorname{O-Ricci}^{MST(G)}$? \\ Answer At the moment there is no apparent relation between $\operatorname{O-Ricci}$ curvature of the MST and the $\operatorname{O-Ricci}$ curvature of the original graph. We can construct simple examples with opposite results.
From Example (ref), it becomes apparent that the $\operatorname{O-Ricci}$ curvature of the Minimum Spanning Tree (MST) and the original graph are not directly correlated. Consequently, in Algorithm (ref), 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:
Consider an undirected weighted graph $G := (N,E,W)$, where $N$ is the set of nodes, $E$ the set of edges and $W = \{ w_{e}: e \in E\}$ is the set of weights for all edges. Assume that for $x,y \in N$, $xy \not \in E$, and let us define $G^* = (N, E^*, W^*)$ where $E^* = E \cup \{xy\}$ and $W^* = W \cup \{w_{x,y}\}$. In other words, $G^*$ the graph $G$ modified by adding the edge $e := xy$ joining $x$ and $y$ with weight $w_{x,y}$.
Let $d$ denote the Hop distance in $G$ and $d^*$ denote the Hop distance in $G^*$. Observing that adding an edge can only decrease the number of steps between nodes, for every $a\neq b \in N$ it follows that
Keeping the notation of Algorithm (ref), for every $a\neq b\in N$ we define the measures $\mu_a(\cdot)$ and $\mu_b(\cdot)$ by
where $N_a$ is the set of neighbors of $a$ in $G$ and $N^*_a$ is the set of neighbors of $a$ in $G^*$. The difference between $N_a$ and $N_a^*$ relies only on the condition $a \in \{x,y\}$, as
As a result, the measures in (ref) only change if $a \in \{x,y\}$, or equivalently $\mu_a = \mu^*_a$ if $ a \not \in \{x,y\}$. Even if the measure $\mu^*_a$ remains unchanged from $\mu_a$, the Wasserstein distance $W^{d^*}$ may change from $W^d$ as the distance function has changed.
Denote by $\operatorname{O-Ricci}^{G}$ (respectively $\operatorname{O-Ricci}^{G^*}$) the Ollivier-Ricci curvature computed with the induced Hop distance $d$ on $G$ (respectively $d^*$ on $G^*$), as described in Section (ref).\\
Our first result, Proposition (ref), measures the total change in edge-curvature in terms of the relative error between $d$ and $d^*$. As we add a single edge to the graph, the only control on the curvature depends on how much the hop distances change.
Unless one applies more conditions to the graphs $G$ and $G^*$, we expect the above inequalities to be sharp, based on the following example.
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 $n_a = \#N(a)$ denote the degree of a node $a$, and recall that by $\{xy\}$ we specifically denote the edge added to the graph $G$ to obtain the graph $G^*$ (and by $x, y$ we denote the affected nodes). We first establish the following lemma, which features the key idea (see Figure (ref)).
Since we do not take the graphs $G$ and $G^*$ to be directed, the argument for $\mu_x$ and $\mu_x^*$ is also valid for $\mu_y$ and $\mu_y^*$.
Note that because $d^*(x,y) \geq 1$, we immediately get a more familiar type of bound:
Equation (ref) shows a direct connection between connectivity and curvature, via the right hand-side which involves the degrees of $x$ and $y$.
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 (ref) we observe that (as expected) the indicator shows a stronger auto-correlation as $T$ increases. As a measure of economical ex-post analysis, higher values of $T$ are preferred.
We now show via auto-correlation plots that in the $ T \to 0$ limit the indicator behaves increasingly as white noise.
From Figure (ref) it is clear that taking small values of $T$ for the computation of $\operatorname{O-Ricci}^{Net}$ may result in short-term mistakes in trends. These mistakes are fundamental when trying to use $\operatorname{O-Ricci}^{Net}$ as a measure of fragility.
In StabilityOfMST it was shown that the MST obtained from $D_{i,j} = \rho_{i,j}$ is relatively stable with respect to changes of $T$ for financial networks constructed as in Algorithm (ref). \\
In this section we plot different distance functions for a randomly chosen subset of the data to compare the impact on the MST and $\operatorname{O-Ricci}$. As theorized in StabilityOfMST, similar distances did not present significant changes in their plots, except when considering logarithms. Hence, we think it is reasonable to use $\sqrt{2(1-C_{i,j})}$ as it is commonly used in literature (where it is sometimes referred to as an “ultrametric”).
In Figures (ref), (ref), (ref), and (ref) we observe that for simple functions of the form $ D_{i,j} = (2(1-\rho_{i,j}))^p$ for some power $p$, the behaviour of the indicator can be similar. Nevertheless, a bad choice of cost function can result in noise, as exemplified by $\log(1+2(1-\rho))$. Notice that $h(a)= \log(1 + a)$ is concave in $[1,\infty)$ but Figure (ref) does not show the behaviour of the previous choices $h(a) = a^p$ (in Figures (ref), (ref), and (ref)). The study of general properties of functions $h$ such that $h(1-\rho)$ is a reasonable indicator is an interesting future line of research.
Example (ref) 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.
In Algorithm (ref), the weights $D_{i,j}$ are used to obtain the MST and to define the measures via (ref). An argument similar to those presented in WeightedTreeRicci and WeightedTreeRicci 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 $\operatorname{O-Ricci}$ curvature rather than a different statistic like the maximum or minimum Ricci curvature.
We conclude that the weight function $D_{i,j}$ 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 $\operatorname{O-Ricci}$.
In Algorithm (ref), we obtain the MST and then add back edges satisfying
If $D_{i,j} = h(1-\rho_{i,j})$, where $h: \mathbb{R} \to \mathbb{R}$ is positive and continuous function with $h(0) = 0$, then (ref) adds the edges $ij$ whose corresponding weights $D_{i,j}$ are small. From this observation, we expect $\mu^*$ to be similar to $\mu$ due to the stability result of StabilityOfMST. The exact nature of this similarity remains an open question.
As in RicciFinance we start by studying the American market. We compute the average $\operatorname{O-Ricci}$ 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.
In Figure (ref) we observe the value of the indicator from 1998-2012. We use all data available for S&P listed companies, $T = 132$ and $\xi = 0.85$. We see a huge spike during September 2008, during the Lehman Brothers collapse.
In RicciFinance, the algorithm of section (ref) 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 (ref) we see the value of Algorithm (ref) 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.
Figure (ref) shows that the $\operatorname{O-Ricci}$ 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 $T$.
In Figure (ref), 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 $\operatorname{O-Ricci}$ curvature did not return to it's pre-crisis values until April-May 2009.
In the works MarketMining and NetworkPerspective 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 (ref) to be robust, we need to analyze the $\xi$-elasticity of the $\operatorname{O-Ricci}$ indicator. By Proposition (ref) 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 $\xi$, 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 $\operatorname{O-Ricci}$ depends on the ratio of $W^{d^*}$ and $d^*$, indicates that an apparent trend in a small period of time is not reliable unless $\xi$ is somehow prescribed or fixed. Two experiments with similar values $\xi_1 \approx \xi_2 $ and $ \xi_1 \neq \xi_2$ can indicate short-term tendencies in opposite directions.
We start with an extreme value of $T= 2000$ and then we show that the same behaviour is observed in the cases $T = 22$ and $T=132$, which are much noisier by default.
Figures (ref), (ref), (ref) and (ref) show that although the general trend is captured by the indicator, changes in $\xi$ 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 $T$.
We continue the same simulations for $T = 132$ in order to show that the phenomena explained in the previous section prevails in a slightly smoother case.
In this section we choose companies from the S&P ETFs for Canadian companies and evaluate the $\operatorname{O-Ricci}$ estimator.
Figure (ref) shows the relative difference (according to $\operatorname{O-Ricci}^{net}$) of the financial crisis of 2008 and the impact of the Covid-19 pandemic on $\operatorname{O-Ricci}^{net}$. From (ref) 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 (ref)) we see this difference replicated for most values of $\xi$, making the analysis much more robust.
From the sub-graph of the Canadian market with large $T$ (Figures (ref) and (ref)), we observe a clear increase in fragility during 2004-2008 period and a clear decrease in the indicator for all values of $\xi$ in 2018-2020, followed by another increase at the same time as the Covid-19 pandemic.
In this section we look at the $\operatorname{O-Ricci}$ 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 $\xi \in (0.75,0.85)$ 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.
Figure (ref) shows the complexity of choosing the parameters for the indicator. While we expect large $T$ ($2000$) to show a clearer picture, for the Tech Industry it seems to be “too big”. In the $T = 2000$ case different values of $xi$ show different behaviours, while $T = 132$ successfully captures some peaks for most values of $\xi$. One possible explanation for this phenomena is that this sector is deemed to be more volatile, in some underlying sense, so large values of $T$ “average out” the local tendencies.
As argued in Section (ref), the $\operatorname{O-Ricci}$ curvature of the MST seems to have no direct relation to the $\operatorname{O-Ricci}$ curvature of the original graph. It is reasonable to study a sub-graph which maximizes or minimizes $\operatorname{O-Ricci}^{Net}$. Given a random initial vertex and a size $n$, one can generate a sub0graph with $n$ vertices and minimal $\operatorname{O-Ricci}^{Net}$ following the algorithm in ORGSSPaper. Whether computing such an indicator performs better than the one presented in RicciFinance is an interesting open question left for further research (with higher available computational power).
We see in the next figure that the behaviour for small number $m$ is similar to the indicator of algorithm (ref). The technique of algorithm of section (ref) 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:
We leave both of these directions for forthcoming research.
We remark that similar graphs using the maximum curvature sub-graph yielded noisy graphs with no apparent trends.
In section (ref) we posed the following questions, which we now answer:
Throughout this work we have shown that $\operatorname{O-Ricci}^{net}$ 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 $\xi$, as indicated in section (ref), one should be careful when using $\operatorname{O-Ricci}^{net}$ to predict short time tendencies of the market. In sections (ref) and (ref) we observed that the value of $\xi$ 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, $\xi$ should be understood as a hypothesis on which the inference of crisis from $\operatorname{O-Ricci}^{net}$ 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 (ref) depends on parameters $\xi$ and $D_{i,j}$ 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 (ref) directly from the constructed network, avoiding having to reduce to the MST and adding links via $\xi$.
One important observation about Algorithm (ref) 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.
In this section we present the lines of investigation which remain open and we believe are of most interest.
We can understand Proposition (ref) 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, (ref) tells us that adding an edge will not result in a big change in curvature.
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 $T \to 0$ limit?
Although equation (ref) 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) 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), WeightedTreeRicci are well known. We expect similar results for the hop-case.