Linear Algebra & Optimization
Intermediate
7 min

Covariance Matrices

The covariance matrix packages every pairwise variance and covariance among assets into a single PSD matrix that drives portfolio risk.

1. The idea

For a random vector of asset returns, the covariance matrix has , with variances on the diagonal. It is symmetric and PSD by construction.

Portfolio variance for weights is the quadratic form , which is why being PSD guarantees no portfolio can have negative variance — a basic sanity check on any estimated covariance matrix.

Diversification reduces risk because off-diagonal covariances typically contribute less than the diagonal terms scale; when correlations are less than 1, is strictly smaller than a weighted average of individual variances.

2. Why it matters

Every step of Markowitz optimization, factor risk models, and PCA on returns starts from correctly forming and manipulating .

3. Core mathematics

Covariance matrix

Portfolio variance

Decomposition via correlation

4. How to recognize it

Think of this when…

  • Any two-or-more-asset variance/risk computation
  • Questions giving a correlation matrix and asking for portfolio risk
  • Setup for Markowitz mean-variance optimization

5. Worked example

Worked example

Two assets have , , correlation . Find the variance of an equal-weighted portfolio.

  1. 1

    Build the covariance.

  2. 2

    Apply the two-asset variance formula with .

  3. 3

    Substitute numbers.

  4. Answer: Portfolio variance ≈ 0.0475, so volatility ≈ 21.8%

6. Common mistakes

  • Forgetting the factor of 2 on the cross term in the two-asset variance formula
  • Using correlation where covariance was needed, or vice versa
  • Assuming diversification always reduces volatility even when correlation is 1

7. Quick check

Off-diagonal entries of a covariance matrix represent:

Portfolio variance is given by:

8. Practice

1 QuantSolve questions use this concept.

Practice this concept

9. Related methods

This lesson is conceptual; see the topic hub for methods.