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.
Glossary
Hierarchical Risk Parity (HRP)

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.
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.
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.
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.
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.
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.
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.
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.
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.
HRP vs. Traditional Portfolio Optimization
Structural and performance differences between Hierarchical Risk Parity and classical mean-variance optimization approaches.
| Feature | Hierarchical Risk Parity | Mean-Variance Optimization | Risk 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²) |
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.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Explore the mathematical and machine learning concepts that contextualize Hierarchical Risk Parity within modern portfolio construction.
Risk Parity
The foundational precursor to HRP. Risk Parity allocates capital such that each asset contributes an equal amount of risk to the portfolio. Unlike HRP, traditional Risk Parity relies on the invertibility of the covariance matrix, making it unstable in high dimensions. HRP solves this by introducing a hierarchical structure that bypasses matrix inversion entirely.
Random Matrix Theory (RMT)
A mathematical framework used to denoise empirical covariance matrices. RMT separates statistically significant eigenvalues from random noise. HRP achieves a similar goal—robustness to estimation errors—not by cleaning the matrix, but by discarding the covariance structure in favor of hierarchical clustering, avoiding the numerical instability RMT seeks to correct.
Mean-Variance Optimization (MVO)
The classic Markowitz framework that maximizes return for a given variance. MVO is notoriously sensitive to input estimation errors, often producing corner solutions. HRP addresses MVO's fragility by replacing the inverted covariance matrix with a tree-based allocation that is less sensitive to small changes in input data.
Conditional Value-at-Risk (CVaR)
A coherent risk measure quantifying the expected tail loss beyond the Value-at-Risk threshold. While CVaR optimization focuses on minimizing extreme losses, HRP focuses on diversification across clusters. Combining HRP weights with a CVaR objective allows for robust portfolios that are both diversified and tail-risk aware.
Convex Optimization
A class of problems where the objective function and constraints are convex, guaranteeing a global optimum. HRP is a non-convex, heuristic method that replaces the convex quadratic programming of MVO. It trades mathematical optimality for robustness to estimation errors, which often outperforms optimal solutions in out-of-sample tests.
Effective Number of Bets (ENB)
A measure of portfolio diversification quantifying the number of uncorrelated risk sources. A concentrated portfolio has a low ENB. HRP maximizes diversification by clustering assets and distributing risk across hierarchical branches, naturally increasing the ENB without requiring explicit factor decomposition.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us