Basic Prerequisites: 03 · Hierarchical Clustering and Risk Parity & ERC.


1. Intuition & Practical Objective

The tree gives us an ordering of the assets. Recursive bisection turns that ordering into weights. The rule is one line and worth memorizing: at every fork, give the two branches capital inversely proportional to their risk.

Concretely: take the quasi-diagonalized list of assets. Split it in half. Compute how risky each half is as a small portfolio (inverse-variance weighted). The riskier half receives less capital. Recurse into each half until every cluster is a single asset. The final weight of an asset is the product of the split fractions along its path from the root.

Three properties make this the right choice:

  • It never inverts . The only matrix operations are on sub-blocks and one quadratic form per node - bounded, diagonal, and always defined.
  • It allocates by structure, not size. A cluster of five highly-correlated equities competes against a cluster of two bonds as a unit; the equities cannot each claim an equal dollar because they are near-duplicates.
  • It is not ERC. Within a node, HRP uses the inverse-variance portfolio’s variance; ERC would equalize total risk contributions. HRP equalizes risk across clusters, and only approximately within them. Conflating the two is the most common HRP misconception.

The one-sentence essence. “Split the budget between two clusters inversely to their sub-portfolio variances, recurse, and multiply - the covariance’s block structure, read top-down, becomes the weight vector.”


2. Mathematical Ground Truth & Derivations

Setup. Let the quasi-diagonal order be and write the root cluster with budget .

Node rule. For a cluster with budget , split it into contiguous halves . Let

be the inverse-variance (naive risk-parity) weights and portfolio variance of that sub-block. Then allocate

The riskier half ( larger) gets the smaller fraction - inverse variance, exactly the two-asset ERC solution when (see Risk Parity & ERC, where for independent assets).

Final weights. Recurse to singletons; the weight of asset is the product of the ‘s on its root-to-leaf path:

Why this is not ERC. ERC finds such that is equal for all - a global fixed point requiring the full covariance. HRP never computes risk contributions at all; it decomposes the allocation into independent local decisions. The two coincide for and diverge for (a structural, not incidental, difference).

Properties. HRP is a homogeneous allocator (scale leaves unchanged, since every and the ratio is invariant), it is long-only ( always), and fully invested ( by induction). These follow directly from the recursion and are why HRP never produces the gross-exposure explosion of §02.


3. Computational Implementation - HRP on the 8-asset universe, traced

Runs on numpy. The universe is three economically-distinct blocks (3 equity, 2 rates, 3 commodity); we trace the bisection, print the quasi-diagonalized correlation matrix, and compare HRP to ERC, , and global minimum variance.

The bisection, traced. The leaf order is [BD1, BD2, EQ3, EQ1, EQ2, CM3, CM1, CM2] (indices [3,4,2,0,1,7,5,6]), and the recursion executes:

Read the trace: the low-variance block {BD1,BD2,EQ3,EQ1} (var ) takes - 85.6% of the capital - versus the higher-variance block {EQ2,CM3,CM1,CM2} (var ). And within the first block, the bond pair {BD1,BD2} (var ) takes of its parent’s budget from the equity slice {EQ3,EQ1} (var ). The product of the path alphas gives BD1 and CM2 - matching the table. The weights are literally products of local inverse-variance decisions.

Comparison. On this universe the volatility ordering is

HRP lands between the unconstrained optimum and ERC, and beats by a wide margin. Note the shape of the HRP solution: it is long-only, gross , and it gives the bond block 74.9% of assets’ dollars () - because bonds are the lowest-variance diversifiers, HRP loads them, exactly as risk parity does. Note also that HRP ERC: ERC gives the bond block of capital and spreads the rest across equities ( each) and commodities ( each) - a genuinely equal-risk print - while HRP concentrates 74.9% in the bond block () and starves the commodity block ( total), because its splits used the naive-RP sub-portfolio variance rather than equalizing risk contributions. GMV, by contrast, shorts EQ2 () - a signal that even on a well-conditioned matrix the unconstrained optimizer reaches for a short the risk-based allocators never take.


4. Failure Modes & First-Principles Breakdowns

  1. The halves are arbitrary. Recursive bisection splits contiguous halves by list position, so a cluster of assets is split unevenly (the extra asset joins the first half). This is a convention, not an optimum: a slightly different tree can move an asset across a split boundary and change its weight. Average-linkage + high cophenetic correlation minimizes this.
  2. Naive-RP within clusters is not risk parity. Using means the cluster risk is that of an inverse-variance portfolio, which ignores intra-cluster correlations. A cluster of two -correlated assets is treated as more diversified than it is. HERC (06) fixes this by using ERC within clusters.
  3. HRP still needs a trustworthy diagonal. Although it avoids the inverse, its split factors read directly; a bad variance estimate for one asset skews every split it participates in. Denoise/shrink first.
  4. No return information. Like all risk-based allocators, HRP is silent on expected returns. Its beautiful bond allocation is a risk statement; if bonds are expected to lose to inflation it is the wrong portfolio. Layer views via Black–Litterman rather than “fixing” HRP.
  5. Transaction costs scale with tree instability. The tree is rebuilt from rolling windows; if the tree reshuffles, weights reshuffle and turnover spikes. Sweep window length and smooth the tree (→ Transaction Costs & Turnover).

5. References

  • López de Prado, M. (2016). “Building Diversified Portfolios that Outperform Out of Sample.” J. Portfolio Management 42(4):59–69
  • López de Prado, M. (2018). Advances in Financial Machine Learning
  • Maillard, Roncalli & Teïletche (2010). “The Properties of Equally Weighted Risk Contribution Portfolios.” J. Portfolio Management 36(4):60–70
  • Qian, E. (2005). Risk Parity Portfolios: Efficient Portfolios Through True Diversification, PanAgora

6. Connected Graph Bridges