● Model Explainer

Model explainer — theory, significance, and formulas.

Each model's background and principle in plain language, so newcomers to finance can follow along, followed in each section by how DIVA Quantizer implements it and how to use it.

TOOL2016

Hierarchical Risk Parity (HRP)

Marcos López de Prado · Building Diversified Portfolios that Outperform Out of Sample (2016)

Optimize weights with Markowitz, and why do some holdings end up at 99% and others at 0%?

López de Prado traced the cause to the inverse of the covariance matrix and proposed grouping assets that move alike first, then splitting risk between the groups, with no inversion. DIVA follows the paper’s steps as published to compute HRP weights for your holdings, and shows how they and your risk compare with your current weights.

01 · Core idea

No inversion: group similar assets first.

THEORY

Run a Markowitz optimization in practice and, as holdings grow, you often get extreme weights, or results that swing on small changes in the data.

The cause is the inverse of the covariance matrix (Σ−1) inside the optimal-weight formula. With many holdings relative to the data length, that inverse becomes numerically unstable, and the instability shows up directly in the weights.

w ∝ Σ−1μ

HRP never inverts the matrix. It groups assets that move alike first, then splits risk between the groups.

DIVA

In DIVA, HRP is the model that suggests weights.

The same instability is why the Markowitz result does not recommend max-Sharpe weights. Instead, the HRP result offers recommended weights computed without any inversion.

The key metrics at the top of the result page show volatility and expected return for your current weights next to “Under HRP”, together with the HRP reallocation (the share of capital that would move) and the largest risk contribution (the share of risk carried by the riskiest holding).

The portfolio personality is set by how closely your current holdings move together, how unevenly risk is spread across them, and the diversification benefit of your current weights. It does not describe the portfolio HRP proposes.

DIVA screen · example portfolio
Top of the result page — portfolio personality · key metrics
●HRP · Portfolio personality

The Seasoned Orchestra노련한 오케스트라

Each asset contributes to the harmony, creating synergy in an ideal structure.

Key metrics
Annual σ
14.46%
Under HRP 13.21% (−1.25pp)
Expected μ
+17.46%
Under HRP +16.61%
HRP reallocation
15.3%
Share of total capital to reallocate
Largest risk contribution
34.6%
Current AAPL → HRP SPY 30.1%

Switching the example portfolio (AAPL · MSFT · SPY · GLD) to HRP weights moves 15.3% of capital and changes volatility from 14.46% to 13.21%. The personality “The Seasoned Orchestra” describes the risk structure of the current weights, not the HRP weights. This page uses the other model explainers’ example with TLT swapped for GLD. Depending on the portfolio, HRP may not improve volatility or Sharpe.

Co-movement is the average correlation weighted by current holdings (0.60 cut-off), risk concentration is the largest risk contribution as a multiple of an equal share (1.5×), and diversification is measured on current weights (15%); together they pick one of eight. These cut-offs are DIVA’s explanatory thresholds. (Example: average correlation 0.32 · AAPL 34.6% = 1.38× an equal share · diversification 28.8%)

02 · How does the theory group “similar” assets?

Turn correlation into distance, then merge the closest first.

THEORY

First, every pair’s correlation ρ becomes a distance. The more two assets move together (ρ → 1), the closer they are to 0; the more they move apart, the farther.

dij = √( ½ (1 − ρij) )

The paper then goes one step further. It lines up how far each holding is from every other holding as a column, and measures the distance between those columns — asking whether two holdings relate to the whole portfolio alike, not just to each other.

d̃ij = √( Σk (dki − dkj)2 )

Merging the two closest assets by d̃, then the next, builds a dendrogram. The distance between two groups is that of their closest pair (single linkage).

Lining the holdings up in the tree’s leaf order puts similar assets next to each other (quasi-diagonalization). The next step uses this order as is.

DIVA

DIVA draws your holdings’ tree in the Correlation Structure tab.

Holdings that merge first are effectively the same bet. Check that you are not holding overlapping names.

The size of each circle is its risk contribution. The larger the circle, the more of your portfolio’s risk that holding carries.

Switch to “HRP balanced portfolio” to compare how risk is redistributed under HRP weights.

DIVA screen · example portfolio
Result screen — Correlation Structure tab
Circle size · Risk contribution
0.000.250.500.751.01DISTANCE ↑d = 0.58d = 0.61d = 1.01GLD16.0%MSFT27.7%AAPL34.6%SPY21.7%

Circle area represents risk contribution. Dashed outlines and negative values indicate risk offsets.

The most correlated pair, AAPL–SPY (0.67), merges first; MSFT, then GLD join after. AAPL pairing with SPY before fellow big-tech MSFT fits the fact that AAPL is a large part of SPY. The circles show the largest risk share at AAPL 34.6% now and SPY 30.1% under HRP weights, so risk is less concentrated in one holding.

Merge heights (d̃) AAPL–SPY 0.58 · MSFT 0.61 · GLD 1.01; the lower the merge, the more alike they are. Horizontal spacing uses nonlinear emphasis. Read exact d values from the vertical height and numeric labels. Leaf order (the sorted list): GLD · MSFT · AAPL · SPY.

03 · What should you read the result against?

Weights that cut risk do not protect return.

THEORY

Split the sorted list in two, compare each half’s cluster variance, and give more weight to the lower-variance half. Repeat inside each half until every holding has a weight (recursive bisection). The cut is made at the middle of the sorted list, not along the tree’s branches, so a split can differ from the branches.

wL = 1 − VLVL + VR
wR = 1 − wL

Each step only compares two variances, so no inversion is needed and the result is stable. But expected return never enters the process. HRP is a way to split risk, not a way to raise return.

DIVA

DIVA sets current and HRP weights side by side, and shows how the weights were set.

The Metric comparison tab shows volatility, expected return, Sharpe and diversification for current / HRP / change on the same data window, so you see at once what risk HRP removed and what it cost.

The Weight compare tab shows each holding’s current and recommended weights, the How investment weights are determined tab walks through each bisection step, and the Rebalance Proposal lists the three largest differences.

DIVA screen · example portfolio
Result screen — Weight compare · Metric comparison tabs
Current weights
GLD30.0%
SPY25.0%
MSFT20.0%
AAPL25.0%
HRP recommended weights
GLD38.0%
SPY32.3%
MSFT17.1%
AAPL12.6%
MetricCurrentportfolioHRP optimalportfolioChange
HRP − Current
Annual volatility (σ)14.46%
13.21%
−1.25pp
Annual expected return17.46%
16.61%
−0.85pp
Efficiency (Sharpe)0.93
0.95
+0.02
Diversification28.8%
30.6%
+1.8pp

Comparisons use historical returns over the same analysis window. Sample length does not measure future predictive accuracy.

HRP raised GLD from 30.0% to 38.0%, cutting volatility from 14.46% to 13.21%. Expected return dips from 17.46% to 16.61%, but risk falls by more, so Sharpe rises from 0.93 to 0.95.

Step 1 split [GLD · MSFT] 55.1% : [AAPL · SPY] 44.9% — in the tree GLD joins last on its own, but cutting the list in the middle puts MSFT on GLD’s side · Rebalance Proposal top 3: AAPL −12.4pp · GLD +8.0pp · SPY +7.3pp

04 · How does DIVA run the calculation?

From the formula to real data

THEORY

The cluster variance compared in recursive bisection is the variance of the group’s holdings mixed in inverse proportion to their own variances (inverse-variance).

Vk = uT Σk u
ui ∝ 1 / σi2

So HRP runs on just correlation (to build the tree) and variance (to split weights).

DIVA

How DIVA sets each step

ρ · Σ
Estimated from monthly returns over the last 6 years, in the window all holdings share (min. 12 months, 2+ holdings), the same sample as Markowitz.
dij
Correlations become distances, and the tree is built from the Euclidean distance d̃ between distance columns, with single linkage, as in the paper.
wL
The sorted list is cut down the middle rather than along tree branches, as in the paper’s implementation (example step 1: [GLD · MSFT] : [AAPL · SPY]).
ui
Within each half, holdings are mixed in inverse proportion to their variance to get that half’s variance V.
Rf
The current 13-week US T-bill rate (^IRX) puts all three Sharpe ratios on one baseline, used site-wide (4.04% in the example).
Extra metrics
Reallocation = ½ Σ|HRP weight − current weight| (sells and buys not double-counted; costs and taxes excluded). Risk contribution = wᵢ(Σw)ᵢ / wᵀΣw, shown as is even when negative (an offset) or above 100%. Neither is a score from the paper; both are aids for reading the result.
Display
Monthly values are annualized — return ×12, volatility ×√12.
05 · So when is this model useful?

Moments when HRP helps

  1. 01
    Get a stable weighting baseline when you hold many names

    When the Markowitz result looks unstable, use the inversion-free recommended weights as a baseline.

  2. 02
    Spot overlapping bets

    Holdings that move together, such as an index ETF and its constituents, merge first in the dendrogram.

  3. 03
    Weigh assets of different kinds

    When mixing assets with very different volatility, such as stocks, bonds and gold, see weights split by risk.

  4. 04
    See how much to rebalance, and where to start

    The HRP reallocation shows how much capital would move, and the Rebalance Proposal lists the three holdings furthest from the recommended weights.

  5. 05
    Find where risk piles up

    The circle sizes in the correlation structure tree show which holding carries the most risk now.

To weigh expected return and efficiency too, compare with Markowitz. To see how much of the return came from the market, CAPM fits better; to see which risk factors it came from, a Fama–French model.

06 · Limitations

Reading the result with care

THEORY

HRP focuses on splitting risk well and does not actively pursue expected return, so it does not reach the points on the efficient frontier that Markowitz can in theory. The tree is also only meaningful if the correlations between assets stay fairly stable over time. HRP does not make every holding’s risk contribution equal, nor does it always lower volatility versus your current weights.

DIVA

DIVA presents HRP weights as a risk baseline, not as the answer.

Run the same portfolio through Markowitz as well to see what the risk HRP removed cost in efficiency (Sharpe).

Correlations are estimated over the analysis window (the last 6 years); when the shared data is under 36 months, the result page warns which holding shortened it.

HRP weights are a reference based on historical correlations and variances. Expected returns, trading costs, taxes and investor goals are not inputs to the allocation.

References
NEXT

Now apply the theory to your own portfolio.

Enter your holdings and amounts to see the Hierarchical Risk Parity analysis as real numbers.