12 Jul 2022 3 min read

What dendrograms and clustering algorithms can tell us about equity markets

By Patrick Greene

Much like a family tree shows how closely related family members are, a dendrogram can reveal the performance proximities of different regions and industries.

data-visualisation.jpg

Underneath the broad equity index exposure, multi-asset portfolios are invested in many different regions and industries. When making investment decisions it is helpful for us to understand how these different regions and industries are behaving, whether they are moving together or in opposite directions.

One of the tools we use to do this is clustering algorithms and dendrograms. The algorithm groups data together based on how similar they are, and the dendrogram is how we view the results.

A dendrogram works a bit like a family tree. At the bottom of the tree and closest together are those most closely related to one another. As you travel further up the tree to connect two points, they become more distantly related.

Visualising hidden linkages

But for our dendrograms, we don’t use people and genealogy, we use the correlation between equity sectors and regions. The results you get will differ if you use different periods or try different algorithms, but there are some recurring themes we can draw out.

Here is an example looking at weekly data since 2000:

Dendrogram-chart-1.png

What does this tell us?

We have colour coded the observations to help identify clusters. If you look at the green cluster, with just two sectors, you can see that the Nasdaq index and the EU tech sector are closely related. This is no surprise; they contain the securities of companies that sell similar products and services.

The clusters typically group into themes we would describe as defensives (blue), tech (green), financials (yellow), cyclicals (red) and energy (teal). We also see some that don’t perfectly match these labels (after all, this algorithm doesn’t understand what it is looking at, it is just working with numbers). One example is European equities; they are closest related to financials, perhaps reflecting the impact of the financial crisis on the region.

The same sectors in the US and euro area tend to be close but are often not the most closely linked pair. For example, European and US healthcare are closely related, but the latter is most closely related to US staples.  This is a good reminder that both industry and macroeconomic trends are important.

Hunting a moving target

The UK and US equity markets tend to be difficult to categorise. In the example we’ve shown here, the UK is linked to energy. There are some big energy companies in the FTSE 100, so this is not too surprising. But using other subsets of the data the UK can show up in different groups. At different points since 2000 there have been very different macroeconomic forces impacting the UK, which has large overseas exposures in the financial, energy and mining industries, so it can’t be assumed any single factor dominates all the time.

Similarly, it seems we should be cautious about assuming the drivers of the US equity market, as they too can move between groups in different subsamples of the data.

We can also gain interesting insights by comparing the long-term data with the more recent past to see what’s changed.

Here is the same diagram using the last year of data:

Dendrogram-chart-2.png

There are still five main clusters, but they have a slightly different interpretation. In addition to tech, defensives and cyclicals, there is a separate European cluster, and Japan and emerging market equities are clustered together. Financials and energy are grouped with the other cyclical sectors, rather than separately. Also, we see the US linked to the tech cluster, confirming most people’s intuition that the recent performance in the US has been heavily linked to tech.

This exercise can help us spot changes in market behaviour or potentially anticipate future changes. This is important as we seek to benefit most from diversification, where it is available, and spot opportunities where our views differ from the market.

Patrick Greene

Strategist

Patrick is a strategist within LGIM's Asset Allocation team, covering a range of asset classes. Patrick joined LGIM in 2021 from M&G, where his most recent role was in the Long-Term Investment Strategy team, covering both macroeconomic research and investment strategy. Prior to that, he was an economist at CRU, providing economic research relevant to commodity markets. Patrick graduated from Durham University with a degree in economics. He also holds an MSc in economics from Trinity College Dublin and the Investment Management Certificate.

Patrick Greene