Guide

Hierarchical risk parity (HRP) explained

Harbor Capital's systematic sleeve ran a classic mean-variance optimizer on twelve ETFs. The solver loved two large-cap growth funds with a 0.91 rolling correlation — together they consumed 38% of capital while behaving like one position. A single eigenvalue of the covariance matrix explained 64% of portfolio variance. The allocator replaced Markowitz weights with hierarchical risk parity (HRP), a method introduced by Marcos López de Prado that builds weights from the tree structure of asset correlations instead of inverting a noisy covariance matrix. HRP clusters similar assets, quasi-diagonalizes the covariance matrix along that tree, then recursively splits risk across branches. The result: out-of-sample variance fell 22% at the same return target, with no return forecasts required. This guide covers correlation distance and dendrograms, the three HRP steps, comparison with risk parity and naive diversification, the Harbor Capital refactor, an allocator decision table, pitfalls, and a production checklist alongside our correlation matrix guide.

Why mean-variance optimization breaks in practice

Markowitz optimal portfolios require inverting the covariance matrix Σ. When assets are numerous or history is short, Σ is ill-conditioned: tiny estimation errors in pairwise correlations produce wild weight swings. Optimizers exploit spurious negative correlations and concentrate capital in a handful of names. Shrinkage estimators and Black-Litterman views help, but the core fragility remains — you are solving a high-dimensional linear system on noisy inputs.

HRP sidesteps matrix inversion. It treats the correlation structure as a hierarchy: tech ETFs cluster together, bonds cluster separately, commodities sit on another branch. Risk is allocated between clusters first, then within clusters, so correlated siblings never each receive full independent weight. The method is deterministic given the dendrogram and works with as few as a few dozen daily observations per asset.

What HRP optimizes (and what it does not)

HRP is not mean-variance optimal in the Markowitz sense. It does not maximize Sharpe ratio or minimize variance subject to a return target. Instead it produces robust, diversified weights that respect correlation topology. Think of it as a disciplined alternative to equal weighting that down-weights redundant exposures. For sleeves where return forecasting is weak but covariance structure is informative — multi-asset beta books, ETF baskets, factor sleeves — HRP often outperforms Markowitz out-of-sample even when in-sample Markowitz looks superior.

The three HRP steps

López de Prado's algorithm has three stages. Implementations exist in Python (riskfolio-lib, mlfinlab) and R; the logic is portable to any language with clustering libraries.

Step 1: Tree clustering from correlation

Start with a correlation matrix ρ estimated from return series (see our correlation matrix guide for Pearson vs Spearman and shrinkage). Convert each pairwise correlation to a distance:

d(i,j) = sqrt( 0.5 × (1 - ρ(i,j)) )

Distance is zero for perfect correlation, one for perfect anti-correlation, and preserves the metric properties needed for hierarchical clustering. Apply single-linkage (or average-linkage) clustering to build a dendrogram — a binary tree where leaves are assets and internal nodes represent merge points. Assets that correlate highly merge early; structurally different assets merge late.

Step 2: Quasi-diagonalization

Reorder rows and columns of the covariance matrix according to the dendrogram leaf order. Correlated assets end up adjacent; uncorrelated blocks sit far apart. The reordered matrix is quasi-diagonal: most covariance mass concentrates near the diagonal. This ordering does not change the math of portfolio variance but sets up the recursive bisection in step 3.

Step 3: Recursive bisection

Walk the dendrogram top-down. At each split, divide the current subset into left and right child clusters. Compute each cluster's variance using inverse-variance weights within the cluster (a local risk parity step). Allocate capital between left and right inversely proportional to cluster variance — the riskier branch gets less weight. Recurse until every asset has a final weight. Weights sum to 1; no negative positions unless you add a long-only constraint wrapper.

Intuition: if U.S. tech and EU tech sit on the same branch, they share a budget before competing with bonds. The algorithm prevents both from receiving full standalone allocation.

HRP vs other allocation methods

Method Needs return forecasts? Handles ill-conditioned Σ? Typical weakness
Equal weight No Yes (ignores Σ) Overweights redundant correlated assets
Inverse volatility No Yes Ignores cross-asset correlations
Equal risk contribution (ERC) No Moderate (needs numerical solver) Still sensitive to Σ errors at scale
Mean-variance (Markowitz) Yes Poor without shrinkage Concentrated, unstable out-of-sample weights
Hierarchical risk parity No Strong (no inversion) Not Sharpe-optimal; linkage choice matters

HRP pairs naturally with a volatility overlay: compute HRP weights, then scale gross exposure to a target annualized vol (the same vol targeting step used in risk parity funds). It does not replace return-seeking alpha sleeves — it is a robust beta construction tool.

Harbor Capital refactor

Harbor's systematic ETF sleeve held twelve positions across equities, bonds, commodities, and alternatives. Markowitz weights (with Ledoit-Wolf shrinkage) concentrated 38% in two correlated growth ETFs and 14% in a low-vol dividend fund that correlated 0.88 with the same cluster. Effective bets: four, not twelve.

  1. Rebuilt the 252-day correlation matrix with weekly re-estimation.
  2. Ran single-linkage HRP; compared dendrogram against economic intuition (sector and geography labels).
  3. Applied recursive bisection with a 5% per-name cap post-HRP to satisfy liquidity policy.
  4. Backtested 2016–2025 walk-forward: re-fit HRP quarterly, hold one quarter out-of-sample.
  5. Layered 10% annualized vol target via gross exposure scaling.

Out-of-sample results vs shrinkage Markowitz on the same universe: annualized vol 8.1% vs 10.4%, max drawdown −11.2% vs −15.8%, turnover 34% lower per rebalance. Sharpe ratio improved modestly (0.71 vs 0.64) without any return forecast input. The allocator kept Markowitz for a separate alpha sleeve with strong IC signals; HRP became the default for the passive multi-asset core.

Allocator decision table

Allocator situation Recommended approach Why
12–30 ETF multi-asset book, weak return forecasts HRP + vol targeting Robust to correlation estimation noise
Strong factor IC with validated alpha model Markowitz or Black-Litterman on alpha sleeve only Return forecasts justify optimization risk
Four macro sleeves (stocks, bonds, commodities, cash) Classic risk parity / ERC Few assets; hierarchy adds little over ERC
100+ single-stock portfolio Factor model + shrinkage, or HRP with sector constraints Raw stock correlations are noisy; impose structure
Crisis regime, correlations spike to 1 Reduce gross exposure; do not trust any static optimizer No diversification math rescues synchronized selloffs
Tax-sensitive retail account HRP with turnover penalty or threshold rebalancing HRP tends to turnover less than Markowitz

Common pitfalls

  • Wrong linkage method without testing — single linkage chains dissimilar assets; compare single, average, and Ward linkage on your universe.
  • Static dendrogram across regimes — crisis correlations reshape the tree; re-fit at least quarterly.
  • Using price levels instead of returns — spurious correlation clusters; always work in log-return space.
  • Ignoring transaction costs — HRP lowers turnover vs Markowitz but quarterly re-fits still incur costs; model slippage in walk-forward.
  • Treating HRP as alpha — it is a weight construction method; it does not predict which assets outperform.
  • Survivorship-biased inputs — dropping delisted ETFs inflates diversification; use point-in-time universes.
  • Skipping vol overlay — raw HRP weights can still carry equity-like gross risk if bond sleeves are small.

Production checklist

  • Estimate correlations on aligned daily or weekly returns; document missing-data policy.
  • Apply Ledoit-Wolf or similar shrinkage before clustering when assets > 0.3 × sample length.
  • Visualize the dendrogram; confirm clusters match economic labels (sector, geography, factor).
  • Compare single-, average-, and Ward-linkage HRP weights; pick the most stable in walk-forward.
  • Run walk-forward backtest with quarterly re-fit and one-quarter holdout; report Sharpe, vol, max DD.
  • Apply position caps and liquidity filters after HRP, not before clustering.
  • Layer vol targeting if policy mandates a risk budget (e.g. 10% annualized).
  • Replay 2008, 2020, and 2022 stress windows on proposed weights.
  • Pair with rebalancing thresholds to avoid unnecessary turnover between scheduled re-fits.
  • Document linkage method, estimation window, and shrinkage in allocator memos.

Key takeaways

  • HRP builds weights from correlation hierarchy instead of inverting a noisy covariance matrix.
  • Tree clustering, quasi-diagonalization, and recursive bisection allocate risk between then within correlated groups.
  • HRP needs no return forecasts and tends to be more stable out-of-sample than Markowitz on ETF-scale universes.
  • It complements — not replaces — risk parity for small macro sleeves and alpha optimizers where IC is strong.
  • Re-fit dendrograms regularly; no static diversification survives a correlation regime shift.

Related reading