The singular value decomposition is one of the most useful factorisations in applied maths: principal component analysis, image compression, latent semantic analysis, recommendation systems and solving least squares problems all rely on it.
How to use the SVD Calculator
- Choose the matrix size. The matching grid of fields appears.
- Enter the entries row by row (a₁ b₁ c₁ is the first row, a₂ b₂ c₂ the second, and so on).
- Read the result; integer matrices give exact fractions.
Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.
How it works
V comes from the eigenvectors of AᵀA and Σ from the square roots of its eigenvalues; each column of U is A·vᵢ/σᵢ, completed to an orthonormal basis.
Formula
A = U·Σ·Vᵀ, U and V orthogonal, Σ diagonal with σ₁ ≥ σ₂ ≥ … ≥ 0
Worked example
Inputs: Matrix size (rows × columns): 2 × 2; a₁: 3; b₁: 0; a₂: 4; b₂: 5.
Results: U = ⎡ 0.316228 0.948683 ⎤
⎣ 0.948683 −0.316228 ⎦; Σ = ⎡ 6.7082 0 ⎤
⎣ 0 2.23607 ⎦; Vᵀ = ⎡ 0.707107 0.707107 ⎤
⎣ 0.707107 −0.707107 ⎦; Singular values = 6.708203932, 2.236067977.
Key terms
- Singular value decomposition
- A = UΣVᵀ.
Frequently asked questions
Does every matrix have an SVD?
Yes, every real matrix, of any shape.
Is the SVD unique?
The singular values are; U and V are unique up to signs (when the values are distinct).
How does the SVD compress images?
Keeping only the largest singular values gives the best low-rank approximation.
How is it related to PCA?
The principal components are the right singular vectors of the centred data matrix.