Trading Dev AcademyFree quant education

Free lesson · Portfolio construction

Allocate risk, not just capital

Open interactive lessonPractice calculationsExplore labs

Start with the idea

Capital contribution and risk contribution are different. An asset with a small weight may dominate volatility if it is very volatile or strongly aligned with the book. A hedge can have a negative marginal risk contribution.

Symbols, units & horizon
  • w: signed capital weights
  • Σ: same-horizon covariance matrix
  • σ_p: positive portfolio volatility
  • (Σw)ᵢ: i-th entry of the covariance-times-weight vector
  • MRCᵢ: marginal volatility contribution per unit weight
  • RCᵢ: weight times marginal contribution
  • Lₜ: exposure multiplier
  • L_max: maximum permitted multiplier
  • σ_target: desired volatility
  • σ̂ₜ: forecast unscaled strategy volatility in matching units
  • min: choose the smaller value

When and why to use this

Use marginal risk when evaluating another trade and risk contributions when allocating across sleeves. Apply a capped volatility scale only after estimating the base book’s risk.

σp=w𝖳Σw,MRCi=(Σw)iσp,RCi=wiMRCi
Differentiation + Euler identity

Differentiate portfolio volatility

  1. Let v=wTΣw, so σp=√v. The chain rule gives ∂σp∂wi=(1(2σp))2(Σw)i.
  2. Multiply by wᵢ for RCᵢ. Summing gives ∑RCi=wTΣwσp=σp, assuming positive volatility.
Work it by hand

Equal weights and independent vols .1,.2 give σp=√.0125=.111803. Risk contributions are .022361 and .089443: 20% and 80% of total.

For positive portfolio volatility, Euler risk contributions satisfy ∑iRCi=σp. Marginal contribution measures how volatility changes with a small weight increase. A hedge can have a negative contribution. Equal capital weights do not produce equal risk contributions.

Lt=min⁡(Lmax⁡,σtargetσ^t)
Algebra and arithmetic

Solve for a volatility multiplier

  1. If the entire risky book is scaled by nonnegative L, variance becomes L²σ² and volatility Lσ. Setting that equal to the target gives L=σtargetσ^.
  2. Apply the maximum leverage bound by taking the smaller value. This calculation ignores any nonzero covariance of a funding or cash position.
Work it by hand

Target 8%, base estimate 12%, cap 1.5 gives L=.6667. An estimate of 4% would suggest L=2, clipped to 1.5.

Volatility targeting scales a base book using an estimate available before trading. Both volatilities must be annualised or both use the same shorter horizon. Apply leverage caps and liquidity limits; a low volatility estimate can otherwise create extreme leverage immediately before a shock.

Python implementation

Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.

import numpy as np  # dependency: numpy

def risk_contributions(weights, covariance):
    w, cov = np.asarray(weights), np.asarray(covariance)
    sigma = float(np.sqrt(w@cov@w))
    if sigma <= 0:
        raise ValueError("Positive portfolio volatility required")
    marginal = cov@w/sigma
    return sigma, marginal, w*marginal

def vol_multiplier(target_vol, forecast_vol, max_multiplier):
    if forecast_vol <= 0 or min(target_vol,max_multiplier) < 0:
        raise ValueError("Positive forecast, nonnegative target and cap required")
    return min(max_multiplier, target_vol/forecast_vol)

print(vol_multiplier(.10,.20,2))

Continue learning

Portfolio Construction & Factors — all lessons
  1. Separate alpha from compensated exposures
  2. Optimise under realistic constraints
  3. Allocate risk, not just capital
  4. Explain results and marginal diversification

Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations