Linear AlgebraEigendecompositionPCARisk Factor Models

Eigendecomposition and the Spectral Theorem

Module 3 of 525 min readLevel: Medium

Setup

Where eigendecomposition appears in quant finance

Three workflows on a quant desk depend directly on eigendecomposition:

  1. 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.

  2. Risk factor decomposition. A covariance matrix ΣRn×n\Sigma \in \mathbb{R}^{n \times n} for nn equity returns is decomposed as Σ=QΛQ\Sigma = Q\Lambda Q^\top. The eigenvalues λi\lambda_i are the variances of uncorrelated risk factors; the eigenvectors qiq_i are the factor loadings. The smallest eigenvalues flag near-arbitrage portfolios; the largest flag dominant market risk.

  3. 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.

INSIGHT

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 (q1q_1, approximately the flat vector) captures parallel shifts; the slope component (q2q_2) 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: ARn×nA \in \mathbb{R}^{n \times n}.
  • For the Spectral Theorem, AA is symmetric: A=AA^\top = A.
  • Eigenvectors are normalised to unit length: q2=1\|q\|_2 = 1.
  • Eigenvalues of a real symmetric matrix are real (proved below) and eigenvectors can be chosen orthonormal.
  • The eigendecomposition A=QΛQA = Q\Lambda Q^\top uses QQ orthogonal (QQ=IQ^\top Q = I) and Λ\Lambda diagonal.
  • numpy.linalg.eigh is used for symmetric matrices (faster, guaranteed real eigenvalues); numpy.linalg.eig is the general (possibly complex) version.

Theory

1. Eigenvalues and Eigenvectors

DEFINITION

Definition 1.1 (Eigenvalue/eigenvector). A scalar λR\lambda \in \mathbb{R} and non-zero vector qRnq \in \mathbb{R}^n satisfying Aq=λqAq = \lambda q are called an eigenvalue and its associated eigenvector of ARn×nA \in \mathbb{R}^{n \times n}.

The equation Aq=λqAq = \lambda q rewrites as (AλI)q=0(A - \lambda I)q = 0, which has a non-zero solution iff AλIA - \lambda I is singular, i.e., iff det(AλI)=0\det(A - \lambda I) = 0.

DEFINITION

Definition 1.2 (Characteristic polynomial). The characteristic polynomial of AA is pA(λ)=det(AλI).p_A(\lambda) = \det(A - \lambda I). This is a degree-nn polynomial in λ\lambda. Its roots (counting multiplicity in C\mathbb{C}) are the eigenvalues of AA.

REMARK

Algebraic vs. geometric multiplicity. The algebraic multiplicity of an eigenvalue λ0\lambda_0 is its multiplicity as a root of pAp_A. The geometric multiplicity is dimker(Aλ0I)\dim\ker(A - \lambda_0 I) — the dimension of the eigenspace. Always: geometric \leq algebraic. Equality for every eigenvalue is the condition for diagonalisability.

EXAMPLE

Example 1.3 (2×2 covariance matrix). Let Σ=(4223)\Sigma = \begin{pmatrix} 4 & 2 \\ 2 & 3 \end{pmatrix}.

Characteristic polynomial: p(λ)=(4λ)(3λ)4=λ27λ+8p(\lambda) = (4-\lambda)(3-\lambda) - 4 = \lambda^2 - 7\lambda + 8.

Eigenvalues: λ=7±49322=7±172\lambda = \frac{7 \pm \sqrt{49 - 32}}{2} = \frac{7 \pm \sqrt{17}}{2}, so λ15.56\lambda_1 \approx 5.56, λ21.44\lambda_2 \approx 1.44.

Both positive — confirming Σ0\Sigma \succ 0 (positive eigenvalues \Leftrightarrow positive definite for symmetric matrices, proved via the spectral theorem below).

2. Diagonalisation

DEFINITION

Definition 2.1 (Diagonalisation). A matrix ARn×nA \in \mathbb{R}^{n \times n} is diagonalisable if there exists an invertible PRn×nP \in \mathbb{R}^{n \times n} and diagonal Λ\Lambda such that A=PΛP1,Λ=diag(λ1,,λn).A = P\Lambda P^{-1}, \qquad \Lambda = \operatorname{diag}(\lambda_1, \ldots, \lambda_n). The columns of PP are the eigenvectors of AA.

THEOREM

Theorem 2.2 (Sufficient condition for diagonalisability). If AA has nn distinct eigenvalues, then AA is diagonalisable. Eigenvectors corresponding to distinct eigenvalues are linearly independent.

Proof sketch. Suppose i=1kαiqi=0\sum_{i=1}^k \alpha_i q_i = 0 with qiq_i eigenvectors for distinct λi\lambda_i. Apply AA repeatedly and subtract to eliminate terms, eventually showing all αi=0\alpha_i = 0. \square

REMARK

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 Rn\mathbb{R}^n.

THEOREM

Theorem 3.1 (Spectral Theorem for real symmetric matrices). If ARn×nA \in \mathbb{R}^{n \times n} is symmetric (A=AA^\top = A), then:

  1. All eigenvalues of AA are real.
  2. Eigenvectors corresponding to distinct eigenvalues are orthogonal.
  3. There exists an orthogonal matrix QQ (i.e., QQ=QQ=IQ^\top Q = QQ^\top = I) such that A=QΛQ,Λ=diag(λ1,,λn),λiR.A = Q\Lambda Q^\top, \qquad \Lambda = \operatorname{diag}(\lambda_1, \ldots, \lambda_n), \quad \lambda_i \in \mathbb{R}. The columns q1,,qnq_1, \ldots, q_n of QQ are orthonormal eigenvectors of AA.

The full lesson requires Premium

The complete derivation, the C++ / Python implementation, the validation tables, the quiz, and the interview-angle notes are part of Premium. Start a Premium plan to unlock every module in this track.