Covariance Matrices and Linear Combinations
Every portfolio variance is a quadratic form in this matrix, so its structure matters more than any single entry.
Variances on the diagonal, covariances off it. Symmetric and positive semi-definite.
The one formula that matters
For portfolio weights :
This quadratic form collapses an entire book into a single risk number, and it is the foundation of portfolio risk management, optimisation and VaR.
Expanded, it says total variance is the sum of individual variances plus every pairwise covariance term. The cross terms are why diversification works and why it can fail: they can reduce total risk substantially, or amplify it when everything is positively correlated.
Positive semi-definiteness
for every , since a variance cannot be negative.
This is not a technicality. An estimated matrix that violates it, which happens easily with missing data or inconsistent estimation windows, implies some portfolio has negative variance. Optimisers exploit such portfolios enthusiastically, producing enormous positions in what the model believes is risk-free. Any risk system must check and repair this.
A covariance matrix that is not positive semi-definite implies a portfolio with negative risk, and an optimiser will find it. This is one of the most common ways a risk model produces absurd positions.
Estimation is the hard part
With assets there are parameters to estimate. For 500 stocks that is over 125,000 numbers, from a return history that may be a few hundred observations.
The consequence is severe. With fewer observations than assets the sample matrix is singular, and even with more it is dominated by noise. Optimisers then load into whichever spurious low-correlation pair the noise created, which is why naive mean-variance optimisation produces such unstable and extreme portfolios.
The fixes
Factor models impose structure. Rather than estimating every pairwise covariance, model returns as driven by a few common factors:
Now you estimate factor loadings and a small factor covariance matrix instead of thousands of pairs. This is the standard approach and it is why factor models are ubiquitous.
Shrinkage blends the noisy sample estimate toward a simple structured target, trading a little bias for a large variance reduction. The same bias-variance logic that justifies ridge regression.
Longer windows reduce noise but assume stability that markets do not offer, so this trades one error for another.
When an optimiser produces an extreme portfolio, suspect the covariance matrix before the objective. Extreme weights are usually the optimiser exploiting estimation noise rather than finding genuine structure.
Test your knowledge
Keep reading Advanced Topics in Probability and Statistics
35 lessons in this course, and every other premium course, on one subscription.
- Every lesson in every course, with the worked examples and interactive simulators
- Graded questions on every lesson, with explanations for the wrong answers as well as the right one
- The trainers, timed assessments and brainteaser library that go with them