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 factors as where and are orthogonal (, ) and is diagonal with non-negative entries (and zeros after), the singular values. The columns of are the left singular vectors, the columns of the right singular vectors, and is the number of nonzero singular values. Existence is unconditional, no assumptions on at all.
Relation to eigen-decomposition. The SVD is the eigen-decomposition of the symmetric Positive Semidefinite Matrices matrices and in disguise: So the right singular vectors are eigenvectors of , the left singular vectors are eigenvectors of , and the singular values are the square roots of their shared nonzero eigenvalues, . This is why singular values are always real and non-negative, they come from a PSD matrix. It also warns you numerically: forming squares the condition number, so a good SVD algorithm never actually builds it (it works on 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 right to left: rotates the input into the right singular basis, stretches each axis by its singular value (and projects out the null directions), and rotates into the output basis. A matrix maps the unit sphere to an ellipsoid whose semi-axes have lengths pointing along the columns of . The largest singular value is the maximum stretch (the spectral norm ), the smallest nonzero one is the minimum stretch, and their ratio is the condition number, the amplification of relative error, the single number that predicts whether solving 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 terms: The Eckart–Young–Mirsky theorem says is the best possible rank- approximation of in both the spectral and Frobenius norms: No rank- matrix approximates 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 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 numbers instead of ). The decay profile of the 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 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: inverting only the nonzero singular values and leaving the null directions at zero. Then is the least-squares solution, and when the solution is non-unique it selects the minimum-norm one. This reproduces when has full rank but, crucially, keeps working when is singular, where the normal equations simply have no inverse. Truncated SVD (zeroing tiny singular values before inverting) is regularization: it prevents the 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 (days × assets) has singular values , a large gap after the second. The energy is ; the top two capture , the overwhelming majority. Truncating to 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 to 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 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 ; for the top- 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, and are orthogonal, singular values are non-negative and equal . 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 . 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 and why tiny singular values make inversion dangerous, motivating the pseudo-inverse and truncated SVD as regularization. Tie it to Positive Semidefinite Matrices (where 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