Skip to content

N-Asset Portfolio Variance

N-Asset Portfolio Variance

Variance of a portfolio of any number of assets from a weight vector and a covariance matrix: wᵀΣw. Enter the matrix row by row; the diagonal holds each asset's variance and the off-diagonal entries the pairwise covariances.

When to use: Use when you have an estimated covariance matrix, which is how portfolio risk is computed in practice. For two or three assets with volatilities and correlations, the closed-form siblings are easier to fill in.

Calculator

Formula

σp2=wTΣw=ijwiwjΣij\sigma_p^2 = \mathbf{w}^{\mathsf{T}} \Sigma \mathbf{w} = \sum_i \sum_j w_i w_j \Sigma_{ij}

Variables

SymbolNameDescriptionUnit
PortVarPortfolio VarianceVariance of a 2-asset portfolio return as a decimal²variance
WeightsPortfolio WeightsFraction in each asset, in order, summing to 1%
CovMatrixCovariance MatrixThe n × n covariance matrix flattened row by row (n² values)variance

Real-Life Examples

Example 1: Two Assets via the Matrix

Weights 0.6 and 0.4. Variances 0.0324 and 0.0036, covariance 0.00216 (that is, volatilities 18% and 6% at correlation 0.2).

Given

Weights = [0.6, 0.4]CovMatrix = [0.0324, 0.00216, 0.00216, 0.0036]

Step-by-Step

1.σ_p² = 0.6²×0.0324 + 0.4²×0.0036 + 2×0.6×0.4×0.00216
2.σ_p² = 0.011664 + 0.000576 + 0.0010368
3.σ_p² = 0.01327680
Result:0.01327680 (return²)

Identical to the two-asset closed form with the same inputs, which is the point: the matrix form generalises it to any number of holdings.

Example 2: Three Assets

Weights 0.5, 0.3, 0.2 with the covariance matrix [0.04, 0.006, 0.01; 0.006, 0.0225, 0.003; 0.01, 0.003, 0.09].

Given

Weights = [0.5, 0.3, 0.2]CovMatrix = [0.04, 0.006, 0.01, 0.006, 0.0225, 0.003, 0.01, 0.003, 0.09]

Step-by-Step

1.Own terms: 0.25×0.04 + 0.09×0.0225 + 0.04×0.09 = 0.015625
2.Cross terms: 2×(0.5×0.3×0.006 + 0.5×0.2×0.01 + 0.3×0.2×0.003) = 0.00416
3.σ_p² = 0.01978500
Result:0.01978500 (return²)

Volatility of 14.1%. The 30% asset alone is 15% volatile and the 20% asset 30%; the matrix shows how little of that reaches the portfolio.

Frequently Asked Questions

Row by row, separated by commas or spaces: for two assets, "0.04, 0.006, 0.006, 0.01". The calculator checks that there are n² values for n weights and that the matrix is symmetric.

From historical returns (see the Covariance formula), a factor model, or a risk vendor. The matrix must be symmetric with nonnegative diagonal entries.