Portfolio Variance in Matrix Form
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
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
| w | Vector of portfolio weights | percent |
| Sigma | Covariance matrix: variances on the diagonal and covariances off it | number |
| sigma_i | Standard deviation of asset i | per year |
| rho_ij | Correlation between assets i and j | number |
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 variance | 0.01567 | |
| Portfolio volatility | sqrt(var) | 12.52% |
| Weighted average of volatilities | 17.65% | |
| Risk removed by diversification | 0.1765 − 0.125174 | 5.13% |
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.