Inferensys

Glossary

Hierarchical Risk Parity (HRP)

A machine learning-based portfolio optimization method that uses hierarchical clustering to allocate capital without requiring the inversion of the covariance matrix.
Risk analyst performing AI risk assessment on laptop, risk matrices visible, casual office risk session.

What is Hierarchical Risk Parity (HRP)?

A machine learning-based portfolio optimization method that uses hierarchical clustering to allocate capital without requiring the inversion of the covariance matrix.

Hierarchical Risk Parity (HRP) is a portfolio optimization algorithm that replaces the unstable inversion of the covariance matrix with hierarchical tree clustering and recursive bisection to allocate risk equally among nested asset clusters. By organizing assets based on their correlation distance, HRP sidesteps the estimation errors that plague traditional Mean-Variance Optimization (MVO) when dealing with singular or ill-conditioned covariance matrices.

The process operates in three distinct stages: first, a distance matrix is computed from the correlation matrix; second, a linkage algorithm constructs a hierarchical clustering tree (dendrogram); and third, the portfolio is built via recursive bisection, assigning weights so that each parent cluster contributes an equal risk budget. This methodology produces robust, diversified allocations that are particularly resilient during market regime shifts where covariance structures break down.

MACHINE LEARNING-DRIVEN ALLOCATION

Key Features of HRP

Hierarchical Risk Parity (HRP) addresses the instability of traditional mean-variance optimization by replacing the inversion of the covariance matrix with hierarchical clustering and recursive bisection.

01

Hierarchical Tree Clustering

HRP begins by computing a distance matrix from the correlation matrix, transforming correlations into a metric space. A hierarchical clustering algorithm (typically single-linkage or Ward's method) then groups assets into a dendrogram. This tree structure captures the nested economic relationships between assets, ensuring that highly correlated assets—like Coca-Cola and PepsiCo—are placed close together on the branches before any capital allocation occurs.

02

Quasi-Diagonalization (Matrix Seriation)

The clustering output is used to reorder the covariance matrix into a quasi-diagonal form. This step places large covariances near the diagonal, effectively grouping similar assets together. Unlike the raw matrix, this reordered structure is highly intuitive and eliminates the need to invert a noisy, ill-conditioned matrix. The seriation process ensures that the subsequent allocation respects the natural economic hierarchy of the assets.

03

Recursive Bisection Allocation

Capital is allocated top-down through the dendrogram using inverse-variance weighting at each split. At every node, the algorithm:

  • Splits the cluster into two sub-clusters
  • Assigns weight to each branch inversely proportional to its variance
  • Recursively repeats until reaching single assets This ensures that risk is diversified at every level of the hierarchy, preventing concentrated bets in highly correlated clusters.
04

Covariance Inversion-Free Stability

Traditional Mean-Variance Optimization (MVO) requires inverting the covariance matrix, which becomes numerically unstable when assets are highly correlated or when the number of observations is less than the number of assets. HRP completely bypasses this step. By using the dendrogram structure and recursive bisection, HRP produces robust, stable weights that do not suffer from the extreme concentration and high turnover plaguing MVO portfolios in high-dimensional settings.

05

Out-of-Sample Robustness

Empirical studies demonstrate that HRP portfolios consistently achieve lower out-of-sample variance and lower turnover than MVO, Risk Parity, and equally-weighted benchmarks. Because HRP does not rely on precise return forecasts or matrix inversion, its allocations are less sensitive to estimation errors. This makes HRP particularly effective for large universes—such as the S&P 500 constituents—where the number of assets far exceeds the number of meaningful independent observations.

06

Flexible Distance Metrics

The clustering step can be customized with alternative distance measures beyond standard Pearson correlation. Practitioners can incorporate:

  • Tail-dependence coefficients for downside risk clustering
  • Mutual information for non-linear dependencies
  • Dynamic conditional correlations for time-varying relationships This flexibility allows HRP to adapt to specific market regimes or asset classes, such as clustering cryptocurrencies by on-chain metrics rather than price correlations.
METHODOLOGY COMPARISON

HRP vs. Traditional Portfolio Optimization

Structural and performance differences between Hierarchical Risk Parity and classical mean-variance optimization approaches.

FeatureHierarchical Risk ParityMean-Variance OptimizationRisk Parity

Covariance Matrix Inversion Required

Sensitivity to Estimation Errors

Low

High

Moderate

Handles Multicollinearity

Intra-Cluster Correlation Considered

Concentration Risk in Single Asset

Low

High

Moderate

Out-of-Sample Turnover

0.3%

1.2%

0.7%

Minimum Effective Number of Bets

4.8

2.1

3.5

Computational Complexity

O(n²)

O(n³)

O(n²)

HIERARCHICAL RISK PARITY EXPLAINED

Frequently Asked Questions

Clear, technically precise answers to the most common questions about Hierarchical Risk Parity (HRP), a modern portfolio optimization technique that overcomes the fragility of traditional mean-variance methods.

Hierarchical Risk Parity (HRP) is a machine learning-based portfolio optimization method that uses hierarchical clustering to allocate capital without requiring the inversion of the covariance matrix. Developed by Marcos López de Prado, HRP addresses the instability of traditional Mean-Variance Optimization (MVO) when the number of assets is large relative to the number of observations. The algorithm operates in three distinct stages:

  • Tree Clustering: HRP computes a distance matrix from the correlation structure of asset returns and applies a hierarchical clustering algorithm (typically single-linkage or Ward's method) to form a tree diagram, or dendrogram, that groups assets by similarity.
  • Quasi-Diagonalization: The covariance matrix is reorganized so that similar assets are placed close together along the diagonal, producing a quasi-diagonal matrix that concentrates the largest covariances near the diagonal.
  • Recursive Bisection: Capital is allocated top-down through the dendrogram. At each node, the algorithm performs a risk parity split, assigning weight to each sub-cluster inversely proportional to its variance. This process continues recursively until every individual asset receives an allocation.

The result is a portfolio that respects the hierarchical structure of the market, producing weights that are more robust to estimation errors and less concentrated than those from traditional quadratic optimizers.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.