Skip to content
Hub Nexus
Linear Algebra

Linear Algebra, Singular Value Decomposition

Up for GrabsUpdated 9 min read

Comments and detailsChangesSupport

Singular Value Decomposition

Given any m × n matrix A, the singular value decomposition (SVD) is A = U Σ {V}^{H} where U is an m × m unitary matrix, V is an n × n unitary matrix, and Σ is an m × n diagonal matrix where all off-diagonal entries are 0 and the diagonal entries are all non-negative real values. The diagonal entries of Σ are referred to as "singular values".

As an example, consider the shear transformation A = ( \begin{matrix}1 & 2 \\ 0 & 1\end{matrix} ). The singular value decomposition of A is:

( \begin{matrix}1 & 2 \\ 0 & 1\end{matrix} ) = ( \begin{matrix}0.9239 & − 0.3827 \\ 0.3827 & 0.9239\end{matrix} ) ( \begin{matrix}2.4142 & 0 \\ 0 & 0.4142\end{matrix} ) ( \begin{matrix}0.3827 & 0.9239 \\ − 0.9239 & 0.3827\end{matrix} )

The set of all unit length vectors \overset{→}{v} such that | \overset{→}{v} | = 1 form a sphere of radius 1 around the origin. When A is applied to this sphere, it becomes an ellipsoid. The principal radii of this ellipsoid are the singular values, and their directions form the columns of U.

Existence of the singular value decomposition

One fact that is not immediately obvious is that the singular value decomposition always exists:

Theorem (existence of the singular value decomposition)

Given any m × n matrix A, there exists m × m unitary matrix U, n × n unitary matrix V, and m × n diagonal matrix Σ where all off-diagonal entries are 0 and the diagonal entries are all non-negative real values such that A = U Σ {V}^{H}.

In essence, any linear transformation is a rotation, followed by stretching or shrinking parallel to each axis (with some dimensions added or zeroed out of existence), followed by another rotation.

The following proof will demonstrate that the singular value decomposition always exists. An outline of the proof will be given first:

Proof outline

We need to prove that an arbitrary linear transform A is a rotation: {V}^{H}, followed by scaling parallel to each axis: Σ, and lastly followed by another rotation: U, giving A = U Σ {V}^{H}.

If the columns of A are already mutually orthogonal, then the first rotation is not necessary: V = I. The entries of Σ are the lengths of the vectors formed by the columns of A, and U is a rotation that rotates the elementary basis vectors of {ℂ}^{m} to be parallel with the columns of A.

In most cases however, the columns of A are not mutually orthogonal. In this case, the rotation {V}^{H} is non-trivial. A = ( A V ) {V}^{H}, so V must be chosen so that the columns of A V are mutually orthogonal. Let V = ( \begin{matrix}{\overset{→}{v}}_{1} & {\overset{→}{v}}_{2} & … & {\overset{→}{v}}_{n}\end{matrix} ). We need to choose orthonormal vectors {\overset{→}{v}}_{1} , {\overset{→}{v}}_{2} , … , {\overset{→}{v}}_{n} so that A {\overset{→}{v}}_{1} , A {\overset{→}{v}}_{2} , … , A {\overset{→}{v}}_{n} are all mutually orthogonal. This can be done iteratively. Imagine that we have chosen {\overset{→}{v}}_{1} so that when given any vector \overset{→}{v} that is orthogonal to {\overset{→}{v}}_{1}, that A {\overset{→}{v}}_{1} is orthogonal to A \overset{→}{v}. The effort now switches to finding an orthonormal set of vectors {\overset{→}{v}}_{2} , {\overset{→}{v}}_{3} , … , {\overset{→}{v}}_{n} confined to the space of vectors that are perpendicular to {\overset{→}{v}}_{1} such that A {\overset{→}{v}}_{2} , A {\overset{→}{v}}_{3} , … , A {\overset{→}{v}}_{n} are mutually orthogonal.

Let {V}_{1} be a unitary matrix with {\overset{→}{v}}_{1} as the first column. Factoring {V}_{1} from the left side of V to get V = {V}_{1} {V}_{\text{new}} results in a new set of orthonormal vectors that are the columns of {V}_{\text{new}}. The goal of having the columns of A V be mutually orthogonal is converted to having the columns of ( A {V}_{1} ) {V}_{\text{new}} be mutually orthogonal with A {V}_{1} effectively replacing A. {\overset{→}{v}}_{1} transforms to {\overset{→}{e}}_{1}, and the space of vectors orthogonal to {\overset{→}{v}}_{1} transforms to the space spanned by the standard basis vectors {\overset{→}{e}}_{2} , {\overset{→}{e}}_{3} , … , {\overset{→}{e}}_{n}. The first column of A {V}_{1} is A {\overset{→}{v}}_{1} and so is orthogonal to all other columns.

If {U}_{1} is a unitary matrix where the first column of {U}_{1} is A {\overset{→}{v}}_{1} normalized to unit length, then factoring {U}_{1} from the left side of A {V}_{1} to get {A}_{1} = {U}_{1}^{H} A {V}_{1} results in a matrix in which the first column is parallel to the standard basis vector {\overset{→}{e}}_{1}. The first column of A {V}_{1} is orthogonal to all other columns, so the first column of {A}_{1} is orthogonal to all other columns, so hence the first row of {A}_{1} contains all 0s except for the first column.

{\overset{→}{v}}_{2} , {\overset{→}{v}}_{3} , … , {\overset{→}{v}}_{n} can now be determined recursively with the dimension reduced to n − 1, and A is replaced with {A}_{1} with the first row and column removed. This forms the inductive component of the coming proof.

Lastly, how do we know that there exists {\overset{→}{v}}_{1} so that when given any vector \overset{→}{v} that is orthogonal to {\overset{→}{v}}_{1}, that A {\overset{→}{v}}_{1} is orthogonal to A \overset{→}{v}? The answer will be that the unit length \overset{→}{v} that maximizes | A \overset{→}{v} | is a valid {\overset{→}{v}}_{1}.

We are now ready to give the proof in full detail:

Proof of the existence of the singular value decomposition

This proof will proceed using induction on both m and n.

Base Case m = 1

A has a single row, and therefore has the form A = ( \begin{matrix}{σ}_{1} {\overset{→}{v}}_{1}^{H}\end{matrix} ) where {\overset{→}{v}}_{1} is an arbitrary unit length vector, and {σ}_{1} is an arbitrary non-negative real number. Note that {\overset{→}{v}}_{1} and {σ}_{1} exist for any single row matrix A.

Let U = ( \begin{matrix}1\end{matrix} ), Σ = ( \begin{matrix}{σ}_{1} & 0 & … & 0\end{matrix} ), and V = ( \begin{matrix}{\overset{→}{v}}_{1} & {\overset{→}{v}}_{2} & … & {\overset{→}{v}}_{n}\end{matrix} ) where {\overset{→}{v}}_{1} , {\overset{→}{v}}_{2} , … , {\overset{→}{v}}_{n} together form an mutually orthogonal set of unit length vectors. {\overset{→}{v}}_{2} , {\overset{→}{v}}_{3} , … , {\overset{→}{v}}_{n} can be determined via Gram-Schmidt orthogonalization. It is clear that: A = U Σ {V}^{H}.

Base Case n = 1

A has a single column, and therefore has the form A = ( \begin{matrix}{σ}_{1} {\overset{→}{u}}_{1}\end{matrix} ) where {\overset{→}{u}}_{1} is an arbitrary unit length vector, and {σ}_{1} is an arbitrary non-negative real number. Note that {\overset{→}{u}}_{1} and {σ}_{1} exist for any single column matrix A.

Let U = ( \begin{matrix}{\overset{→}{u}}_{1} & {\overset{→}{u}}_{2} & … & {\overset{→}{u}}_{m}\end{matrix} ), Σ = ( \begin{matrix}{σ}_{1} \\ 0 \\ ⋮ \\ 0\end{matrix} ), and V = ( \begin{matrix}1\end{matrix} ) where {\overset{→}{u}}_{1} , {\overset{→}{u}}_{2} , … , {\overset{→}{u}}_{m} together form an mutually orthogonal set of unit length vectors. {\overset{→}{u}}_{2} , {\overset{→}{u}}_{3} , … , {\overset{→}{u}}_{m} can be determined via Gram-Schmidt orthogonalization. It is clear that: A = U Σ {V}^{H}.

Inductive Case m , n ≥ 2

Let {\overset{→}{e}}_{k , i} denote the {i}^{\text{th}} standard basis vector of {ℂ}^{k}. Let {𝟎}_{k × l} denote a k × l matrix of 0s.

Maximize | A \overset{→}{v} | subject to the constraint | \overset{→}{v} | = 1. Let {\overset{→}{v}}_{1} be a unit length vector that maximizes | A \overset{→}{v} |, and let {σ}_{1} = | A {\overset{→}{v}}_{1} |. Let {\overset{→}{u}}_{1} = \frac{A {\overset{→}{v}}_{1}}{{σ}_{1}} (if {σ}_{1} = 0, then {\overset{→}{u}}_{1} is an arbitrary unit length vector).

Using Gram-Schmidt orthogonalization, unitary matrices {U}_{1} and {V}_{1} can be determined such that the first columns of {U}_{1} and {V}_{1} respectively are {\overset{→}{u}}_{1} and {\overset{→}{v}}_{1}: {U}_{1} {\overset{→}{e}}_{m , 1} = {\overset{→}{u}}_{1} and {V}_{1} {\overset{→}{e}}_{n , 1} = {\overset{→}{v}}_{1}. A = {U}_{1} {A}_{1} {V}_{1}^{H} where {A}_{1} = {U}_{1}^{H} A {V}_{1}. It will now be proven that the first column and row of {A}_{1} contain all 0s except for the (1,1) entry which contains {σ}_{1}: {A}_{1} = ( \begin{matrix}{σ}_{1} & {𝟎}_{1 × ( n − 1 )} \\ {𝟎}_{( m − 1 ) × 1} & {A}_{\text{reduced}}\end{matrix} ).

A {\overset{→}{v}}_{1} = {σ}_{1} {\overset{→}{u}}_{1} \ ⟹ \ {U}_{1} {A}_{1} {V}_{1}^{H} {\overset{→}{v}}_{1} = {σ}_{1} {\overset{→}{u}}_{1} \ ⟹ \ {A}_{1} {\overset{→}{e}}_{n , 1} = {σ}_{1} {\overset{→}{e}}_{m , 1}. This means that the first column of {A}_{1} is {σ}_{1} {\overset{→}{e}}_{m , 1} = ( \begin{matrix}{σ}_{1} \\ {𝟎}_{( m − 1 ) × 1}\end{matrix} ).

To show that the first row of {A}_{1} is {σ}_{1} {\overset{→}{e}}_{n , 1}^{H} = ( \begin{matrix}{σ}_{1} & {𝟎}_{1 × ( n − 1 )}\end{matrix} ), we will show that the first column of {A}_{1} is orthogonal to all of the other columns of {A}_{1}. This will require exploiting the fact that \overset{→}{v} = {\overset{→}{e}}_{n , 1} maximizes | {A}_{1} \overset{→}{v} | subject to the constraint | \overset{→}{v} | = 1.

Let v ( t ) be a parameterized unit length vector. Let v ( 0 ) = {\overset{→}{e}}_{n , 1}.

Taking the derivative of the constraint {v}^{H} v = 1 gives \frac{d {v}^{H}}{d t} v + {v}^{H} \frac{d v}{d t} = 0

| {A}_{1} \overset{→}{v} | being maximized at {\overset{→}{e}}_{n , 1} gives:

\frac{d}{d t} ( | {A}_{1} \overset{→}{v} {|}^{2} ) {|}_{t = 0} = 0 \ ⟺ \ \frac{d}{d t} ( {\overset{→}{v}}^{H} {A}_{1}^{H} {A}_{1} \overset{→}{v} ) {|}_{t = 0} = 0 \ ⟺ \ \frac{d {\overset{→}{v}}^{H}}{d t} {|}_{t = 0} {A}_{1}^{H} {A}_{1} {\overset{→}{e}}_{n , 1} + {\overset{→}{e}}_{n , 1}^{H} {A}_{1}^{H} {A}_{1} \frac{d \overset{→}{v}}{d t} {|}_{t = 0} = 0

\ ⟺ \ ℜ ( {\overset{→}{e}}_{n , 1}^{H} {A}_{1}^{H} {A}_{1} \frac{d \overset{→}{v}}{d t} {|}_{t = 0} ) = 0

(ℜ and ℑ denote the real and imaginary components of a complex number respectively.)

Let i = 2 , 3 , … , n be arbitrary. Let \frac{d \overset{→}{v}}{d t} {|}_{t = 0} = {\overset{→}{e}}_{n , i}. {\overset{→}{e}}_{n , 1} and {\overset{→}{e}}_{n , i} are orthogonal.

This gives: ℜ ( {\overset{→}{e}}_{n , 1}^{H} {A}_{1}^{H} {A}_{1} {\overset{→}{e}}_{n , i} ) = 0.

Now let \frac{d \overset{→}{v}}{d t} {|}_{t = 0} = i {\overset{→}{e}}_{n , i} where the i outside of the subscript is the imaginary constant. {\overset{→}{e}}_{n , 1} and i {\overset{→}{e}}_{n , i} are orthogonal.

This gives: ℜ ( {\overset{→}{e}}_{n , 1}^{H} {A}_{1}^{H} {A}_{1} ( i {\overset{→}{e}}_{n , i} ) ) = 0 \ ⟹ \ ℑ ( {\overset{→}{e}}_{n , 1}^{H} {A}_{1}^{H} {A}_{1} {\overset{→}{e}}_{n , i} ) = 0.

Hence: ( {A}_{1} {\overset{→}{e}}_{n , 1} {)}^{H} ( {A}_{1} {\overset{→}{e}}_{n , i} ) = {\overset{→}{e}}_{n , 1}^{H} {A}_{1}^{H} {A}_{1} {\overset{→}{e}}_{n , i} = 0.

Therefore, the first column of {A}_{1} is orthogonal to all of the other columns of {A}_{1}, and {A}_{1} has the form: {A}_{1} = ( \begin{matrix}{σ}_{1} & {𝟎}_{1 × ( n − 1 )} \\ {𝟎}_{( m − 1 ) × 1} & {A}_{\text{reduced}}\end{matrix} ).

{A}_{\text{reduced}} is an ( m − 1 ) × ( n − 1 ) matrix, and therefore by an inductive argument, {A}_{\text{reduced}} = {U}_{r} {Σ}_{r} {V}_{r}^{H}. Finally,

A = U Σ {V}^{H} where
U = {U}_{1} ( \begin{matrix}1 & {𝟎}_{1 × ( m − 1 )} \\ {𝟎}_{( m − 1 ) × 1} & {U}_{r}\end{matrix} ),
Σ = ( \begin{matrix}{σ}_{1} & {𝟎}_{1 × ( n − 1 )} \\ {𝟎}_{( m − 1 ) × 1} & {Σ}_{r}\end{matrix} ), and
V = {V}_{1} ( \begin{matrix}1 & {𝟎}_{1 × ( n − 1 )} \\ {𝟎}_{( n − 1 ) × 1} & {V}_{r}\end{matrix} ).

Where this page came from

This page was imported from Wikibooks. From “Linear Algebra” on Wikibooks, by its contributors, under CC BY-SA 4.0. Changed here: set as a page; navigation and edit links left out; each image under its own licence, credited in its caption.

Nobody has written it yet — it is the source material at a new address, which is why search engines are asked to skip it and why no one earns from it. It is up for grabs: take it on, and it is yours to rewrite and to earn from.