Correlation filtering on the S&P 500

largestYesterday we shared a link to a video showing how Python’s Networkx package could be combined with Gephi to produce some stunning network visualizations. Today we wanted to use these same tools to look at the correlation structure of the S&P 500. 

To do so, we took the correlation matrix of the changes in the components of the S&P 500 and linked two stocks with an edge if their absolute correlation was greater than a threshold value (about 0.6). Then we exported the graph in GEXF format so we could use Gephi’s layout and formatting algorithms to create the graph you see highlighted in this post.

Tmain_clusterhe graph forms several distinct clusters, with the largest two merging into a mass of a few hundred stocks centered around Ameriprise Financial (AMP) and Honeywell (HON). The green cluster is comprised of financial services as well as some technology companies, while the blue cluster is formed around multinational manufacturers.

Remember, these stocks are clustered based off their shared correlation structure, so it is revealing that many industry groups are preserved in the graph structure despite using no explicit industry classification in the construction of the graph.

Oil and gas exploration companies make up the pink/red cluster, centered around stocks such as Schlumberger (SLB) and Marathon Oil (MRO). Stocks like Flowserve (FLS) and Dow Chemical (DOW) serve as a bridge between the blue manufacturing cluster and red cluster representing the Oil & Gas industry.

zoom0

zoom2

Utility companies make up another distinct cluster in purple, coalescing around stocks like NextEra (NEE) which owns Florida Power and Light.

On the periphery we can also make out a faint cluster which contains a predominance of real estate related companies like Avalon Bay (AVB) and REIT’s like Vornado (VNO).

zoom3Some researchers have suggested that using correlation filtered graphs can help investors select robustly diversified portfolios. The theory is that stocks along the periphery represent the least connected stocks from a correlation perspective and thus contain the stocks that are more diversified from the rest of the market.

We use these graphs to identify the ones that are most connected to the market as a whole. These are stocks which are worth watching because they exert a large influence on the market. Much like social networks, where a few accounts are connected to a loosely coupled mass, the stock market contains stocks that act as leaders for the rest of the market. Network graphs can show how investors and traders reduce the complexity of trading a large universe like the S&P 500 by partitioning components into distinct clusters and groups. No stock is an island. Each stock forms part of a fabric of correlation, and financial network graphs can help make sense of an increasingly complex


To check out the fun for yourself, visit our SliceMatrix signup page. Explore Minimum Spanning Trees and Filtered Correlation Networks for the S&P 400, S&P 500, S&P 600 and NASDAQ 100 indexes.

Network Graph from SliceMatrix

Network Graph from SliceMatrix


market.

12 replies »

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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