Skip to main content

Portfolio Variance in Matrix Form

IntermediateQuantitative FinanceAlso known as: linear algebra, covariance matrix, w transpose sigma w, n asset portfolio risk

Finds: the risk of a portfolio of any number of assets.

When to use it: Use it for portfolios of any number of assets. The two-asset formula is the special case. The matrix form is how optimizers and risk systems compute portfolio risk. Each weight pair contributes a term, so correlations between all pairs matter.

The formula

σp2\displaystyle \sigma_{p}^{2}=w⊤Σ w=∑i∑jwiwjσiσjρij\displaystyle =\mathbf{w}^{\top}\Sigma\,\mathbf{w}=\sum_{i}\sum_{j}w_{i}w_{j}\sigma_{i}\sigma_{j}\rho_{ij}

In words: Portfolio variance = w-transpose x Covariance matrix x w = sum over all pairs i, j of (w_i x w_j x sd_i x sd_j x correlation_ij)

What each symbol means

wVector of portfolio weightspercent
SigmaCovariance matrix: variances on the diagonal and covariances off itnumber
sigma_iStandard deviation of asset iper year
rho_ijCorrelation between assets i and jnumber

Worked example

A portfolio holds 40%, 35% and 25% in three assets with volatilities of 18%, 12% and 25%. The correlations are 0.3 (assets 1 and 2), 0.1 (1 and 3) and 0.4 (2 and 3).

Covariance matrix (row by row)0.0324, 0.0065, 0.0045, 0.0065, 0.0144, 0.0120, 0.0045, 0.0120, 0.0625
Portfolio variance0.01567
Portfolio volatilitysqrt(var)12.52%
Weighted average of volatilities17.65%
Risk removed by diversification0.1765 − 0.1251745.13%
The answer

The portfolio variance is 0.01567, so its volatility is 12.52%. The weighted average of the three volatilities is 17.65%, so diversification removes 5.13% of risk.

Want every formula on a few pages?Get the free Cheat Sheet (PDF) →

Calculator

Portfolio variance0.01567
Portfolio volatility12.52%
Risk removed by diversification5.13%

Keep going