The RiskModels Hierarchical Factor Model

Welcome to the methodology wiki. This page explains the math and intuition behind our three-level hierarchical factor model. Whether you're a portfolio manager trying to understand your exposures or a quant looking to replicate the analysis, this guide will walk you through the key concepts.


The Big Picture

What is a Hierarchical Factor Model?

A hierarchical factor model breaks down stock returns into layers of systematic risk, from broad to granular:

  1. Market (L1): How much does the overall market (S&P 500) explain?
  2. Sector (L2): How much additional variance comes from industry sectors (Tech, Financials, Healthcare, etc.)?
  3. Subsector (L3): How much comes from narrower industries within sectors (semiconductors, biotech, etc.)?
  4. Residual: What's left is idiosyncratic risk—the stock-specific component

At each level, the model produces three key metrics you'll see throughout the dashboard:

LabelNameWhat it tells you
HRHedge RatioHow many dollars of an ETF to trade per $1 of stock to neutralize that factor — the actionable output
ERExplained RiskWhat percentage of the stock's variance is explained by that factor — the diagnostic output
RRResidual RiskThe portion of variance not explained by factors at that level — the idiosyncratic remainder

These metrics are always qualified by level: L1 (Market), L2 (Sector), L3 (Subsector). So a dashboard column labeled L2 Sector HR is the hedge ratio for the sector ETF at level 2, L3 Subsector ER is the variance explained by the subsector factor, and L3 RR is whatever idiosyncratic risk remains after all three levels. The sections below walk through each concept in detail.

Why Three Levels?

Three levels capture the natural hierarchy of equity risk:

  • Too few levels (just market) miss important sectoral dynamics. A tech stock isn't just "the market + noise"—it has specific tech sector exposure.
  • Too many levels lead to overfitting and unstable estimates with limited data.
  • Three levels align with how institutional investors think: market timing, sector rotation, and stock selection.

The key insight: each level captures incremental explanatory power that isn't already explained by higher levels. This is achieved through orthogonalization—we residualize stock returns at each step to isolate the marginal effect.


The Three Levels: L1, L2, L3

The Cascade: Each Level's Residual Becomes the Next Level's Target

The core idea is simple: regress, take the residual, regress again. Each level strips out one more layer of systematic risk, and the leftover (ε\varepsilon) feeds into the next level as the new dependent variable.

StepRegressionWhat it capturesResidual
L1rstock=βmktrSPY+ε1r_{\text{stock}} = \beta_{\text{mkt}} \cdot r_{\text{SPY}} + \varepsilon_1Broad market exposureε1\varepsilon_1 = stock return with market stripped out
L2ε1=βsecrsector+ε2\varepsilon_1 = \beta_{\text{sec}} \cdot r_{\text{sector}} + \varepsilon_2Sector exposure (incremental to market)ε2\varepsilon_2 = stock return with market + sector stripped out
L3ε2=βsubrsubsector+ε3\varepsilon_2 = \beta_{\text{sub}} \cdot r_{\text{subsector}} + \varepsilon_3Subsector exposure (incremental to market + sector)ε3\varepsilon_3 = idiosyncratic / stock-specific return

Read the table left to right and top to bottom — that is the model.

Example: If NVDA has βmkt=1.3\beta_{\text{mkt}} = 1.3 and SPY returns +1%, we'd expect NVDA to move +1.3% from market exposure alone. Whatever is left over (ε1\varepsilon_1) gets passed to L2 to see how much is explained by the Tech sector (XLK). Whatever is left after that (ε2\varepsilon_2) gets passed to L3 for the semiconductor subsector (SOXX). The final residual ε3\varepsilon_3 is pure alpha.

Orthogonalization: Why We Clean the Factors

There's a subtlety: sector ETFs like XLK aren't independent of the market — XLK has its own market beta. If we used raw XLK returns at L2, we'd double-count the market exposure already captured at L1.

The fix: before regressing at each level, we orthogonalize (clean) the factor by stripping out higher-level exposures using link betas:

LevelWhat we cleanHow
L2Sector ETFRemove its market component: rsector=rsectorlinksecmktrSPYr_{\text{sector}}^{*} = r_{\text{sector}} - \text{link}_{\text{sec}\rightarrow\text{mkt}} \cdot r_{\text{SPY}}
L3Subsector ETFRemove both market and sector components: rsub=rsublinksubmktrSPYlinksubsecrsectorr_{\text{sub}}^{*} = r_{\text{sub}} - \text{link}_{\text{sub}\rightarrow\text{mkt}} \cdot r_{\text{SPY}} - \text{link}_{\text{sub}\rightarrow\text{sec}} \cdot r_{\text{sector}}^{*}

Here linkAB\text{link}_{A \rightarrow B} is just the beta of ETF A regressed on ETF B (or its cleaned version). These are precomputed from historical data.

This ensures each β\beta captures only the incremental effect of its own level — no double-counting.


Hedge Ratios: Making It Tradeable

What Are Hedge Ratios?

A Hedge Ratio (HR) tells you how many dollars of an ETF to trade per $1 of stock position to neutralize a specific factor exposure.

Sign convention:

HR SignActionMeaning
NegativeShort the ETFHedge out factor exposure
PositiveLong the ETFAdd factor exposure

The Challenge: Raw ETFs vs. Orthogonalized Factors

During estimation, we use orthogonalized sector and subsector returns to get clean incremental betas. But traders don't trade orthogonalized returns — they trade raw ETFs on Bloomberg terminals.

The solution: adjust the hedge ratios using link betas so they work directly with raw ETF prices.

L1 Hedge Ratios (Market Only)

At L1, it's straightforward — just hedge out the market beta:

HRL1,market=βmarket\mathrm{HR}_{\text{L1,market}} = -\beta_{\text{market}}

Example: If your stock has βmarket=1.2\beta_{\text{market}} = 1.2, short $1.20 of SPY per $1 long the stock.

L2 Hedge Ratios (Market + Sector)

At L2, we add sector exposure. But buying/shorting sector ETFs implicitly adds market exposure (because sector ETFs have their own market beta). So we adjust.

Sector HR — direct beta, same as L1 logic:

HRL2,sector=βsector\mathrm{HR}_{\text{L2,sector}} = -\beta_{\text{sector}}

Adjusted Market HR — subtract the market exposure embedded in the sector hedge:

HRL2,market=HRL1,market(βsector×linksecmkt)\mathrm{HR}_{\text{L2,market}} = \mathrm{HR}_{\text{L1,market}} - \sum\left(-\beta_{\text{sector}} \times \text{link}_{\text{sec}\rightarrow\text{mkt}}\right)

Why the adjustment? When you short the sector ETF (negative HRsector\mathrm{HR}_{\text{sector}}), you're also implicitly shorting the market. We reduce the direct market hedge to avoid double-hedging.

L3 Hedge Ratios (Market + Sector + Subsector)

At L3, we add subsector exposure and adjust for both market and sector exposure embedded in subsector ETFs.

Subsector HR — direct beta:

HRL3,subsector=βsubsector\mathrm{HR}_{\text{L3,subsector}} = -\beta_{\text{subsector}}

Adjusted Sector HR — subtract the sector exposure embedded in the subsector hedge:

HRL3,sector=HRL2,sector(βsubsector×linksubsec)\mathrm{HR}_{\text{L3,sector}} = \mathrm{HR}_{\text{L2,sector}} - \sum\left(-\beta_{\text{subsector}} \times \text{link}_{\text{sub}\rightarrow\text{sec}}\right)

Adjusted Market HR — subtract the market exposure embedded in the subsector hedge:

HRL3,market=HRL2,market(βsubsector×linksubmkt)\mathrm{HR}_{\text{L3,market}} = \mathrm{HR}_{\text{L2,market}} - \sum\left(-\beta_{\text{subsector}} \times \text{link}_{\text{sub}\rightarrow\text{mkt}}\right)

Internal consistency check: These adjusted HRs, applied to raw ETF returns, satisfy the replication identity — i.e., the decomposition into factor contributions plus residual reconciles back to the actual stock return. This is verified at runtime for every stock, every date. Note: this is a reconciliation check, not a claim about hedge performance. The betas themselves are noisy estimates from rolling regressions.


Explained Risk: Variance Decomposition

What Is Explained Risk (ER)?

Explained Risk measures what percentage of a stock's return variance comes from factor exposures vs. idiosyncratic noise.

ER=1Var(ε)Var(rstock)ER = 1 - \frac{\text{Var}(\varepsilon)}{\text{Var}(r_{\text{stock}})}

Or equivalently, it's the R2R^2 from your factor regression.

The Additive Property

Because we use orthogonalized factors, the ERs from each level add up perfectly:

ERL1,market+ERL2,sector+ERL3,subsector+RRresidual=1.0ER_{\text{L1,market}} + ER_{\text{L2,sector}} + ER_{\text{L3,subsector}} + RR_{\text{residual}} = 1.0

This is guaranteed by construction — the ER components must sum to 1.0 as a mathematical identity. At runtime, we verify the reconciliation holds to within 0.1% as a data-integrity check.

Calculating ER at Each Level

We build replicating portfolios using orthogonalized returns:

repL1=βmarket×rmarket\text{rep}_{\text{L1}} = \beta_{\text{market}} \times r_{\text{market}}

repL2=repL1+βsector×rsector\text{rep}_{\text{L2}} = \text{rep}_{\text{L1}} + \beta_{\text{sector}} \times r_{\text{sector}}^{\perp}

repL3=repL2+βsubsector×rsub\text{rep}_{\text{L3}} = \text{rep}_{\text{L2}} + \beta_{\text{subsector}} \times r_{\text{sub}}^{\perp}

Then compute:

ERL1=1Var(rstockrepL1)Var(rstock)ER_{\text{L1}} = 1 - \frac{\text{Var}(r_{\text{stock}} - \text{rep}_{\text{L1}})}{\text{Var}(r_{\text{stock}})}

ERL2,incr=ERL2ERL1ER_{\text{L2,incr}} = ER_{\text{L2}} - ER_{\text{L1}}

ERL3,incr=ERL3ERL2ER_{\text{L3,incr}} = ER_{\text{L3}} - ER_{\text{L2}}

RRresidual=1ERL3RR_{\text{residual}} = 1 - ER_{\text{L3}}

Interpretation

  • High ER (e.g., 85%+): The stock is "a leveraged sector bet"—mostly systematic risk.
  • Low ER (e.g., <50%): High idiosyncratic risk—more alpha opportunity or diversifiable risk.
  • Sector vs. Market: If ERL2,sector>ERL1,marketER_{\text{L2,sector}} > ER_{\text{L1,market}}, sector dynamics dominate market timing.

Putting It All Together: The Replication Equation

The Core Identity

The ERM3 model lets us perfectly decompose any stock's return using only raw ETF returns — no orthogonalization required:

rstock=i(Hi×rETFi)+εr_{\text{stock}} = \sum_{i} \left(H_i \times r_{\text{ETF}_i}\right) + \varepsilon

SymbolDescription
HiH_iHedge ratio (exposure) to ETF ii
\sumSum over market + sector + subsector ETFs
rETFir_{\text{ETF}_i}Raw total return of the ETF (NOT residualized / orthogonalized)
ε\varepsilonResidual idiosyncratic return (very small by construction)

This is a mathematical identity — by construction, the hedge-ratio-weighted ETF returns plus the residual must equal the stock return. At runtime, we verify this reconciliation holds to within 0.1% for every stock on every date as a data-integrity check. If it doesn't balance, something is wrong with the input data or computation — not the math. This says nothing about the predictive accuracy of the betas or hedges themselves, which are noisy estimates from rolling regressions.

Why This Matters

This equation is the heart of tradability.

It means you can hedge almost any individual stock — or an entire portfolio — using only highly liquid ETFs, with hedge ratios that are economically meaningful and stable over time.

No custom baskets. No exotic derivatives. Just SPY, sector ETFs, and subsector ETFs.


Worked Example: Walmart (WMT)

Step 1 — Raw Regression Betas

Direct regressions on raw ETF returns yield:

ParameterETFValue
βmarket\beta_{\text{market}}SPY0.50
βsector\beta_{\text{sector}}XLP (Consumer Staples)0.30
βsubsector\beta_{\text{subsector}}PBJ (Food & Beverage)0.20

Step 2 — Link Betas

Historical average betas between ETFs at different levels:

RelationshipMeaningValue
XLP → SPYConsumer Staples' market beta0.60
PBJ → SPYFood & Beverage's market beta0.40
PBJ → XLPFood & Beverage's sector beta0.70

Step 3 — Build Hedge Ratios (Bottom-Up: L3 → L2 → L1)

Start from the most granular level and work upward.

L3 — Subsector (PBJ — Food & Beverage)

HRsubsector=βsubsector=0.20\mathrm{HR}_{\text{subsector}} = -\beta_{\text{subsector}} = \mathbf{-0.20}

L2 — Sector (XLP — Consumer Staples)

HRsector=βsector(HRsubsector×linkPBJXLP)\mathrm{HR}_{\text{sector}} = -\beta_{\text{sector}} - \left(\mathrm{HR}_{\text{subsector}} \times \text{link}_{\text{PBJ}\rightarrow\text{XLP}}\right)

=0.30(0.20×0.70)=0.30+0.14=0.16= -0.30 - (-0.20 \times 0.70) = -0.30 + 0.14 = \mathbf{-0.16}

L1 — Market (SPY)

HRmarket=βmarket(HRsector×linkXLPSPY)(HRsubsector×linkPBJSPY)\mathrm{HR}_{\text{market}} = -\beta_{\text{market}} - \left(\mathrm{HR}_{\text{sector}} \times \text{link}_{\text{XLP}\rightarrow\text{SPY}}\right) - \left(\mathrm{HR}_{\text{subsector}} \times \text{link}_{\text{PBJ}\rightarrow\text{SPY}}\right)

=0.50(0.16×0.60)(0.20×0.40)= -0.50 - (-0.16 \times 0.60) - (-0.20 \times 0.40)

=0.50+0.096+0.08=0.324= -0.50 + 0.096 + 0.08 = \mathbf{-0.324}

Final Hedge Ratios — Summary

LevelETFDescriptionDirect BetaLink AdjustmentFinal HR
L1 MarketSPYBroad Market0.50+0.096 +0.08−0.324
L2 SectorXLPConsumer Staples0.30+0.14−0.16
L3 SubsectorPBJFood & Beverage0.20−0.20

Verification — Sample Day

Suppose the following returns on a given day:

InstrumentReturn
SPY+1.00%
XLP+0.80%
PBJ+1.20%
WMT+1.10%

Factor contribution (hedge ratios × raw ETF returns):

(0.324)(1.00%)+(0.16)(0.80%)+(0.20)(1.20%)(-0.324)(1.00\%) + (-0.16)(0.80\%) + (-0.20)(1.20\%)

=0.324%0.128%0.240%=0.692%= -0.324\% - 0.128\% - 0.240\% = -0.692\%

Residual (alpha):

ε=1.10%0.692%=+0.408%\varepsilon = 1.10\% - 0.692\% = +0.408\%

This +0.408% is pure stock-specific return — the idiosyncratic alpha after neutralizing all factor exposures.


Key Takeaways

  1. Exact decomposition identity — hedge-ratio-weighted ETF returns plus residual reconcile back to the stock return (no orthogonalized factors needed for trading)
  2. Hedge ratios built bottom-up — most granular level first, then adjust upward via link betas
  3. Runtime reconciliation verifies the decomposition identity balances to within 0.1% — a data-integrity check, not a hedge-accuracy claim
  4. All hedge instruments are highly liquid ETFs — executable on any brokerage platform

This is what makes the model practically tradable for hedging, risk attribution, and relative value strategies.


Why This Matters for Trading

Direct Hedging

Unlike academic factor models that output abstract "factor loadings," our model gives you actionable hedge ratios that work with liquid ETFs you can trade on any brokerage platform.

Tax-Efficient Risk Scaling

Want to reduce your portfolio's tech exposure without selling NVDA and triggering capital gains? Short XLK proportionally. The adjusted hedge ratios ensure you're not accidentally double-hedging the market.

Risk Decomposition for Due Diligence

Before buying a "diversified" mutual fund, check its L3 decomposition. If 80% of its ER comes from the market, you're paying active management fees for passive beta.

Alpha Measurement

The residual (ε3\varepsilon_3) at L3 is your true idiosyncratic return. Positive residuals over time = alpha. Negative = underperformance that can't be blamed on "the market was down."


How We Compare to Traditional Risk Models

RiskModels is built for tactical hedging and active trading using liquid ETFs. Traditional vendors (e.g., Barra, Axioma) focus on institutional reporting and broad factor coverage. The table below summarizes the main differences.

FeatureRiskModels (Hierarchical ETF Model)Traditional Models (Barra / Axioma)
Factor CompositionDirectly tradeable: uses liquid ETFs (e.g., SPY, XLK) as the primary factors for L1–L3.Abstract composites: factors are often "synthetic" (e.g., Value, Momentum, or PCA-derived statistical factors).
Hedging ExecutionImmediate: neutralizing a sector risk is as simple as shorting the corresponding ETF.Complex: requires building custom "factor-mimicking baskets" or using proxy trades, which increases slippage.
Model StructureHierarchical and orthogonal: each level (Market → Sector → Subsector) isolates incremental risk via residualization.Multivariate and broad: often covers hundreds of fundamental and regional factors simultaneously across asset classes.
ResponsivenessTactical: generally uses shorter lookback windows, making it highly responsive to sudden market shifts.Structural: incorporates longer histories and fundamental data, prioritizing long-term stability over short-term agility.
Primary Use CaseActive trading: ideal for hedge funds and tactical PMs needing fast, precise hedging.Institutional reporting: best for large-scale risk management and long-term performance attribution.

Glossary: Quick Reference

TermDefinition
L1 (Market)First level capturing broad market (SPY) exposure
L2 (Sector)Second level capturing sector-specific exposure (e.g., XLK, XLF)
L3 (Subsector)Third level capturing granular industry exposure (e.g., SOXX, XBI)
Beta (β)Sensitivity coefficient: β=Cov(rstock,rfactor)/Var(rfactor)\beta = \text{Cov}(r_{\text{stock}}, r_{\text{factor}}) / \text{Var}(r_{\text{factor}})
Hedge Ratio (HR)Dollar amount of ETF to trade per $1 of stock to neutralize factor exposure
Explained Risk (ER)Percentage of variance explained by factors: ER=1Var(ε)/Var(r)ER = 1 - \text{Var}(\varepsilon) / \text{Var}(r)
Link BetaBeta relationship between ETFs at different levels (e.g., sector ETF's market beta)
OrthogonalizationRemoving higher-level exposure from lower-level factors: r=rlinkrparentr^{\perp} = r - \text{link} \cdot r_{\text{parent}}
Residual (ε)Idiosyncratic return not explained by any factor—stock-specific alpha
Replication Equationrstock=(HRi×rETFi)+εr_{\text{stock}} = \sum (\mathrm{HR}_i \times r_{\text{ETF}_i}) + \varepsilon

Why This Matters for Trading

Direct Hedging

Unlike academic factor models that output abstract "factor loadings," our model gives you actionable hedge ratios that work with liquid ETFs you can trade on any brokerage platform.

Tax-Efficient Risk Scaling

Want to reduce your portfolio's tech exposure without selling NVDA and triggering capital gains? Short XLK proportionally. The adjusted hedge ratios ensure you're not accidentally double-hedging the market.

Risk Decomposition for Due Diligence

Before buying a "diversified" mutual fund, check its L3 decomposition. If 80% of its ER comes from the market, you're paying active management fees for passive beta.

Alpha Measurement

The residual (ε3\varepsilon_3) at L3 is your true idiosyncratic return. Positive residuals over time = alpha. Negative = underperformance that can't be blamed on "the market was down."


Additional Resources

  • Interactive Demo: Try the model on 16,495 tickers at riskmodels.net
  • How It Works: Visual walkthrough at /how-it-works
  • Technical Paper: Contact us for the full methodology whitepaper

Last updated: February 2026

Next Steps

Ready to see the model in action? Try our interactive demo with 16,495 tickers, or dive into the visual walkthrough to see how we decompose risk in real-time.