Quant Memo
Foundational

Singular Value Decomposition

The universal factorization $A = U\Sigma V^\top$ that works for any matrix, its geometry as rotate-stretch-rotate, the Eckart–Young optimal low-rank approximation behind PCA and denoising, and the pseudo-inverse that solves least squares even when nothing is invertible.

Prerequisites: Linear Algebra for Quants, Eigenvalues & Eigenvectors

The singular value decomposition is the most important matrix factorization there is, because it is the one that always exists, for any matrix, of any shape, singular or not. Where Eigenvalues & Eigenvectors work only for square (and behave cleanly only for symmetric) matrices, the SVD handles the rectangular, rank-deficient, noisy data matrices that finance actually produces. It is simultaneously the engine of PCA, the optimal tool for compression and denoising, and the numerically stable way to solve least squares. If you learn one decomposition deeply, learn this one.

The theorem

Every matrix ARm×nA \in \mathbb{R}^{m\times n} factors as A=UΣV,A = U\Sigma V^\top, where URm×mU \in \mathbb{R}^{m\times m} and VRn×nV \in \mathbb{R}^{n\times n} are orthogonal (UU=IU^\top U = I, VV=IV^\top V = I) and ΣRm×n\Sigma \in \mathbb{R}^{m\times n} is diagonal with non-negative entries σ1σ2σr>0\sigma_1 \ge \sigma_2 \ge \dots \ge \sigma_r > 0 (and zeros after), the singular values. The columns of UU are the left singular vectors, the columns of VV the right singular vectors, and r=rank(A)r = \operatorname{rank}(A) is the number of nonzero singular values. Existence is unconditional, no assumptions on AA at all.

Relation to eigen-decomposition. The SVD is the eigen-decomposition of the symmetric Positive Semidefinite Matrices matrices AAA^\top A and AAAA^\top in disguise: AA=VΣΣV,AA=UΣΣU.A^\top A = V\Sigma^\top\Sigma\, V^\top, \qquad AA^\top = U\Sigma\Sigma^\top U^\top. So the right singular vectors VV are eigenvectors of AAA^\top A, the left singular vectors UU are eigenvectors of AAAA^\top, and the singular values are the square roots of their shared nonzero eigenvalues, σi=λi\sigma_i = \sqrt{\lambda_i}. This is why singular values are always real and non-negative, they come from a PSD matrix. It also warns you numerically: forming AAA^\top A squares the condition number, so a good SVD algorithm never actually builds it (it works on AA directly via Golub–Kahan bidiagonalization).

The geometry: rotate, stretch, rotate

The SVD says every linear map, however complicated, is just three simple operations in sequence. Reading Ax=UΣVxAx = U\Sigma V^\top x right to left: VV^\top rotates the input into the right singular basis, Σ\Sigma stretches each axis by its singular value (and projects out the null directions), and UU rotates into the output basis. A matrix maps the unit sphere to an ellipsoid whose semi-axes have lengths σi\sigma_i pointing along the columns of UU. The largest singular value σ1\sigma_1 is the maximum stretch (the spectral norm A2\lVert A\rVert_2), the smallest nonzero one is the minimum stretch, and their ratio σ1/σr\sigma_1/\sigma_r is the condition number, the amplification of relative error, the single number that predicts whether solving Ax=bAx=b will be stable or a disaster.

Low-rank approximation: Eckart–Young

Here is the result that makes SVD indispensable for data. Truncate the decomposition to the top kk terms: Ak=i=1kσiuivi.A_k = \sum_{i=1}^k \sigma_i u_i v_i^\top. The Eckart–Young–Mirsky theorem says AkA_k is the best possible rank-kk approximation of AA in both the spectral and Frobenius norms: minrank(B)kABF=AAkF=i=k+1nσi2.\min_{\operatorname{rank}(B)\le k}\lVert A - B\rVert_F = \lVert A - A_k\rVert_F = \sqrt{\sum_{i=k+1}^{n}\sigma_i^2}. No rank-kk matrix approximates AA better than truncating its SVD, and the error is exactly the tail of discarded singular values. This is the mathematical justification for PCA (the top kk singular directions of a demeaned return matrix are the principal components capturing the most variance), for denoising (small singular values are typically noise; dropping them cleans the signal, the basis of random-matrix-theory covariance cleaning), and for compression (store k(m+n)k(m+n) numbers instead of mnmn). The decay profile of the σi\sigma_i tells you the intrinsic dimensionality: a few large singular values followed by a long flat tail means the data is effectively low-rank plus noise, the empirical signature of factor structure in returns.

The pseudo-inverse and least squares

When AA is not invertible (rectangular, or rank-deficient, exactly the Ordinary Least Squares (OLS) problem with collinear regressors), the SVD delivers the Moore–Penrose pseudo-inverse: A+=VΣ+U,Σ+=diag(1/σ1,,1/σr,0,,0),A^+ = V\Sigma^+ U^\top, \qquad \Sigma^+ = \operatorname{diag}(1/\sigma_1,\dots,1/\sigma_r,\,0,\dots,0), inverting only the nonzero singular values and leaving the null directions at zero. Then x^=A+b\hat x = A^+ b is the least-squares solution, and when the solution is non-unique it selects the minimum-norm one. This reproduces β^=(XX)1Xy\hat\beta = (X^\top X)^{-1}X^\top y when XX has full rank but, crucially, keeps working when XXX^\top X is singular, where the normal equations simply have no inverse. Truncated SVD (zeroing tiny singular values before inverting) is regularization: it prevents the 1/σi1/\sigma_i blow-up from near-zero singular values that would otherwise amplify noise catastrophically, the same medicine as ridge regression, applied through the spectrum.

Worked example, compressing a correlation structure

Suppose a return matrix RR (days × assets) has singular values σ=(12,8,1.1,0.9,0.8,)\sigma = (12, 8, 1.1, 0.9, 0.8, \dots), a large gap after the second. The energy is σi2\sum\sigma_i^2; the top two capture 122+82σi2=208208+(1.12+0.92+)\frac{12^2 + 8^2}{\sum\sigma_i^2} = \frac{208}{208 + (1.1^2 + 0.9^2 + \dots)}, the overwhelming majority. Truncating to A2=σ1u1v1+σ2u2v2A_2 = \sigma_1 u_1 v_1^\top + \sigma_2 u_2 v_2^\top retains almost all the variance while collapsing the asset universe to two factors, say a market factor and a sector spread, and treats the remaining near-equal small singular values as noise. This is exactly how a statistical risk model is built and how PCA hedging picks the factors worth neutralising; the sharp drop from 88 to 1.11.1 is the data telling you there are two real factors, not five.

Failure modes and subtleties

  • Sign and rotation ambiguity. Singular vectors are defined up to sign, and if singular values tie, up to rotation within the shared subspace. Loadings can flip between samples; that is convention, not instability.
  • Centering and scaling matter for PCA. The SVD of a raw return matrix is not PCA, you must demean (and usually standardize) first, or the first singular vector just captures the mean/level. Mixing units without scaling lets the largest-variance asset dominate spuriously.
  • Truncation rank is a modelling choice. Where you cut the spectrum trades signal for noise; too few factors underfit risk, too many refit noise. Use the eigenvalue/singular-value gap, cross-validation, or the Marchenko–Pastur noise threshold rather than a fixed number.
  • Never form AAA^\top A to get the SVD. It squares the condition number and loses half your significant digits; use a direct SVD routine.
  • SVD is expensive at scale. Full SVD is O(mnmin(m,n))O(mn\min(m,n)); for the top-kk of a huge matrix use randomized or truncated (Lanczos) SVD instead of decomposing everything.

In interviews

The SVD's headline facts are the targets: it exists for any matrix, UU and VV are orthogonal, singular values are non-negative and equal eigenvalues of AA\sqrt{\text{eigenvalues of } A^\top A}. Expect "how is the SVD related to PCA?", PCA is the SVD (or eigen-decomposition of the covariance) of the centered data, principal components are the right singular vectors, explained variance is σi2\sigma_i^2. The Eckart–Young low-rank result is a strong thing to know by name: truncating the SVD is the optimal low-rank approximation, which grounds denoising and compression. Be ready to explain the condition number as σ1/σr\sigma_1/\sigma_r and why tiny singular values make inversion dangerous, motivating the pseudo-inverse and truncated SVD as regularization. Tie it to Positive Semidefinite Matrices (where AAA^\top A lives) and Eigenvalues & Eigenvectors to show you see the whole spectral picture.

Related concepts

Practice in interviews

Further reading

  • Trefethen & Bau, Numerical Linear Algebra
  • Strang, Introduction to Linear Algebra
  • Golub & Van Loan, Matrix Computations
ShareTwitterLinkedIn