Seeing the forest for the Minimum Spanning Trees

If you are lost…

The S&P 500 is down around 7% as a whole since July 1st of this year, but as with all indexes, averaging has the effect of hiding a wide range of outcomes for its component companies. In trying to disentangle the individual stories within the index, we risk losing perspective on the group as a whole. What we really need is something akin to a map: something that shows the big picture but also preserves detail as we look closer.

The title of this article alludes to a common metaphorical connection between the task of making a complex decision and the difficulty of navigating a forest. As it suggests, we want to be able to investigate each tree in high resolution. We want to study its leaves, sample its bark, and know all that we can about it as an individual.

At the same time, however, we don’t want to become so myopic that we lose focus of the bigger picture of whats going on within the forest. This can cloud our thinking in both literal navigation and any figurative decision making the metaphor suggests.

Can such a financial visualization be created? MKTSTK’s answer is unambiguously: it already has.

…Get a map!

In the past, MKTSTK has shown how to use Minimum Spanning Trees to provide a compact representation of the financial market in one graph. Because they are derived from the correlation matrix of asset returns, MST’s quickly reveal the underlying statistical structure of the market: stocks that are connected to one another move as a flock or herd together over time. MST’s selectively filter the connections within the full correlation matrix using Kruskal’s algorithm.

MST’s were initially used to solve problems such as:

  • how to link up a telecommunications network using the shortest path
  • image registration and segmentation (think: feature detection and clustering)
  • industrial process control

Like many mathematical concepts with practical value, the MST eventually percolated into the financial markets and academia. Financial network theory developed, showing the world how to create topological road maps of the stock market. This reduced the complexity of visualizing large groups of assets, opening the door to new ways of perceiving the financial markets.

We can take this one step further and embed deeper layers of information within the graph using color and size: each circle or node represents an individual stock. The color is proportionate to the return of the stock over time. In other words, if a node is red then the stock return was strongly negative, blue its largely unchanged, and green if the return was strongly positive.

Similarly, the size of each object in the graph has meaning: 1) the size of each node is proportionate to its connectedness within the graph and 2) the width of each edge, or link, is proportionate to the strength of the correlation between the stocks connected.

This technique provides us with a unique toolkit to investigate stock market dynamics. For example, the graph below shows the MST for the S&P 500 from July 1st to today. There are many pockets of red and blue. Since we are using a gradient to color each node, purple nodes are stocks which were down modestly, whereas blue-green stocks went up slightly. To give you some perspective, anything bright red was down 15% or more, likewise the bright green cutoff was +15%.


As you can see, not all stocks are connected equally to the rest of the index. Some, like Fiserve (FISV), a financial services technology firm, are connected to 15 other companies via share price correlation. Other stocks live at the edge of the graph in their own world, only connected to one other node.

This dynamic has the effect of creating clusters within the graph, like this constellation centered around Dow Chemicals (DOW) and Franklin Resources (BEN). At first glance this connection seems unlikely: what does an industrial chemical manufacturer have to do with a wealth management firm? Statistically, quite a bit it would seem. The two firms are connected via a bridge through Eaton Corp (ETN), a maker of power management systems. The pairwise correlation between DOW and ETN is 75%, the same as ETN with BEN. All three have seen their share price move down sharply since July, suggesting a common risk factor that was perhaps not properly appreciated before the latest spike in volatility.


This surprisingly constructed cluster is more than just a curious statistical artifact, correlation is at the heart of the twin problems of diversification and risk management. At the end of the day, both problems involve minimizing the chance that your whole portfolio is going to hurt you at the same time.

The problem is the same whether you are a high frequency prop shop or a fund manager:

  • The HFT’s select a portfolio of strategies (algorithms) that won’t all lose money at once; this leads to a high probability of being profitable in any given day (if done correctly)
  • The fundo selects a portfolio of assets such that they won’t all lose value over the same time horizon; some winners will subsidize losers if they create true diversification

The mindset that laid the groundwork for the 2008-now crisis was: not every borrower would default at the same time. In fact it worked more like an avalanche; the conditions that caused one default were likely to cause additional defaults. The distribution of risk in financial markets is not symmetric. Moreover, the absolute value of correlations have a tendency to go towards one during volatility shocks, as MKTSTK has shown in the past using correlation and volatility streamgraphs.

This makes it imperative that traders and investors have a proper grasp on the correlation structure underpinning the financial markets. Fundamentals might win out in the long run (especially if we are talking about the size of central bank balance sheets), but short term correlation dynamics dominate any given day’s trading. If you are wondering why this or that stock is down / up today, you would be well advised to look at the stocks around it. No man is an island, nor is any financial asset. 

Want to explore the graph for yourself?

Take a look at SliceMatrix Real Time


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s