←  Work

Correlation alone rebuilds the GICS sectors

Single-linkage clustering over 496 S&P 500 stocks and every trading day of 2015.

Data structures2026
Universe
496 tickers
Period
All 252 days of 2015
Sectors
Ten
At k = 400
36 names, all Financials

The algorithm

Sort every pairwise correlation of daily returns, then merge the k strongest edges using union-find. Small k leaves almost everything a singleton. Large k collapses the index into one blob. The interesting behaviour is in between.

The finding

At k = 400 the largest cluster is 36 stocks, and every one of them is a Financial. The algorithm is never shown a sector label. It recovers the sector purely from how the returns move together.

Push k to 3,000 and purity falls to 28% as genuinely unrelated names get merged through chains of intermediate correlations. That degradation is the honest part of the result: single-linkage clustering is fragile to exactly that kind of chaining.

Why it matters beyond the coursework

If correlation structure reproduces the sector taxonomy, then sector labels are largely redundant for risk purposes, and a portfolio that diversifies across sector names may not be diversified at all. That is the same mistake the macro book made in a different asset class.

Run it yourself

Run the clustering yourself

Move k and the union-find runs live over 3,000 correlation edges. Cluster sizes, sector purity, price paths, the full sector correlation matrix and any ticker's nearest and furthest peers.

Next The best portfolio on paper needed a 9x short, so it was not the best portfolio →