Hierarchical Risk Parity
A machine-learning-inspired portfolio allocation method that uses hierarchical clustering and recursive bisection to build diversified portfolios without requiring covariance matrix inversion.
Overview
Hierarchical Risk Parity (HRP), introduced by Marcos Lopez de Prado in 2016, represents a paradigm shift in portfolio construction. Unlike traditional methods (MVO, minimum variance) that require inverting the covariance matrix, HRP uses graph theory and machine learning techniques to allocate weights based on the hierarchical structure of asset correlations.
The key insight is that asset returns exhibit a natural hierarchical clustering structure: assets within the same sector or asset class tend to be more correlated with each other than with assets in different sectors. HRP exploits this structure to allocate risk in a top-down manner, producing portfolios that are more stable, more diversified, and less sensitive to estimation error than MVO.
The algorithm proceeds in three well-defined steps: (1) hierarchical clustering of assets based on a correlation distance metric, (2) quasi-diagonalization of the covariance matrix to group correlated assets together, and (3) recursive bisection to allocate weights using an inverse-variance heuristic.
Step 1: Hierarchical Clustering
Correlation Distance
The first step converts the correlation matrix into a proper distance metric. The distance between assets and is defined as:
where is the Pearson correlation between the returns of assets and . This distance satisfies the properties of a proper metric: when (perfectly correlated), when (perfectly anti-correlated), and when (uncorrelated).
Agglomerative Clustering
Using the distance matrix, single-linkage (or Ward) agglomerative clustering is applied to build a hierarchical tree (dendrogram). At each step, the two closest clusters are merged until all assets belong to a single cluster. The result is a binary tree that captures the hierarchical correlation structure of the asset universe.
Step 2: Quasi-Diagonalization
The quasi-diagonalization step reorders the rows and columns of the covariance matrix according to the hierarchical clustering output. Assets that belong to the same cluster are placed adjacent to each other, producing a matrix where the largest values are concentrated along the diagonal:
where is a permutation matrix derived from the dendrogram ordering. This reordering is essential because it ensures that the recursive bisection in Step 3 splits the portfolio along meaningful cluster boundaries, grouping similar assets together and dissimilar assets apart.
Step 3: Recursive Bisection
Weight Allocation
The recursive bisection step allocates weights top-down. At each node of the dendrogram, the portfolio is split into two sub-clusters and , and weights are allocated inversely proportional to cluster variance:
where and are the variances (or volatilities) of the sub-clusters, typically computed as the variance of an equal-weight or inverse-variance portfolio within each sub-cluster.
Recursive Process
The bisection is applied recursively: each sub-cluster is further split into two sub-sub-clusters, and the process continues until individual assets are reached. The final weight of each asset is the product of all the allocation fractions along the path from the root to that asset's leaf in the dendrogram. This ensures that weights sum to one by construction, without requiring an explicit budget constraint.
Advantages & Limitations
Advantages
- No matrix inversion: Does not require inverting the covariance matrix, avoiding the numerical instability that plagues MVO.
- No return estimates: Like minimum variance, HRP does not require expected return forecasts.
- Stability: Produces more stable allocations over time, with lower turnover than MVO-based methods.
- Robustness: Monte Carlo simulations show HRP outperforms MVO and equal weighting on a risk-adjusted basis, especially with noisy inputs.
- Works with singular matrices: Can handle cases where the covariance matrix is singular or near-singular.
Limitations
- Heuristic method: Not derived from an explicit optimization problem, so there is no formal optimality guarantee.
- Clustering sensitivity: Results depend on the choice of linkage method and distance metric.
- No constraints: Does not natively support additional constraints like sector limits or turnover bounds.
- Ignores returns: Cannot incorporate views on expected returns into the allocation.
References
- Lopez de Prado, M. (2016). "Building Diversified Portfolios that Outperform Out of Sample." The Journal of Portfolio Management, 42(4), 59-69.
- Lopez de Prado, M. (2018). Advances in Financial Machine Learning.John Wiley & Sons.
- Raffinot, T. (2017). "Hierarchical Clustering-Based Asset Allocation." The Journal of Portfolio Management, 44(2), 89-99.
- Bailey, D. H., & Lopez de Prado, M. (2013). "An Open-Source Implementation of the Critical-Line Algorithm for Portfolio Optimization." Algorithms, 6(1), 169-196.