faheem.

Linear Algebra

Singular Value Decomposition

The one decomposition that works on any matrix whatsoever. What each of its three factors is doing.

Updated May 2026

Diagonalisation needs a square matrix and a cooperative one. The SVD needs nothing:

for any matrix, with and unitary and diagonal with non-negative entries .

The geometry

Every linear map, read right to left, is: rotate (), scale along the axes (), rotate again ().

Equivalently: every matrix maps the unit sphere to an ellipsoid. The singular values are the semi-axis lengths and the columns of are their directions. There are no exceptions and no special cases.

v1v2unit sphereAσ₁u₁σ₂u₂ellipsoid
Fig. 1

The picture behind the algebra. picks which directions of the sphere to measure, stretches them by the singular values, and says where those stretched axes end up.

Where it comes from

is Hermitian and positive semi-definite whatever was, so the spectral theorem applies to it. Its eigenvectors are the columns of , and . The SVD is the spectral theorem laundered through a matrix that is guaranteed to be well behaved.

Low-rank approximation

Theorem

Eckart–Young

Truncating the SVD after terms,

gives the best rank- approximation to in both the spectral and Frobenius norms. No other rank- matrix is closer.

That optimality is what makes the SVD ubiquitous. Image compression keeps the large and discards the rest. Principal component analysis is the SVD of a centred data matrix. Latent semantic analysis is the SVD of a term–document matrix. In each case the singular values rank directions by how much variance they carry, and the tail is usually noise.

Conditioning

The condition number bounds how much a relative error in the input can be amplified in the output. A large means the ellipsoid is a long thin sliver and the inverse is dominated by whichever direction was squashed most.

Practice

The pseudoinverse

When is singular or rectangular, , inverting the non-zero singular values and transposing, gives the least-squares solution of minimum norm. Truncating small before inverting is regularisation, and it is the standard fix for an ill-posed inverse problem such as deconvolving a microscope image.

Why it beats eigendecomposition in practice

Eigenvectors of a non-symmetric matrix can be nearly parallel, which makes the change of basis numerically hostile. The SVD's bases are orthonormal by construction, so the decomposition is backward stable: the computed answer is the exact answer to a slightly perturbed problem.

For anything involving measured data, that stability is worth more than the extra structure diagonalisation would have given.