Advertisement

SVD calculator

Choose the number of rows and columns, then enter the matrix row by row. The SVD writes A as U times the diagonal singular values times V transpose.

Calculator

Orthogonal matrix U
0, 1; 1, 0
Singular values
4; 3
V transpose
0, 1; 1, 0
U times Sigma times V transpose
3, 0; 0, 4

Advertisement

How this calculator works

The singular value decomposition writes any matrix, square or rectangular, as U Sigma V transpose. U and V have orthonormal columns and Sigma is diagonal with non-negative singular values in descending order. The singular values are the square roots of the eigenvalues of A transpose A. This calculator uses one-sided Jacobi rotations, which orthogonalize the columns directly and are stable for small matrices.

Formula

A = U Sigma V^T, with U^T U = I, V^T V = I and Sigma diagonal with sigma1 >= sigma2 >= ... >= 0.

Worked example

The matrix with rows 3, 0 and 0, 4 has singular values 4 and 3. Its U and V transpose are both 0, 1; 1, 0, and the middle matrix has diagonal 4, 3. The matrix with rows 1, 2 and 3, 4 has singular values 5.464985704 and 0.3659661906.

Advertisement

Frequently asked questions

Are U and V unique?

Not always. Singular vectors can be multiplied by -1, and repeated singular values allow rotations within the corresponding subspaces. The singular values themselves are unique.

What do the singular values mean?

They are the lengths of the semi-axes of the ellipsoid that the unit ball maps to under the matrix. The largest is the 2-norm and the smallest non-zero one controls the pseudoinverse.

Can I use SVD for a rectangular matrix?

Yes. It works for every shape. This page supports matrices up to three rows by three columns, including rectangular cases.

Sources

Advertisement