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.
Formula
Variables
| Symbol | Name | Description | Unit |
|---|---|---|---|
| PortVar | Portfolio Variance | Variance of a 2-asset portfolio return as a decimal² | variance |
| Weights | Portfolio Weights | Fraction in each asset, in order, summing to 1 | % |
| CovMatrix | Covariance Matrix | The 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
Step-by-Step
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
Step-by-Step
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.