Lably
Skip to content

Singular value decomposition

Matrix decomposition

  • 34 min read
  • 10 chapters

Related on Lably

Through Linear algebra, Real number and Complex number

Specifically, the singular value decomposition of an m×n complex matrix ⁠M⁠ is a factorization of the form ⁠M=UΣV∗⁠, where ⁠U⁠ is an ⁠m×m⁠ complex unitary matrix, Σ is an m×n rectangular diagonal matrix with non-negative real numbers on the diagonal, ⁠V⁠ is an n×n complex unitary matrix, and ⁠V∗⁠ is the conjugate transpose of ⁠V⁠. Such decompositions always exist for any complex matrix. If ⁠M⁠ is real, then some ⁠U⁠ and ⁠V⁠ can be found which are real (orthogonal) matrices; a real-valued SVD is often denoted ⁠UΣVT⁠, where ⁠VT⁠ is the transpose of ⁠V⁠.

The diagonal entries σi=Σi,i of Σ are uniquely determined by ⁠M⁠, up to reordering, and are known as the singular values of ⁠M⁠. Conventionally they are arranged in descending order (from largest to smallest), which uniquely determines ⁠Σ⁠. The number of non-zero singular values, allowing repetitions, is equal to ⁠r⁠, the rank of ⁠M⁠.

The columns of ⁠U⁠ and the columns of ⁠V⁠ are called left-singular vectors and right-singular vectors of ⁠M⁠, respectively. They form two orthonormal bases, ⁠{u1,…,um}⁠ and ⁠{v1,…,vn}⁠. In general the SVD is not unique, with certain unitary transformations of ⁠U⁠ and ⁠V⁠ producing valid alternative decompositions.

The term SVD sometimes refers to the compact SVD, a similar decomposition ⁠M=UrΣrVr∗⁠, in which ⁠Σr⁠ is an ⁠r×r⁠ matrix with only the non-zero singular values (allowing repetitions) on its main diagonal. In this variant, ⁠Ur⁠ is an ⁠m×r⁠ semi-unitary matrix whose columns ⁠{u1,…,ur}⁠ span the columns of ⁠M⁠, and Vr is an ⁠n×r⁠ semi-unitary matrix whose columns ⁠{v1,…,vr}⁠ span the columns of ⁠M∗⁠.

The SVD (with sorted singular values) splits ⁠M⁠ into a sum of ⁠r⁠ rank-⁠1⁠ matrices, M=σ1u1v1∗+σ2u2v2∗+⋯+σrurvr∗.

Mathematical applications of the SVD include computing the pseudoinverse, matrix approximation, and determining the rank, range, and null space of a matrix. The SVD is also extremely useful in many areas of science, engineering, and statistics, such as signal processing, least squares fitting of data, and process control.

Intuitive interpretations

Rotation/reflection, coordinate scaling, rotation/reflection

In the special case when ⁠M⁠ is an ⁠m×m⁠ real square matrix, the matrices ⁠U⁠ and ⁠V∗⁠ can be chosen to be real orthogonal ⁠m×m⁠ matrices. ⁠M⁠ can be interpreted to represent a linear transformation ⁠x↦Mx⁠ of the Euclidean space ⁠Rm⁠; then the matrices ⁠U⁠ and ⁠V∗⁠ represent rotations or reflections of the space, while ⁠Σ⁠ represents the scaling of each coordinate ⁠xi⁠ by the factor ⁠σi⁠. Thus the SVD decomposition breaks down any linear transformation of ⁠Rm⁠ into a composition of three geometric transformations: a rotation or reflection ⁠V∗⁠ followed by a coordinate-by-coordinate scaling ⁠Σ⁠ followed by another rotation or reflection ⁠U⁠.

In particular, if ⁠M⁠ has a positive determinant, then ⁠U⁠ and ⁠V∗⁠ can be chosen to be both rotations with reflections, or both rotations without reflections. If the determinant is negative, exactly one of them will have a reflection. If the determinant is zero, each can be independently chosen to be of either type.

In the more general case when the matrix ⁠M⁠ is real but not square, namely ⁠m×n⁠ with ⁠m≠n⁠, it can be interpreted as a linear transformation from ⁠Rn⁠ to ⁠Rm⁠. Then ⁠U⁠ and ⁠V∗⁠ can be chosen to be rotations/reflections of ⁠Rm⁠ and ⁠Rn⁠, respectively; and ⁠Σ⁠, besides scaling the first ⁠min{m,n}⁠ coordinates, also extends the vector with zeros and Σ, i.e. removes trailing coordinates, so as to turn ⁠Rn⁠ into ⁠Rm⁠.

Singular values as semiaxes of an ellipse or ellipsoid

As shown in the figure, the singular values can be interpreted as the magnitude of the semiaxes of an ellipse in 2D. This concept can be generalized to ⁠n⁠-dimensional Euclidean space, with the singular values of any ⁠n×n⁠ square matrix being viewed as the magnitude of the semiaxis of an ⁠n⁠-dimensional ellipsoid. Similarly, the singular values of any ⁠m×n⁠ matrix can be viewed as the magnitude of the semiaxis of an ⁠n⁠-dimensional ellipsoid in ⁠m⁠-dimensional space, for example as an ellipse in a (tilted) 2D plane in a 3D space. Singular values encode magnitude of the semiaxis, while singular vectors encode direction. See below for further details.

The columns of U and V are orthonormal bases

Since ⁠U⁠ and ⁠V∗⁠ are unitary, the columns of each of them form a set of orthonormal vectors, which can be regarded as basis vectors. The matrix ⁠M⁠ maps the basis vector ⁠vi⁠ to the stretched unit vector ⁠σiui⁠. By the definition of a unitary matrix, the same is true for their conjugate transposes ⁠U∗⁠ and ⁠V⁠, except the geometric interpretation of the singular values as stretches is lost. In short, the columns of ⁠U⁠, ⁠U∗⁠, ⁠V⁠, and ⁠V∗⁠ are orthonormal bases. When ⁠M⁠ is a positive-semidefinite Hermitian matrix, ⁠U⁠ and ⁠V⁠ are both equal to the unitary matrix used to diagonalize ⁠M⁠. However, when ⁠M⁠ is not positive-semidefinite and Hermitian but still diagonalizable, its eigendecomposition and singular value decomposition are distinct.

Relation to the four fundamental subspaces

  • The first ⁠r⁠ columns of ⁠U⁠ are a basis of the column space of ⁠M⁠.
  • The last ⁠m−r⁠ columns of ⁠U⁠ are a basis of the null space of ⁠M∗⁠.
  • The first ⁠r⁠ columns of ⁠V⁠ are a basis of the column space of ⁠M∗⁠ (the row space of ⁠M⁠ in the real case).
  • The last ⁠n−r⁠ columns of ⁠V⁠ are a basis of the null space of ⁠M⁠.

Geometric meaning

Because ⁠U⁠ and ⁠V⁠ are unitary, the columns ⁠u1,…,um⁠ of ⁠U⁠ are an orthonormal basis of ⁠Cm⁠ and the columns ⁠v1,…,vn⁠ of ⁠V⁠ are an orthonormal basis of ⁠Cn⁠ (with respect to the standard scalar products on these spaces).

The linear transformation T:{Cn→Cmx↦Mx has a particularly simple description with respect to these orthonormal bases: we have T(vi)=σiui,i=1,…,min{m,n}, where ⁠σi⁠ is the ⁠i⁠-th diagonal entry of ⁠Σ⁠, and ⁠T(vi)=0⁠ for ⁠i>min{m,n}⁠.

The geometric content of the SVD theorem can thus be summarized as follows: for every linear map ⁠T:Cn→Cm⁠ one can find orthonormal bases of ⁠Cn⁠ and ⁠Cm⁠ such that ⁠T⁠ maps the ⁠i⁠-th basis vector of ⁠Cn⁠ to a non-negative multiple of the ⁠i⁠-th basis vector of ⁠Cm⁠, and sends the leftover basis vectors to zero. With respect to these bases, the map ⁠T⁠ is therefore represented by a diagonal matrix with non-negative real diagonal entries.

To get a more visual flavor of singular values and SVD factorization – at least when working on real vector spaces – consider the unit sphere ⁠S⁠ in ⁠Rn⁠. The linear map ⁠T⁠ maps this sphere onto an ellipsoid in ⁠Rm⁠. Non-zero singular values are simply the lengths of the semi-axes of this ellipsoid. Especially when ⁠n=m⁠, and all the singular values are distinct and non-zero, the SVD of the linear map ⁠T⁠ can be easily analyzed as a succession of three consecutive moves: consider the ellipsoid ⁠T(S)⁠ and specifically its axes; then consider the directions in ⁠Rn⁠ sent by ⁠T⁠ onto these axes. These directions happen to be mutually orthogonal. Apply first an isometry ⁠V∗⁠ sending these directions to the coordinate axes of ⁠Rn⁠. On a second move, apply an endomorphism ⁠D⁠ diagonalized along the coordinate axes and stretching or shrinking in each direction, using the semi-axis lengths of ⁠T(S)⁠ as scaling coefficients. The composition ⁠D∘V∗⁠ then sends the unit-sphere onto an ellipsoid isometric to ⁠T(S)⁠. To define the third and last move, apply an isometry ⁠U⁠ to this ellipsoid to obtain ⁠T(S)⁠. As can be easily checked, the composition ⁠U∘D∘V∗⁠ coincides with ⁠T⁠.

Sign in to keep reading

9 more chapters are free with a Lably account.

More in Topics in mathematics