Quant Memo
Advanced

The Spectral Theorem for Symmetric Matrices

Every symmetric matrix, however tangled it looks, is secretly just a stretch along a set of perpendicular directions — the spectral theorem guarantees those directions always exist and are always at right angles.

Prerequisites: Eigenvalues & Eigenvectors, Vector Spaces and Bases, Inner Products and Orthogonality

Multiply a vector by most matrices and it gets stretched and rotated — the output points in some new, unpredictable direction. But for a special and enormously common class of matrices — symmetric ones, which is what every covariance matrix and every "similarity" or "distance" matrix in finance and statistics happens to be — something remarkable is guaranteed: there always exists a set of directions the matrix does not rotate at all, only stretches, and those directions are always mutually perpendicular. That guarantee is the spectral theorem, and it's the reason principal component analysis, risk decomposition, and half of multivariate statistics work at all.

The analogy: kneading dough along fixed grain lines

Picture a block of dough with grain running in two perpendicular directions, like woven fabric. Now knead it — push and pull — but only ever along those grain lines, never twisting them. The dough stretches unevenly (more along one grain than the other) but the grain lines themselves stay put; they just get longer or shorter. Any other line drawn on the dough, diagonal to the grain, does rotate as you knead. A symmetric matrix is a kneading operation with this special property built in: there are always some perpendicular "grain lines" — the eigenvectors — that survive the kneading without rotating, only stretching by a factor called the eigenvalue.

Writing it down

Let AA be a real, symmetric matrix, meaning A=AA^\top = A — the entry in row ii, column jj equals the entry in row jj, column ii. A vector vv is an eigenvector with eigenvalue λ\lambda if

Av=λv.Av = \lambda v .

In words: multiplying vv by AA gives back the same direction vv, just scaled by the number λ\lambda — no rotation, pure stretch (or shrink, or flip, if λ\lambda is negative).

The spectral theorem states that for any symmetric AA of size n×nn \times n, there exist nn eigenvectors that are mutually orthogonal (perpendicular, zero dot product between any pair) and can be scaled to unit length, and their eigenvalues are always real numbers (never involving 1\sqrt{-1}, unlike general matrices). Collecting the eigenvectors as columns of a matrix QQ and the eigenvalues on the diagonal of a matrix Λ\Lambda, the whole matrix factors as

A=QΛQ.A = Q\Lambda Q^\top .

In words: AA is equivalent to rotating into the grain-line coordinate system (QQ^\top), stretching along each grain line by its eigenvalue (Λ\Lambda), then rotating back (QQ). Because QQ's columns are orthonormal, Q=Q1Q^\top = Q^{-1} — rotating back is literally the reverse of rotating in, with no distortion, which is what makes this decomposition so clean compared to a general matrix.

Matrix explorer
dashed = before · solid = after
det 1.25trace 2.50λ 1.81, 0.69area scales by 1.25×

This explorer draws the unit circle transformed by a 2x2 matrix, with its eigenvectors overlaid. For a symmetric matrix, the two eigenvector arrows sit at exactly 90 degrees to each other, and they point straight along the axes of the resulting ellipse — that alignment, guaranteed by the spectral theorem, is what you should watch for as you adjust the matrix entries.

v1 (lambda = 6) v2 (lambda = 1) the two arrows are exactly perpendicular
The ellipse traced by A applied to the unit circle. The two eigenvectors always line up exactly with the ellipse's long and short axes, and always meet at a right angle — the geometric content of the spectral theorem.

Worked example 1: a 2x2 covariance matrix, by hand

Take A=(5222)A = \begin{pmatrix}5 & 2\\2 & 2\end{pmatrix} — symmetric, and a plausible (scaled) covariance matrix. Find eigenvalues by solving det(AλI)=0\det(A-\lambda I)=0:

(5λ)(2λ)4=0    λ27λ+6=0    (λ6)(λ1)=0.(5-\lambda)(2-\lambda) - 4 = 0 \;\Rightarrow\; \lambda^2 - 7\lambda + 6 = 0 \;\Rightarrow\; (\lambda-6)(\lambda-1)=0 .

So λ1=6\lambda_1 = 6, λ2=1\lambda_2 = 1. For λ1=6\lambda_1=6: solve (A6I)v=0(A-6I)v=0, i.e. (1224)v=0\begin{pmatrix}-1&2\\2&-4\end{pmatrix}v=0, giving v=(2,1)v = (2,1) (unnormalised) — check: 1(2)+2(1)=0-1(2)+2(1)=0. Normalise: length =5=\sqrt{5}, so v1=(2/5,1/5)=(0.894,0.447)v_1 = (2/\sqrt5, 1/\sqrt5) = (0.894, 0.447).

For λ2=1\lambda_2=1: solve (AI)v=0(A-I)v=0, i.e. (4221)v=0\begin{pmatrix}4&2\\2&1\end{pmatrix}v=0, giving v=(1,2)v=(1,-2) (unnormalised) — check: 4(1)+2(2)=04(1)+2(-2)=0. Normalise: length =5=\sqrt5, so v2=(1/5,2/5)=(0.447,0.894)v_2=(1/\sqrt5,-2/\sqrt5)=(0.447,-0.894).

Sanity check the perpendicularity: v1v2=(0.894)(0.447)+(0.447)(0.894)=0.4000.400=0v_1\cdot v_2 = (0.894)(0.447)+(0.447)(-0.894) = 0.400-0.400=0 — exactly orthogonal, as guaranteed. And λ1+λ2=7=A11+A22=5+2\lambda_1+\lambda_2 = 7 = A_{11}+A_{22}=5+2 (the trace), a fast arithmetic check available on every 2x2 symmetric matrix.

Worked example 2: reconstructing AA and reading a risk decomposition

Verify A=QΛQA=Q\Lambda Q^\top with Q=(0.8940.4470.4470.894)Q = \begin{pmatrix}0.894 & 0.447\\0.447&-0.894\end{pmatrix}, Λ=(6001)\Lambda=\begin{pmatrix}6&0\\0&1\end{pmatrix}. Compute QΛQ\Lambda first: multiply each column of QQ by its eigenvalue — column 1 by 6, column 2 by 1: QΛ=(5.3640.4472.6820.894)Q\Lambda = \begin{pmatrix}5.364 & 0.447\\2.682&-0.894\end{pmatrix}. Then (QΛ)Q(Q\Lambda)Q^\top: row 1 of QΛQ\Lambda dotted with each column of QQ^\top (which are the rows of QQ) gives row 1 of the result: 5.364(0.894)+0.447(0.447)=4.795+0.200=4.9955.005.364(0.894)+0.447(0.447) = 4.795+0.200=4.995\approx5.00, and 5.364(0.447)+0.447(0.894)=2.3980.400=1.9992.005.364(0.447)+0.447(-0.894)=2.398-0.400=1.999\approx2.00. That reproduces AA's first row (5,2)(5,2), confirming the factorisation.

Now read it as a risk decomposition: if AA is a covariance matrix, total variance (the trace, 5+2=75+2=7) splits into 66 units along direction v1v_1 and 11 unit along v2v_2. In portfolio terms, 85.7%85.7\% of the total risk (6/76/7) sits along one specific combination of the two original variables — the direction a principal component analysis would call the first, dominant factor.

What this means in practice

  • It's the mathematical basis of principal component analysis. PCA on a covariance matrix is literally applying the spectral theorem and reading off the eigenvector with the largest eigenvalue as "the direction of greatest variance."
  • It guarantees real, orthogonal risk factors exist. Risk models decompose portfolio variance into independent contributions precisely because a covariance matrix is always symmetric, so the spectral theorem always applies — no special pleading needed.
  • It underlies Cholesky's cousin decompositions. Where Cholesky gives a fast triangular square root for simulation, the spectral form gives an interpretable square root (QΛ1/2Q\Lambda^{1/2}) used when you specifically want to see which directions carry the risk.

Every real symmetric matrix AA can be written A=QΛQA=Q\Lambda Q^\top: a rotation into a special set of mutually perpendicular directions (the eigenvectors, columns of QQ), a pure stretch along each one (the eigenvalues, diagonal of Λ\Lambda), and a rotation back. Symmetry is what guarantees the directions are perpendicular and the stretches are real numbers — general matrices offer no such guarantee.

The classic confusion is assuming any square matrix has this nice orthogonal decomposition. It does not — a non-symmetric matrix can have complex eigenvalues, eigenvectors that aren't perpendicular, or even too few eigenvectors to diagonalise at all. The spectral theorem is a special gift of symmetry. The practical trap: a sample covariance matrix computed from noisy or insufficient data is symmetric by construction, so the theorem always technically applies, but with too few observations relative to the number of assets, the smallest eigenvalues become unreliable — dominated by estimation noise rather than genuine low-risk directions — which is why practitioners shrink or clip small eigenvalues before trusting a spectral decomposition for risk management.

Related concepts

Practice in interviews

Further reading

  • Strang, Introduction to Linear Algebra (ch. 6)
  • Axler, Linear Algebra Done Right (ch. 7)
ShareTwitterLinkedIn