Using Hierarchical Clustering to Group Stocks by Price Relationships
Summary
The question asks how to classify stocks beyond familiar categories such as sector, industry, exchange, currency, and market capitalization, in the context of analyzing portfolio margin. The answer proposes unsupervised hierarchical clustering, followed by a dendrogram to visualize how stocks group together. In this approach, similarity is derived from relationships in the stocks’ price data rather than assigned company classifications.
The suggestion is linked to the idea of Hierarchical Risk Parity, which uses a hierarchical representation of asset relationships in portfolio optimization. The cited portfolio research is offered as inspiration, not evidence that clustering will improve margin analysis or portfolio performance. The document does not specify how to transform prices into similarity measures, choose a distance metric, select a clustering method, or test whether the resulting groups are useful. Those choices matter, so the proposal is a starting point for exploratory analysis rather than a complete classification procedure.
Key ideas
- Hierarchical clustering can group stocks according to relationships estimated from their price data.
- A dendrogram provides a visual representation of the nested groups produced by the clustering.
- The suggestion draws inspiration from Hierarchical Risk Parity research in portfolio optimization.
- The discussion does not prescribe similarity measures or demonstrate that the groups improve margin analysis.
Tags
Full text
# Classifying groups of stocks beyond Market Cap/Industry/Sector # Classifying groups of stocks beyond Market Cap/Industry/Sector I'm monitoring margin values for a portfolio and I want to classify the stocks in my universe using different metrics/information. Just for the sake of making analysis/inferences on the data I have. So far, I've categorized it by: Sector, Industry, Exchange, Currency and Market Cap. But I'm not sure what other information I can use to continue categorizing the portfolio. Can you suggest metrics or/and resources related to this? I'm not sure where to look for exactly. Thanks a lot in advance! ## Answer by Jacques Joubert (score 1, accepted) https://quant.stackexchange.com/a/44881 You could always turn to unsupervised machine learning and apply hierarchical clustering and then plot the relationships using a dendrogram. There is a cool portfolio optimization paper that uses Hierarchical Risk Parity to optimize a portfolio. That's the source from which I drew this inspiration. Building Diversified Portfolios that Outperform Out-of-Sample It will group similar stocks together based on the relationships derived from their price data. I think you will be presently surprised.
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.