Post · 6 min read· pp. 641–644

What Is the Singular Value Decomposition?

A singular value decomposition (SVD) of a matrix A∈Rm×nA\in\mathbb{R}^{m\times n} is a factorization

A=UΣVT,\notag A = U\Sigma V^T,

where U∈Rm×mU\in\mathbb{R}^{m\times m} and V∈Rn×nV\in\mathbb{R}^{n\times n} are orthogonal, Σ=diag(σ1,…,σp)∈Rm×n\Sigma = \mathrm{diag}(\sigma_1,\dots, \sigma_p)\in\mathbb{R}^{m\times n}, where p=min⁡(m,n)p = \min(m,n), and σ1≥σ2≥⋯≥σp≥0\sigma_1\ge \sigma_2\ge \cdots \ge \sigma_p \ge 0.

Partition U=[u1,…,um]U =[ u_1,\dots,u_m] and V=[v1,…,vn]V = [v_1,\dots, v_n]. The σi\sigma_i are called the singular values of AA and the uiu_i and viv_i are the left and right singular vectors. We have Avi=σiuiAv_i = \sigma_i u_i, i=1 ⁣:pi = 1 \colon p. The matrix Σ\Sigma is unique but UU and VV are not. The form of Σ\Sigma is

\notag \Sigma = \left[\begin{array}{ccc}\sigma_1&&\\ &\ddots&\\& &\sigma_n\\\hline &\rule{0cm}{15pt} \text{\Large 0} & \end{array}\right] \mathrm{for}~ m \ge n, \quad \Sigma = \begin{bmatrix} \begin{array}{ccc|c@{\mskip5mu}}\sigma_1&&\\ &\ddots& & \text{\Large 0} \\& &\sigma_m\end{array}\\ \end{bmatrix} \mathrm{for}~ m \le n

Here is an example, in which the entries of AA have been specially chosen to give simple forms for the elements of the factors:

A=[043−1−53−2−23]=13[1−2−2−21−2−2−21]⏟U  [2 200200]⏟Σ  12[111−1]⏟VT.\notag A = \left[\begin{array}{rr} 0 & \frac{4}{3}\\[3pt] -1 & -\frac{5}{3}\\[3pt] -2 & -\frac{2}{3} \end{array}\right] = \underbrace{ \displaystyle\frac{1}{3} \left[\begin{array}{rrr} 1 & -2 & -2\\ -2 & 1 & -2\\ -2 & -2 & 1 \end{array}\right] }_U \mskip5mu \underbrace{ \left[\begin{array}{cc} 2\,\sqrt{2} & 0\\ 0 & \sqrt{2}\\ 0 & 0 \end{array}\right] }_{\Sigma} \mskip5mu \underbrace{ \displaystyle\frac{1}{\sqrt{2}} \left[\begin{array}{cc} 1 & 1\\ 1 & -1 \end{array}\right] }_{V^T}.

The power of the SVD is that it reveals a great deal of useful information about norms, rank, and subspaces of a matrix and it enables many problems to be reduced to a trivial form.

Since UU and VV are nonsingular, rank(A)=rank(Σ)=r\mathrm{rank}(A) = \mathrm{rank}(\Sigma) = r, where r≤pr \le p is the number of nonzero singular values. Since the 22-norm and Frobenius norm are invariant under orthogonal transformations, ∥A∥=∥Σ∥\|A\| = \|\Sigma\| for both norms, giving

∥A∥2=σ1,∥A∥F=(∑i=1rσi2)1/2,\notag \|A\|_2 = \sigma_1, \quad \|A\|_F = \Bigl(\displaystyle\sum_{i=1}^r \sigma_i^2\Bigr)^{1/2},

and hence ∥A∥2≤∥A∥F≤r1/2∥A∥2\|A\|_2 \le \|A\|_F \le r^{1/2} \|A\|_2. The range space and null space of AA are given in terms of the columns of UU and VV by

null(A)=span{vr+1,…,vn},range(A)=span{u1,u2,…,ur}.\notag \begin{aligned} \mathrm{null}(A) &= \mathrm{span} \{ v_{r+1}, \dots,v_n \},\\ \mathrm{range}(A) &= \mathrm{span} \{u_1,u_2,\dots, u_r\}. \end{aligned}

We can write the SVD as

A=[u1,u2…,ur]diag(σ1,…,σr)[v1Tv2T⋮vrT]=∑i=1rσiuiviT,(∗)\notag \qquad\qquad A = \begin{bmatrix} u_1, u_2 \dots, u_r \end{bmatrix} \mathrm{diag}(\sigma_1,\dots, \sigma_r) \begin{bmatrix} v_1^T\\ v_2^T\\ \vdots\\ v_r^T \end{bmatrix} = \displaystyle\sum_{i=1}^{r} \sigma_i u_i v_i^T, \qquad\qquad(*)

which expresses AA as a sum of rr rank-11 matrices, the iith of which has 22-norm σi\sigma_i. The famous Eckart–Young theorem (1936) says that

min⁡rank(B)=k∥A−B∥q={σk+1,q=2,(∑i=k+1rσi2)1/2,q=F,\notag \min_{\mathrm{rank}(B) = k} \|A-B\|_q = \begin{cases} \sigma_{k+1}, & q = 2, \\ \Bigl(\sum_{i=k+1}^r \sigma_i^2\Bigr)^{1/2}, & q = F, \end{cases}

and that the minimum is attained at

Ak=UDkVT,Dk=diag(σ1,…,σk,0,…,0).\notag A_k = U D_k V^T, \quad D_k = \mathrm{diag}(\sigma_1, \dots, \sigma_k, 0, \dots, 0).

In other words, truncating the sum (∗)(*) after k<rk < r terms gives the best rank-kk approximation to AA in both the 22-norm and the Frobenius norm. In particular, this result implies that when AA has full rank the distance from AA to the nearest rank-deficient matrix is σr\sigma_r.

Relations with Symmetric Eigenvalue Problem

The SVD is not directly related to the eigenvalues and eigenvectors of AA. However, for m≥nm\ge n, A=UΣVTA = U \Sigma V^T implies

AT ⁣A=Vdiag(σ12,…,σn2)VT,AAT=Udiag(σ12,…,σn2,0,…,0⏟m−n)UT,\notag A^T\!A = V \mathrm{diag}(\sigma_1^2,\dots,\sigma_n^2) V^T, \quad AA^T = U \mathrm{diag}(\sigma_1^2,\dots,\sigma_n^2,\underbrace{0,\dots,0}_{m-n}) U^T,

so the singular values of AA are the square roots of the eigenvalues of the symmetric positive semidefinite matrices AT ⁣AA^T\!A and AATAA^T (modulo m−nm-n zeros in the latter case), and the singular vectors are eigenvectors. Moreover, the eigenvalues of the (m+n)×(m+n)(m+n)\times (m+n) matrix

C=[0AAT0]\notag C = \begin{bmatrix} 0 & A \\ A^T & 0 \end{bmatrix}

are plus and minus the singular values of AA, together with ∣m−n∣|m-n| additional zeros if m≠nm \ne n, and the eigenvectors of CC and the singular vectors of AA are also related.

Consequently, by applying results or algorithms for the eigensystem of a symmetric matrix to AT ⁣AA^T\!A, AATAA^T, or CC one obtains results or algorithms for the singular value decomposition of AA.

Connections with Other Problems

The pseudoinverse of a matrix A∈Rn×nA\in\mathbb{R}^{n\times n} can be expressed in terms of the SVD as

A+=Vdiag(σ1−1,…,σr−1,0,…,0)UT.\notag A^+ = V\mathrm{diag}(\sigma_1^{-1},\dots,\sigma_r^{-1},0,\dots,0)U^T.

The least squares problem min⁡x∥b−Ax∥2\min_x \|b - Ax\|_2, where A∈Rm×nA\in\mathbb{R}^{m\times n} with m≥nm \ge n is solved by x=A+bx = A^+b, and when AA is rank-deficient this is the solution of minimum 22-norm. For m<nm < n this is an underdetermined system and x=A+bx = A^+b gives the minimum 2-norm solution.

We can write A=UΣVT=UVT⋅VΣVT≡PQA = U\Sigma V^T = UV^T \cdot V \Sigma V^T \equiv PQ, where PP is orthogonal and QQ is symmetric positive semidefinite. This decomposition A=PQA = PQ is the polar decomposition and Q=(AT ⁣A)1/2Q = (A^T\!A)^{1/2} is unique. This connection between the SVD and the polar decomposition is useful both theoretically and computationally.

Applications

The SVD is used in a very wide variety of applications—too many and varied to attempt to summarize here. We just mention two.

The SVD can be used to help identify to which letters vowels and consonants have been mapped in a substitution cipher (Moler and Morrison, 1983).

An inverse use of the SVD is to construct test matrices by forming a diagonal matrix of singular values from some distribution then pre- and post-multiplying by random orthogonal matrices. The result is matrices with known singular values and 2-norm condition number that are nevertheless random. Such “randsvd” matrices are widely used to test algorithms in numerical linear algebra.

History and Computation

The SVD was introduced independently by Beltrami in 1873 and Jordan in 1874. Golub popularized the SVD as an essential computational tool and developed the first reliable algorithms for computing it. The Golub–Reinsch algorithm, dating from the late 1960s and based on bidiagonalization and the QR algorithm, is the standard way to compute the SVD. Various alternatives are available; see the references.

References

This is a minimal set of references, which contain further useful references within.

This article is part of the “What Is” series, available from https://nhigham.com/category/what-is and in PDF form from the GitHub repository https://github.com/higham/what-is.