- Introduced by
- Gene Golub
- Year
- 1965
- Type
- Linear algebra decomposition
- Family
- Matrix Factorization
What does it do?
Singular value decomposition (SVD) factorises any m × n matrix A as A = U Σ V^T, where U and V have orthonormal columns (orthogonal matrices when square) and Σ is diagonal with nonnegative singular values in descending order.
The factorisation exists for every real or complex matrix, rectangular, rank-deficient or singular included. The practical, numerically stable algorithm for computing it is usually credited to Golub and Kahan (1965).
The intuition behind the method
SVD describes how a matrix acts on space. The columns of V are input directions, and A maps each of them to a multiple of a column of U, with the stretch factor given by the corresponding singular value σ_i. Large singular values mark the directions in which the matrix has the most effect. Small singular values often correspond to noise or redundant structure, so truncating them gives a low-rank approximation that keeps the dominant structure. This is the basis of its use in dimensionality reduction, regression and compression.
History
The practical algorithm for computing singular values and the pseudo-inverse was published by Golub and Kahan in 1965 in the Journal of the SIAM, Series B: Numerical Analysis (citation golub1970). Their scheme first reduces A to a bidiagonal matrix and then diagonalises it, and it avoids the computational difficulties that affected some earlier methods. Golub and Van Loan's textbook Matrix Computations (citation golub1983) made the SVD a standard tool for numerical practitioners. Trefethen and Bau's Numerical Linear Algebra (citation trefethen1997) is a further standard reference for the method.
When to use it
Use SVD when a linear system is ill-conditioned or rank-deficient, when the rank or null space of a matrix must be determined, for least-squares problems where the pseudo-inverse is needed, and for low-rank approximation, denoising or compression of a matrix. It is the reference method when numerical stability matters more than speed. Do not use full dense SVD on very large matrices unless their structure is exploited, because its cost (O(m n²) or O(m² n)) becomes prohibitive; for large sparse matrices, a partial iterative method such as Lanczos is usually the better choice. For a square non-symmetric matrix whose eigenvectors are the target, an eigendecomposition answers a different question and SVD does not return eigenvectors.
Limitations and considerations
- Full SVD costs O(m n²) or O(m² n) operations, which is prohibitive for very large dense matrices.
- Full SVD stores U as an m × m matrix and V as an n × n matrix, so its memory requirement grows with the squares of the dimensions and not only with mn; thin SVD or randomised methods reduce this cost.
- Applied to a large sparse matrix, full SVD produces dense factors and loses the sparsity advantage; a partial iterative method such as Lanczos is needed in that setting.
- Singular values are unique, but singular vectors are determined only up to sign. When singular values repeat or lie close together, the individual singular vectors are not uniquely determined, so the truncated subspace is well defined but its individual directions are not.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Truncated SVD keeps the leading singular components and discards small ones, which is the mechanism behind its use for denoising and low-rank approximation.
- In exact arithmetic the number of nonzero singular values equals the rank; in floating-point computation the rank must be estimated with a threshold, which is a known and explicit step.
- The orthogonal factors U and V do not amplify rounding errors, which makes the decomposition a stable basis for projections and for the pseudo-inverse.
- The method applies to rectangular, singular and complex matrices and does not require positive definiteness or squareness.
Applications
- Principal component analysis (PCA), which is computed through the SVD of a centred data matrix, for dimensionality reduction of high-dimensional data such as gene expression.
- Low-rank image approximation, in which a truncated SVD keeps the dominant components of an image matrix.
- Recommendation systems, where low-rank factorisation of a user-item rating matrix is used in collaborative filtering.
- Noise reduction, by truncating small singular values of a signal or image matrix.
- Least-squares regression and rank-deficient linear systems, by computing the pseudo-inverse A^† = V Σ^† U^T.
How it works
How it works
Provide the m × n matrix A and choose an algorithm suited to its size and sparsity. For a dense matrix of moderate size, a direct method is standard; for a large sparse matrix, a partial or iterative method computes only the leading singular triplets.
Compute the decomposition. The Golub–Kahan approach first reduces A by orthogonal transformations to a bidiagonal matrix, then diagonalises that matrix iteratively, which yields U, Σ and V with Σ = U^T A V in the real case. The singular values are the square roots of the eigenvalues of A^T A, but forming A^T A explicitly is avoided in stable implementations because it squares the condition number.
Formula
\Sigma = U^{*} A VRead off the factors: U and V hold the left and right singular vectors, and Σ holds the singular values in descending order. Keeping only the first k singular triplets gives the truncated representation A_k = U_k Σ_k V_k^T, which is the best rank-k approximation in the Frobenius norm. The pseudo-inverse A^† = V Σ^† U^T is obtained from the same factors, inverting only the nonzero singular values.
Formula
A^{\dagger} = V \Sigma^{\dagger} U^{*}Measure the fit of a truncated factorisation by the Frobenius reconstruction error ||A − U_k Σ_k V_k^T||_F. Check numerical rank by counting singular values above a threshold, and assess conditioning through the ratio σ_max / σ_min. The threshold and the choice of k are judgements that should be justified for the data at hand, not taken as given.
Common pitfalls
- Computing the SVD of an uncentred data matrix makes the first singular vector track the mean direction rather than the principal variance directions; centre the columns first if the goal is principal components.
- Calling a dense SVD routine on a large sparse matrix densifies it and can exhaust memory; use a sparse or partial SVD.
- Choosing the number of retained singular values without justification; the scree plot, a cross-validation criterion or a noise-level argument should guide the choice.
- Treating SVD and eigendecomposition as interchangeable: SVD applies to rectangular matrices, and its singular values are not eigenvalues of a non-symmetric matrix.
Frequently asked questions
Why is SVD more stable than LU factorisation for solving Ax = b?
LU factorisation can produce large factors when pivoting is limited, so rounding errors can be amplified for ill-conditioned A. The orthogonal factors U and V have condition number 1 and do not amplify errors when applied. The sensitivity of an ill-conditioned problem lies in the singular values in Σ, which is why truncating small singular values is a direct way to regularise such problems.
How do I determine the numerical rank of a matrix?
Compute the singular values and count those above a threshold chosen relative to the largest singular value and to the machine precision scaled by the matrix size. The threshold is a modelling choice rather than an exact property of the matrix, so report it and check how sensitive the rank is to it. Data-driven criteria, such as the L-curve or generalised cross-validation, can also guide the choice in regularisation problems.
What is the difference between full and thin SVD?
Full SVD returns U as m × m and V as n × n, so it provides complete orthonormal bases including the null spaces. Thin SVD keeps only min(m, n) columns of U and V, which is sufficient for most applications and uses less memory. Compact SVD keeps only the r columns associated with nonzero singular values, where r is the rank of A.
Can I use SVD to obtain the eigenvalues of a square matrix?
For a symmetric matrix, the singular values are the absolute values of the eigenvalues, and the singular vectors coincide with the eigenvectors when all eigenvalues are nonnegative; with negative eigenvalues the corresponding columns of U and V differ by a sign. For a non-symmetric matrix, the singular values do not give its eigenvalues, so an eigendecomposition method such as QR iteration or a Krylov method should be used instead.
Sources
Golub, G. H., & Kahan, W. (1970). Calculating the singular values and pseudo-inverse of a matrix. Journal of the SIAM Series B: Numerical Analysis, 2(2), 205–224.
Open DOI referenceGolub, G. H., & Van Loan, C. F. (1983). Matrix computations (2nd ed.). Johns Hopkins University Press.
ISBN: 0801854148Trefethen, L. N., & Bau, D. (1997). Numerical Linear Algebra. SIAM.
Open DOI reference2014_Book_DataAnalysis, p. 384