Skip to content
LeetQuant
QR10 Portfolio Construction and Risk

QR10 · Portfolio Construction and Risk · Lesson 4 of 5

Risk Attribution

Marginal and component contributions to portfolio volatility, the Euler decomposition that makes them sum to the total, factor versus specific risk, and what attribution says about optimal and risk-parity portfolios.

16 min

Objective

A risk manager's first question about a book is "where does the risk come from?". Weights do not answer it: a 20% position in a volatile, correlated asset can carry most of the risk, and a hedge can carry negative risk. By the end you should be able to compute marginal and component risk contributions, prove they add up to the total, split risk into factor and specific parts, and use the decomposition to read off optimality conditions.

Marginal contribution to risk

Portfolio volatility is σp(w)=w⊤Σw\sigma_p(w) = \sqrt{w^\top\Sigma w}. Its gradient is

MCRi=∂σp∂wi=(Σw)iσp.\text{MCR}_i = \frac{\partial\sigma_p}{\partial w_i} = \frac{(\Sigma w)_i}{\sigma_p} .

MCRi\text{MCR}_i is how much volatility rises per unit of extra weight in asset ii (unfunded: other weights held fixed). Since (Σw)i=Cov⁡(ri,rp)(\Sigma w)_i = \operatorname{Cov}(r_i, r_p), two equivalent forms are useful:

MCRi=Cov⁡(ri,rp)σp=ρi,p σi=βi,p σp,\text{MCR}_i = \frac{\operatorname{Cov}(r_i, r_p)}{\sigma_p} = \rho_{i,p}\,\sigma_i = \beta_{i,p}\,\sigma_p ,

where βi,p\beta_{i,p} is asset ii's beta to the portfolio. An asset negatively correlated with the portfolio has a negative MCR: adding to it lowers risk.

Component contributions and the Euler decomposition

Define the component contribution CCRi=wi MCRi\text{CCR}_i = w_i\,\text{MCR}_i. Then

∑iCCRi=w⊤Σwσp=σp.\sum_i \text{CCR}_i = \frac{w^\top\Sigma w}{\sigma_p} = \sigma_p .

This is not a coincidence of the quadratic form. Volatility is homogeneous of degree one: σp(cw)=c σp(w)\sigma_p(cw) = c\,\sigma_p(w). For any such function, Euler's theorem gives f(w)=∑iwi ∂f/∂wif(w) = \sum_i w_i\,\partial f/\partial w_i. The same holds for VaR and expected shortfall (also degree one), so they decompose the same way. Variance is degree two, so ∑iwi ∂(σ2)/∂wi=2σ2\sum_i w_i\,\partial(\sigma^2)/\partial w_i = 2\sigma^2, which is why contributions to variance are usually written wi(Σw)iw_i(\Sigma w)_i without the derivative.

The percentage contribution CCRi/σp=wi(Σw)i/(w⊤Σw)\text{CCR}_i/\sigma_p = w_i(\Sigma w)_i/(w^\top\Sigma w) sums to 100%, and individual terms can be negative or exceed 100%.

Two cautions. The decomposition is local: it tells you the effect of small changes, not what happens if you remove a position entirely. And it is one of many ways to split a non-additive quantity; Euler's is preferred because it is the only one consistent with marginal changes.

Worked example

a three-asset book

A portfolio holds 60% equities (vol 16%), 20% credit (vol 8%) and 20% government bonds (vol 6%). Correlations: equity–credit 0.6, equity–bonds −0.3-0.3, credit–bonds 0.2. Compute the portfolio volatility, each asset's MCR and CCR, and the percentage contributions. Then estimate the effect of moving 1% of weight from equities to bonds.

Show solution

Covariances: σEC=0.6×0.16×0.08=0.00768\sigma_{EC} = 0.6 \times 0.16 \times 0.08 = 0.00768, σEB=−0.3×0.16×0.06=−0.00288\sigma_{EB} = -0.3 \times 0.16 \times 0.06 = -0.00288, σCB=0.2×0.08×0.06=0.00096\sigma_{CB} = 0.2 \times 0.08 \times 0.06 = 0.00096; variances 0.02560.0256, 0.00640.0064, 0.00360.0036.

Σw=(0.6(0.0256)+0.2(0.00768)+0.2(−0.00288)0.6(0.00768)+0.2(0.0064)+0.2(0.00096)0.6(−0.00288)+0.2(0.00096)+0.2(0.0036))=(0.016320.00608−0.000816).\Sigma w = \begin{pmatrix} 0.6(0.0256) + 0.2(0.00768) + 0.2(-0.00288) \\ 0.6(0.00768) + 0.2(0.0064) + 0.2(0.00096) \\ 0.6(-0.00288) + 0.2(0.00096) + 0.2(0.0036) \end{pmatrix} = \begin{pmatrix} 0.01632 \\ 0.00608 \\ -0.000816 \end{pmatrix} .

w⊤Σw=0.6(0.01632)+0.2(0.00608)+0.2(−0.000816)=0.0108448w^\top\Sigma w = 0.6(0.01632) + 0.2(0.00608) + 0.2(-0.000816) = 0.0108448, so σp≈10.41%\sigma_p \approx 10.41\%.

WeightMCR =(Σw)i/σp= (\Sigma w)_i/\sigma_pCCR =wi MCRi= w_i\,\text{MCR}_iShare of risk
Equities60%0.15670.094090.3%
Credit20%0.05840.011711.2%
Bonds20%−0.0078-0.0078−0.0016-0.0016−1.5%-1.5\%
Total0.1041100%

The CCRs sum to σp\sigma_p, as Euler requires. Equities are 60% of the capital and 90% of the risk; bonds are a net hedge. As a cross-check, the equity row equals w ρE,p σEw\,\rho_{E,p}\,\sigma_E with ρE,p=0.01632/(0.16×0.1041)≈0.979\rho_{E,p} = 0.01632/(0.16 \times 0.1041) \approx 0.979: 0.6×0.979×0.16≈0.09400.6 \times 0.979 \times 0.16 \approx 0.0940.

Moving 1% from equities to bonds changes volatility by about

0.01×(MCRB−MCRE)=0.01×(−0.0078−0.1567)≈−0.16%,0.01 \times (\text{MCR}_B - \text{MCR}_E) = 0.01 \times (-0.0078 - 0.1567) \approx -0.16\% ,

to about 10.25%10.25\%. The exact figure for weights (0.59, 0.20, 0.21)(0.59,\ 0.20,\ 0.21) is 10.250%10.250\%.

What attribution says about optimal portfolios

The decomposition turns optimality conditions into statements about contributions.

  • Minimum variance. The first-order condition Σw=λ1\Sigma w = \lambda\mathbf 1 means every asset held has the same MCR, and that common value is σmin⁡\sigma_{\min} itself (multiply by w⊤w^\top). So each asset's share of risk equals its weight.
  • Maximum Sharpe (tangency). Here Σw∝μ\Sigma w \propto \mu, which gives μi=SRp MCRi\mu_i = \text{SR}_p\,\text{MCR}_i for every asset: each asset's excess return per unit of marginal risk equals the portfolio Sharpe ratio. If one asset offers more return per unit of marginal risk, buy more of it. Read backwards, this is reverse optimisation: if the three-asset book above were optimal with SRp=0.5\text{SR}_p = 0.5, its implied excess returns would be 0.5×MCR0.5 \times \text{MCR}: 7.8% for equities, 2.9% for credit and −0.4%-0.4\% for bonds.
  • Risk parity. Choose weights so every CCR is equal. For two assets this gives weights proportional to 1/σi1/\sigma_i whatever the correlation, because w1(Σw)1=w2(Σw)2w_1(\Sigma w)_1 = w_2(\Sigma w)_2 reduces to w12σ12=w22σ22w_1^2\sigma_1^2 = w_2^2\sigma_2^2 (the cross terms are identical). With more assets correlations matter and it is solved numerically.

Factor versus specific risk

With a factor model r=Bf+εr = Bf + \varepsilon, the portfolio's factor exposures are x=B⊤wx = B^\top w and

σp2=x⊤Σf x⏟factor+∑iwi2si2⏟specific.\sigma_p^2 = \underbrace{x^\top\Sigma_f\,x}_{\text{factor}} + \underbrace{\textstyle\sum_i w_i^2 s_i^2}_{\text{specific}} .

The variances add because specific returns are uncorrelated with the factors and with each other. Within the factor part, the Euler decomposition applied to xx gives each factor's contribution xk(Σfx)k/σpx_k(\Sigma_f x)_k/\sigma_p.

The key scaling: specific variance falls like 1/n1/n as you spread across nn names, factor variance does not diversify away at all. A long-only portfolio of 20 or more stocks is mostly market risk; a market-neutral book is mostly specific risk plus whatever style factors were left unhedged.

Worked example

how much of a stock portfolio is market risk?

An equally weighted portfolio holds 20 stocks, each with market beta 1 and specific volatility 30%. Market volatility is 16%. Split the portfolio variance into market and specific parts, and find the volatility left after hedging the market with index futures.

Show solution

Portfolio beta is ∑iwiβi=1\sum_i w_i\beta_i = 1, so the factor variance is 12×0.162=0.02561^2 \times 0.16^2 = 0.0256.

Specific variance is ∑iwi2si2=20×0.052×0.09=0.0045\sum_i w_i^2 s_i^2 = 20 \times 0.05^2 \times 0.09 = 0.0045.

Total variance 0.03010.0301, volatility 17.35%17.35\%. The market accounts for 0.0256/0.0301≈85%0.0256/0.0301 \approx 85\% of the variance; 20 stocks is plenty to make a portfolio "the market".

Hedging to zero beta removes the factor term and leaves 0.0045≈6.7%\sqrt{0.0045} \approx 6.7\% volatility: the stock-picking bet. By symmetry each stock's CCR is 17.35%/20≈0.87%17.35\%/20 \approx 0.87\%, but after hedging the attribution question becomes "which names dominate the specific risk?", which here is again equal.

Knowledge check

A portfolio is 50% in asset A (vol 10%) and 50% in asset B (vol 20%); they are uncorrelated. What share of the portfolio's risk comes from B?

Knowledge check

Two assets have volatilities 10% and 30% and correlation 0.5. What weights give a risk-parity (equal risk contribution) portfolio?

Knowledge check

At the unconstrained minimum-variance portfolio, how does each asset's percentage contribution to risk compare with its weight?

Key takeaways

  • MCRi=(Σw)i/σp=ρi,pσi\text{MCR}_i = (\Sigma w)_i/\sigma_p = \rho_{i,p}\sigma_i; CCRi=wi MCRi\text{CCR}_i = w_i\,\text{MCR}_i; the CCRs sum to σp\sigma_p by Euler's theorem because volatility is homogeneous of degree one.
  • Contributions can be negative (hedges) or exceed 100%; they are local, valid for small changes.
  • Minimum variance: equal MCRs and risk shares equal to weights. Tangency: μi/MCRi=SRp\mu_i/\text{MCR}_i = \text{SR}_p for every asset. Risk parity: equal CCRs, weights ∝1/σi\propto 1/\sigma_i for two assets.
  • Factor variance x⊤Σfxx^\top\Sigma_f x does not diversify; specific variance ∑wi2si2\sum w_i^2 s_i^2 falls like 1/n1/n.

Practice problems

Finished reading?

Answer the 3 knowledge checks to complete this lesson (0 done).