Know these first
- L2.6.05: Diversification and its limits
By the end you will be able to
- 1Write a portfolio's expected return as w′μ and its variance as w′Σw, and see the two-asset formula inside it.
- 2Build a covariance matrix from volatilities and correlations as Σ = DRD.
- 3Count the inputs a covariance matrix needs, n(n + 1)/2, and explain why data runs out.
- 4Check whether a correlation matrix is valid using its eigenvalues, and repair one that is not.
Why it matters
RiskAtoms Group's £1bn portfolio spreads across five asset classes. Its volatility, 9.50%, comes from a sum of 25 terms. A bank's trading book with 3,000 risk factors needs nine million terms and 4,501,500 different inputs, and those inputs must fit together, or the model will report that some portfolio has negative risk.
Core explanation
One line for any number of assets
Illustrative dataRiskAtoms Group's investment portfolio
The group invests £1bn of surplus assets across five asset classes. The expected returns, volatilities and correlations are round, made-up long-run assumptions in pounds, a year, not estimates from market data. The risk-free rate (a one-year Treasury bill) is 3.0%. The same numbers run through the whole module.
| Asset class | Expected return | Volatility | Sharpe ratio |
|---|---|---|---|
| Global equities | 7.0% | 16% | 0.250 |
| Emerging-market equities | 8.5% | 22% | 0.250 |
| Government bonds | 3.5% | 6% | 0.083 |
| Corporate bonds | 4.5% | 8% | 0.188 |
| Property | 6.0% | 18% | 0.167 |
Correlations
| Global eq. | EM eq. | Gov. bonds | Corp. bonds | Property | |
|---|---|---|---|---|---|
| Global eq. | 1.00 | 0.75 | −0.10 | 0.35 | 0.60 |
| EM eq. | 0.75 | 1.00 | −0.05 | 0.35 | 0.50 |
| Gov. bonds | −0.10 | −0.05 | 1.00 | 0.70 | 0.10 |
| Corp. bonds | 0.35 | 0.35 | 0.70 | 1.00 | 0.40 |
| Property | 0.60 | 0.50 | 0.10 | 0.40 | 1.00 |
Weights and returns as vectors
With two assets, L3.1.01: Portfolio return and risk wrote everything out term by term. With five, or five hundred, that becomes unreadable. Instead, line the numbers up as vectors (M-E01: Vectors and matrices): a column of weights and a column of expected returns, one entry per asset. A prime turns a column into a row. Then the expected return and the budget are each one short product:
For the group, with the weights as a row and the expected returns as a column:
The covariance matrix
Risk needs more than one number per asset. It needs every variance and every covariance, and they fit in a square table: the covariance matrix . The entry in row and column is , the covariance of assets and . On the diagonal, an asset's covariance with itself is its variance, . Because , the matrix is symmetric: the triangle above the diagonal mirrors the one below. For three of the group's assets (global equities, emerging-market equities, government bonds), in full:
For all five, a table is easier to read. Entries are in %², so 256.0 means 0.0256, a volatility of 16%.
| GE | EM | GB | CB | PR | |
|---|---|---|---|---|---|
| GE | 256.0 | 264.0 | −9.6 | 44.8 | 172.8 |
| EM | 264.0 | 484.0 | −6.6 | 61.6 | 198.0 |
| GB | −9.6 | −6.6 | 36.0 | 33.6 | 10.8 |
| CB | 44.8 | 61.6 | 33.6 | 64.0 | 57.6 |
| PR | 172.8 | 198.0 | 10.8 | 57.6 | 324.0 |
Portfolio variance is w′Σw
Each pair of assets adds to the variance. Lay those terms out in the same square as and you get a variance grid with one cell per pair: the variance is the sum of every cell. In matrix notation that sum is a quadratic form (M-E02: Matrix multiplication and quadratic forms):
For the group's five assets the grid has 25 cells: 5 on the diagonal, which add 47% of the variance, and 20 off it (10 pairs, each twice), which add the other 53%. If every correlation were zero, only the diagonal would be left and the volatility would be 6.50%. The real figure is 9.50%, because most of the pairs move together. That is still far below the weighted average of the five volatilities, 12.70%, which is what every correlation equal to +1 would give.
Σ = DRD: volatilities and correlations
People think in volatilities and correlations, not covariances. Put the volatilities on the diagonal of a matrix and the correlations in the correlation matrix . Then : multiplying by on the left scales each row by , and on the right scales each column by , so every entry becomes . For the three assets:
Check one entry: global and emerging-market equities, . The split matters in practice: volatilities move quickly and are re-estimated often, while correlations are usually set more slowly, and stress tests often change one without the other.
How many numbers?
A symmetric matrix has diagonal entries and distinct pairs, so it needs numbers. That grows with the square of :
| Assets n | Variances | Covariances | Total n(n+1)/2 | Single-index model 3n + 2 (incl. expected returns) |
|---|---|---|---|---|
| 2 | 2 | 1 | 3 | 8 |
| 3 | 3 | 3 | 6 | 11 |
| 5 | 5 | 10 | 15 | 17 |
| 30 | 30 | 435 | 465 | 92 |
| 100 | 100 | 4,950 | 5,050 | 302 |
| 500 | 500 | 124,750 | 125,250 | 1,502 |
| 3,000 | 3,000 | 4,498,500 | 4,501,500 | 9,002 |
The inputs have to come from data, and data runs out. A covariance matrix estimated from observations can have at most eigenvalues above zero (M-E04: Eigenvalues and positive definiteness). With 500 shares and ten years of monthly returns (120 observations), at least 381 eigenvalues are exactly zero, and each one is a portfolio the data says has no risk. A tiny case shows the danger: five asset classes, four months of simulated returns. The estimated matrix has two zero eigenvalues, and the fully invested portfolio 53% GE, 57% EM, −69% GB, −68% CB, 126% PR has an estimated volatility of exactly zero. Its true volatility, from the module's inputs, is 36.26%. An optimiser fed that estimate would pick it. L3.1.11: Factor models and Fama-French shows how factor models such as the single-index model in the last column cut the inputs down.
Not every table is a correlation matrix
A valid correlation matrix must be:
- symmetric, ;
- ones on the diagonal, every entry between −1 and 1;
- positive semi-definite: for every , because is the variance of a portfolio of the assets scaled to unit volatility, and a variance cannot be negative.
The first two are easy to see. The third is not, because it is about all the entries together. Take this table, put together pair by pair:
Every entry looks reasonable. But if A moves closely with B (0.9) and closely with C (0.8), then B and C must move fairly closely with each other. Given the first two, the third correlation must lie between 0.458 and 0.982. At 0.2 the table describes three assets that cannot exist.
The diagnosis: eigenvalues. A symmetric matrix is positive semi-definite exactly when none of its eigenvalues is negative (the proof is in the formal version below). This one has eigenvalues . The negative one comes with a portfolio: hold +1 of A, −0.70 of B and −0.59 of C (in units of one volatility each), and the table says its variance is −0.202. Give the assets volatilities of 16%, 20% and 18% and the covariance matrix inherits the problem: positions have a variance of −0.0052. A risk model built on it can report negative risk, a square root that fails, or an optimiser that leverages up the “free” hedge without limit.
Where broken matrices come from
The repair: clip and rescale. Write , replace the negative eigenvalues by zero (or a small positive floor), rebuild the matrix, then divide each entry by to put ones back on the diagonal. For the broken table:
It works, but notice three things. Every correlation moved, not just the suspicious one: A–B fell from 0.9 to 0.822. The repaired B–C correlation, 0.219, sits exactly on the edge of its new allowed range. And with a floor of zero the result is singular, so some portfolio still has zero risk; in practice a small positive floor is used. Clipping is quick but not the closest valid matrix. The nearest correlation matrix of Higham (2002) finds the valid matrix with the smallest total squared change, and lets you keep trusted entries fixed. The covariance matrix toolkit runs both repairs on matrices of any size.
Check itIs this a correlation matrix?
Allowed range for ρ(B, C), given the other two: 0.458 to 0.982
Eigenvalues (they add up to 3)
| A | B | C | |
|---|---|---|---|
| A | 1.00 | 0.90 | 0.80 |
| B | 0.90 | 1.00 | 0.20 |
| C | 0.80 | 0.20 | 1.00 |
Hold +1.00 of A, −0.70 of B, −0.59 of C (in units of one volatility each). This table says its variance is −0.202: impossible.
The formal version
For n assets with weights w, expected returns μ and covariance matrix Σ (all from one model):
Why eigenvalues decide validity. Any symmetric matrix has an eigen-decomposition with orthonormal eigenvectors. That turns the quadratic form into a weighted sum of squares:
Two useful facts follow. The eigenvalues of a correlation matrix add up to (the trace, the sum of the diagonal), so one large eigenvalue forces others to be small. And when every pair has the same correlation ρ, the eigenvalues are once and the other times, so the matrix is valid only if . Three assets cannot all have correlation below −0.5 with each other; ten cannot all be below about −0.11. Many assets cannot all hedge one another.
The three-asset bound. For a 3 × 3 correlation matrix the determinant is . Setting it to zero and solving for gives the allowed range:
For the broken table the determinant is . A positive-definite matrix (all eigenvalues above zero) also has a Cholesky factor , which simulations use to draw correlated returns; trying to compute it is a cheap validity test, since it fails when the matrix is not positive definite.
Try it
Start from the group's current allocation and watch the property row: it is the largest. Switch the correlations off to see how much of the risk comes from assets moving together. Then try the long EM, short GE preset and look for the red cells: a short position against a positively correlated asset takes risk away.
Try itThe variance grid
Covariance matrix toolkit →Invested: 100%
The biggest row is property: it adds 41% of the variance, with its correlations included.
Cells show
| GE25% | EM5% | GB25% | CB20% | PR25% | Row | |
|---|---|---|---|---|---|---|
| GE 25% | 17.7 | 3.7 | −0.7 | 2.5 | 12.0 | 35.2 |
| EM 5% | 3.7 | 1.3 | −0.1 | 0.7 | 2.7 | 8.3 |
| GB 25% | −0.7 | −0.1 | 2.5 | 1.9 | 0.7 | 4.3 |
| CB 20% | 2.5 | 0.7 | 1.9 | 2.8 | 3.2 | 11.1 |
| PR 25% | 12.0 | 2.7 | 0.7 | 3.2 | 22.4 | 41.1 |
| Total | every cell added up | 100.0 | ||||
GE global equities, EM emerging-market equities, GB government bonds, CB corporate bonds, PR property. Outlined cells are the diagonal (own variances); blue cells add risk, red cells take it away. Each cell is wi × wj × σij. Illustrative inputs.
Worked example
The group's volatility, by matrix
w′Σw for five asset classes
Step 1 of 5- 1
Build Σ = DRD
Volatilities 16%, 22%, 6%, 8% and 18% on the diagonal of ; the correlation table at the top of the lesson as . Each entry is , giving the 5 × 5 matrix shown above in %².
Regulatory lens
Regulatory capital formulas use the same quadratic form, with a correlation matrix set by the regulator. Under the Solvency II standard formula, an insurer such as RiskAtoms Insurance adds up its capital for market, counterparty, life, health and non-life risk as
with the correlations listed in Annex IV of the Solvency II Directive (2009/138/EC). That is , the volatility formula with capital amounts in place of weighted volatilities. The Basel market risk standard (FRTB) does the same within and across buckets of risk factors in its sensitivities-based method, and because its correlations are applied to signed amounts, it says what to do when the sum under the square root comes out negative (MAR21.4(4) and (5)(b)). A firm that builds its own internal model has to show its correlation assumptions are coherent: the checks in this lesson are the first test. Capital aggregation is covered in M4.6: Solvency II and insurance regulation.
Spark Atoms
Spark AtomToo many numbers for 1963
Spark AtomA problem from finance
nearPD function.Key takeaways
- Expected return is w′μ and variance is w′Σw: one line for any number of assets, and the two-asset formula is the case n = 2.
- The variance grid has a cell w_i w_j σ_ij for every pair; the diagonal holds own variances, the rest covariances.
- Σ = DRD separates volatilities (D) from correlations (R).
- A covariance matrix needs n(n + 1)/2 inputs, and with fewer observations than assets the estimate is singular.
- A valid correlation matrix is symmetric, has a unit diagonal and is positive semi-definite: no negative eigenvalue. Clip and rescale, or Higham's nearest correlation matrix, repairs one that is not.
Reaction
Check what stuck
Question 1 · objective 3
How many different numbers (variances and covariances) does the covariance matrix of 40 assets need?
Question 2 · objective 2
What sits on the diagonal of a covariance matrix?
Question 3 · objective 1
Weights 0.5 and 0.5, covariance matrix with rows (0.04, 0.01) and (0.01, 0.09). What is the portfolio variance w′Σw, to four decimals?
Question 4 · objective 2
Two assets with volatilities 20% and 10% and correlation 0.5. What is their covariance, the off-diagonal entry of Σ = DRD, to two decimals?
Question 5 · objective 4
Assets A and B have correlation 0.9, and A and C also 0.9. Which correlation between B and C is possible?
Question 6 · objective 4
A symmetric 3 × 3 table with ones on the diagonal has eigenvalues 2.1, 0.95 and −0.05. What follows?
Glossary
- Vector
- An ordered list of numbers, written as a column. Here: one weight, or one expected return, per asset.
- Covariance matrix
- The n × n table of every variance (on the diagonal) and every covariance (off it) of n assets' returns. Symbol Σ.
- Quadratic form
- An expression w′Aw: a vector times a square matrix times the same vector, giving one number.
- Correlation matrix
- The n × n table of correlations, with ones on the diagonal. It is the covariance matrix of the returns divided by their volatilities.
- Positive semi-definite
- A symmetric matrix A is positive semi-definite if w′Aw ≥ 0 for every vector w. Equivalently, none of its eigenvalues is negative.
- Eigenvalue
- A number λ with a vector q (its eigenvector) such that Aq = λq. A symmetric n × n matrix has n of them, and q′Aq = λ when q has length one.
- Nearest correlation matrix
- The valid correlation matrix closest to a given invalid one, usually in the sense of the smallest sum of squared differences (Higham, 2002).
- Single-index model
- A model in which every asset's return depends on one common index plus its own noise, so the model needs only 3n + 2 inputs, expected returns included (2n + 1 for the covariance matrix alone).
Deep Dives & Origins
Deep Dives
- G. Strang, Introduction to Linear Algebra, Wellesley-Cambridge Press, the chapters on symmetric matrices and positive definiteness. Intermediate.
- N. J. Higham, “Computing the nearest correlation matrix: a problem from finance”, IMA Journal of Numerical Analysis, 22(3), 2002. Advanced.
Origins
- H. Markowitz, “Portfolio Selection”, Journal of Finance, 7(1), 1952, pp. 77–91.
- W. F. Sharpe, “A Simplified Model for Portfolio Analysis”, Management Science, 9(2), 1963, pp. 277–293.
- R. Rebonato and P. Jäckel, “The most general methodology for creating a valid correlation matrix for risk management and option pricing purposes”, Journal of Risk, 2(2), 2000.
- Directive 2009/138/EC (Solvency II), Annex IV.
- Basel Committee on Banking Supervision, Basel Framework, MAR21 (standardised approach: sensitivities-based method).
Watch this lesson
Video version
Prefer to watch? The same lesson as a 12-minute video will sit here, made from this page's script.