Setup
Where eigendecomposition appears in quant finance
Three workflows on a quant desk depend directly on eigendecomposition:
-
Principal component analysis (PCA) of yield curves. The covariance matrix of daily rate changes is decomposed into eigenvectors: the first three principal components (level, slope, curvature) typically explain over 95% of the variance. Traders hedge using these components rather than individual maturities.
-
Risk factor decomposition. A covariance matrix for equity returns is decomposed as . The eigenvalues are the variances of uncorrelated risk factors; the eigenvectors are the factor loadings. The smallest eigenvalues flag near-arbitrage portfolios; the largest flag dominant market risk.
-
Stability of calibration. The condition number of a matrix (treated in Module 4) is the ratio of its largest to smallest eigenvalue. A large condition number signals that small perturbations in input data produce large swings in calibrated parameters — a failure mode PMs care about.
Why this matters on a rates desk. In PCA-based yield curve risk, each bucket DV01 is projected onto the principal component basis. The level component (, approximately the flat vector) captures parallel shifts; the slope component () captures steepening/flattening. A trader who hedges only the level exposure while ignoring slope is exposed to a curve twist — which the spectral decomposition makes mathematically explicit.
Assumptions and conventions
- Matrices are real and square: .
- For the Spectral Theorem, is symmetric: .
- Eigenvectors are normalised to unit length: .
- Eigenvalues of a real symmetric matrix are real (proved below) and eigenvectors can be chosen orthonormal.
- The eigendecomposition uses orthogonal () and diagonal.
numpy.linalg.eighis used for symmetric matrices (faster, guaranteed real eigenvalues);numpy.linalg.eigis the general (possibly complex) version.
Theory
1. Eigenvalues and Eigenvectors
Definition 1.1 (Eigenvalue/eigenvector). A scalar and non-zero vector satisfying are called an eigenvalue and its associated eigenvector of .
The equation rewrites as , which has a non-zero solution iff is singular, i.e., iff .
Definition 1.2 (Characteristic polynomial). The characteristic polynomial of is This is a degree- polynomial in . Its roots (counting multiplicity in ) are the eigenvalues of .
Algebraic vs. geometric multiplicity. The algebraic multiplicity of an eigenvalue is its multiplicity as a root of . The geometric multiplicity is — the dimension of the eigenspace. Always: geometric algebraic. Equality for every eigenvalue is the condition for diagonalisability.
Example 1.3 (2×2 covariance matrix). Let .
Characteristic polynomial: .
Eigenvalues: , so , .
Both positive — confirming (positive eigenvalues positive definite for symmetric matrices, proved via the spectral theorem below).
2. Diagonalisation
Definition 2.1 (Diagonalisation). A matrix is diagonalisable if there exists an invertible and diagonal such that The columns of are the eigenvectors of .
Theorem 2.2 (Sufficient condition for diagonalisability). If has distinct eigenvalues, then is diagonalisable. Eigenvectors corresponding to distinct eigenvalues are linearly independent.
Proof sketch. Suppose with eigenvectors for distinct . Apply repeatedly and subtract to eliminate terms, eventually showing all .
Distinct eigenvalues are sufficient but not necessary. A matrix with repeated eigenvalues may still be diagonalisable (if geometric multiplicity equals algebraic multiplicity for every eigenvalue) — or it may not (Jordan form is needed in the latter case, but this is rarely relevant in finance practice where matrices are symmetric).
3. The Spectral Theorem
The Spectral Theorem is the cornerstone result for symmetric matrices. It guarantees not just diagonalisability, but orthogonal diagonalisation — the eigenvectors form an orthonormal basis of .
Theorem 3.1 (Spectral Theorem for real symmetric matrices). If is symmetric (), then:
- All eigenvalues of are real.
- Eigenvectors corresponding to distinct eigenvalues are orthogonal.
- There exists an orthogonal matrix (i.e., ) such that The columns of are orthonormal eigenvectors of .
Proof of (1) — eigenvalues are real. Let with , . Compute . But also (using real symmetric). So , which forces .
Proof of (2) — orthogonality of distinct eigenvectors. Let , , . Then (using symmetry of for the middle step). So , and since , we get .
The existence of a full orthonormal basis of eigenvectors (part 3) follows from induction using the above, with the Gram-Schmidt procedure applied within each eigenspace when eigenvalues are repeated.
4. The Spectral Decomposition as a Sum of Rank-1 Projections
The factorisation can be written out as:
Each term is a rank-1 orthogonal projection onto the span of . The matrix is a weighted sum of these projections, with weights .
The quadratic form picture. For with : The coefficient is the squared projection of onto the -th eigenvector. The quadratic form is therefore a weighted sum of these projections, with weights . Positive definiteness ( for all ) is equivalent to for all — the spectral characterisation of SPD.
Corollary 4.1. A real symmetric matrix is:
- Positive definite iff all eigenvalues are strictly positive.
- Positive semi-definite iff all eigenvalues are non-negative.
- Indefinite iff it has both positive and negative eigenvalues.
5. Principal Component Analysis
PCA applies the spectral theorem to a sample covariance matrix to find the directions of maximum variance.
Definition 5.1 (Principal components). Given with , the -th principal component is the direction (the -th column of ). The variance explained by the first components is
Example 5.2 (Yield curve PCA). Daily changes in a 5-maturity yield curve (3m, 1y, 2y, 5y, 10y) are stored in a matrix . The covariance matrix is computed and eigendecomposed. Typical findings:
- ≈ (flat vector) — level shift, explains ~75% of variance.
- ≈ — slope (steepening/flattening), explains ~15%.
- ≈ — curvature (butterfly), explains ~5%.
The first 3 components explain ~95% of daily P&L. A trader who hedges only the level component retains ~20% of variance unhedged.
Low-rank approximation. The best rank- approximation to in the Frobenius norm is This is the matrix obtained by zeroing out the smallest eigenvalues. For assets and factors, the approximation stores numbers instead of — a compression ratio of .
Validation
The companion notebook verifies:
- Spectral theorem — decomposes a symmetric matrix, verifies , , all eigenvalues real.
- SPD characterisation — confirms eigenvalue signs match positive-definiteness check.
- Rank-1 projection decomposition — verifies .
- PCA on synthetic returns — generates 5-asset correlated returns, computes covariance, runs PCA, verifies variance explained and orthogonality of components.
- Low-rank approximation error — measures for .
By hand before opening the notebook. Let .
- Compute the eigenvalues by solving .
- For each eigenvalue, find the eigenvector (up to scaling).
- Verify the eigenvectors are orthogonal.
- Write down the spectral decomposition .
(Answer: , ; , . Check: . ✓)
Limitations
Near-repeated eigenvalues make eigenvectors unstable. If , the eigenspace for is nearly two-dimensional and any two orthonormal vectors in the span are valid eigenvectors. Numerical algorithms will return one particular pair, but a small perturbation to can produce a completely different pair. In PCA of equity returns, principal components corresponding to near-equal eigenvalues are statistically meaningless — they rotate arbitrarily within the degenerate eigenspace.
Eigenvalues are not volatilities. A common error: treating as the volatility of the -th principal component. This is correct only if is the covariance matrix of annualised returns expressed in variance units. If is computed from daily returns, is the daily standard deviation of the -th component — multiply by to annualise.
The spectral theorem applies to symmetric matrices only. For general (non-symmetric) matrices, eigenvalues may be complex and the eigenvectors need not be orthogonal. The correct generalisation is the singular value decomposition (SVD, Module 4), which always exists and gives orthonormal bases for both domain and range — regardless of symmetry or square shape.
Scope limitations:
- This module covers the real symmetric case. The complex Hermitian case () has an identical spectral theorem with conjugate transpose replacing transpose.
- Infinite-dimensional operators (integral operators, differential operators) have a spectral theory requiring functional analysis (Hilbert-Schmidt operators, self-adjoint operators). The intuition from finite dimensions carries over, but compactness conditions are needed.
Interview Angle
L1 (Junior quant / developer).
-
"What is an eigenvalue and eigenvector, and how do you compute them?" — Expected: ; compute via for small matrices; use
numpy.linalg.eighfor symmetric matrices in code. Mentioneighvseig. -
"What does the spectral theorem say, and why does it matter for covariance matrices?" — Expected: every real symmetric matrix has an orthonormal basis of real eigenvectors (, orthogonal). For covariance matrices this means the principal components are orthogonal risk factors, and eigenvalues are their variances.
-
"If a covariance matrix has a negative eigenvalue, what does that mean practically?" — Expected: the matrix is not positive semi-definite — some portfolio has "negative variance", which is impossible for a true covariance matrix. Causes: estimation error (short history), numerical noise. Fix: project to SPD (clamp eigenvalues at a small positive floor, then reconstruct).
L2 (Senior quant).
-
"Explain PCA of a yield curve in terms of the spectral theorem. What are the first three principal components?" — Expected: eigendecompose the covariance of daily rate changes. = level (parallel shift, ~75% variance), = slope (steepening/flattening, ~15%), = curvature (butterfly, ~5%). These are the hedgeable risk factors; the remaining components are noise.
-
"A covariance matrix for 200 assets is estimated from 60 days of data. How many meaningful principal components are there? How should you use them?" — Expected: at most 60 meaningful components (rank of the data matrix). The remaining 140 eigenvalues are zero (or near-zero noise). Use the top components that explain e.g. 95% of variance; the rest are estimation artefacts. Build a regularised covariance as where is the average of the discarded eigenvalues (the Ledoit-Wolf shrinkage intuition).
-
"How does the low-rank spectral approximation minimise the approximation error?" — Expected: it is the best rank- approximation in the Frobenius norm. The error is . This follows from the Eckart-Young theorem (the matrix analogue of truncating a Fourier series at the leading terms).
L3 (Researcher).
-
"In a statistical factor model , the covariance is . How does the spectral structure of compare to that of the full , and what are the implications for PCA-based risk attribution?" — Expected: has at most non-zero eigenvalues (rank , the number of factors), so its spectrum drops to zero after components. adds the idiosyncratic diagonal , which "fills in" the zero eigenvalues — the full is SPD. PCA of recovers the factor structure only approximately; exact recovery requires the structured model (e.g., via EM on the factor model). PCA conflates systematic and idiosyncratic variance.
-
"What is the variational characterisation of eigenvalues (Courant-Fischer), and how does it explain why the first principal component maximises variance?" — Expected: (Rayleigh quotient). The argmax is (the leading eigenvector). More generally, . This makes precise the statement that is the direction of maximum portfolio variance — it is a theorem, not a definition.