Skip to content
LeetQuant
QR10 Portfolio Construction and Risk

QR10 · Portfolio Construction and Risk · Lesson 2 of 5

PCA & Factor Models

Principal components of a covariance matrix, level–slope–curvature, factor risk models and noisy eigenvalues.

25 min

Principal components

Diagonalise the covariance matrix: Σ=QΛQ⊤\Sigma = Q\Lambda Q^\top with eigenvalues λ1≥λ2≥…\lambda_1 \ge \lambda_2 \ge \dots. The eigenvectors (columns of QQ) are the principal components: uncorrelated portfolios, ordered by how much variance they carry. The kk-th explains a fraction

λk∑iλi=λktr⁡Σ\frac{\lambda_k}{\sum_i \lambda_i} = \frac{\lambda_k}{\operatorname{tr}\Sigma}

of total variance. The first PC is the direction of greatest variance; each later one is the greatest variance direction orthogonal to those before it.

Standardise variables (use the correlation matrix) when they are in different units or have very different scales; otherwise the most volatile variable dominates the first PC.

What the components look like

  • Equities. The first PC has roughly equal weights on every stock: the market. Later PCs resemble sectors and styles.
  • Yield curves. Three components explain nearly all daily moves: level (all rates move together, typically 80–90% of variance), slope (short and long ends move oppositely) and curvature (the middle moves against both ends).

If nn assets share a correlation ρ\rho, the first eigenvalue of the correlation matrix is 1+(n−1)ρ1 + (n - 1)\rho out of a total of nn. With ten assets at ρ=0.3\rho = 0.3, the market factor explains 3.7/10=37%3.7/10 = 37\% of the variance.

Factor models

A factor model writes returns as exposure to a few common factors plus independent noise:

r=Bf+ε,Σ=B Σf B⊤+D,r = Bf + \varepsilon, \qquad \Sigma = B\,\Sigma_f\,B^\top + D ,

with BB the n×kn \times k matrix of loadings, Σf\Sigma_f the factor covariance and DD diagonal. It needs far fewer parameters than a full covariance matrix, which makes estimates more stable and always PSD. The factors can be statistical (principal components) or fundamental (market, size, value, momentum, industries).

Residuals from a factor model are a natural place to look for stat-arb signals: the part of a stock's move that its factor exposures do not explain.

Worked example

counting parameters

How many parameters are needed for a full covariance matrix of 500 stocks, compared with a 5-factor model?

Show solution

A symmetric 500×500500 \times 500 matrix has 500×5012=125,250\tfrac{500 \times 501}{2} = 125{,}250 free entries.

The factor model needs 500×5=2,500500 \times 5 = 2{,}500 loadings, 5×62=15\tfrac{5 \times 6}{2} = 15 factor covariances and 500 specific variances: 3,0153{,}015 in total, about 40 times fewer. With, say, two years of daily data (about 500 observations per stock), the full matrix cannot even be full rank.

Knowledge check

A covariance matrix has eigenvalues 6, 3 and 1. What fraction of total variance does the first principal component explain?

Knowledge check

How many distinct parameters does the covariance matrix of 100 assets have?

Knowledge check

You run PCA on daily changes in yields across maturities. What does the first component usually represent?

Practice problems

Finished reading?

Answer the 3 knowledge checks to complete this lesson (0 done).