Docsity

Singular Value Decomposition - Lecture Notes | MAT 343, Study notes of Linear Algebra

Toggle sidebar
bg1
6.5 c
2010 Stefania Tracogna, ASU 6.5
§6.5
Singular Value Decomposition
Preliminaries
1. Let x= (x1, x2,...,xn)Tand y= (y1, y2,...,yn)T, then
A=xyT=
x1
x2
.
.
.
xn
y1y2. . . yn=
x1y1x1y2. . . x1yn
x2y1x2y2x2yn
.
.
..
.
..
.
.
xny1xny2xnyn
=
=y1xy2x. . . ynx=
x1yT
x2yT
.
.
.
xnyT
xyTis called the OUTER PRODUCT EXPANSION of xand yand it is a matrix of rank 1 since
R(A) = span(x) (and R(AT) = span(y)).
We can say more: every rank one matrix has the special form A=xyT= column times row.
The columns are multiples of xand the rows are multiples of yT.
Now assume uand vare two more vectors, then B=xyT+uvTis a rank 2 matrix, (provided
xand uare linearly independent).
2. An n×nmatrix Qis called an Orthogonal Matrix if the columns of Qare orthonormal vectors.
Then QTQ=I, but since Qis square, with linearly independent columns, it is invertible and
QT=Q−1.
Examples of orthogonal matrices:
•Rotation matrices
•Permutation matrices (obtained by permuting rows of I).
•Reflection matrices: they are of the form 2uuT−Iwhere uis the unit vector in the direction
we are reflecting into. (This follows from the fact that the reflection of the vector vinto the
vector uis 2p−v= 2 uTv
||u||2u−v= 2(uTv)u−v.Now, from the associative property of matrix
multiplication, we have (uuT)v=u(uTv) = (uTv)uand it follows that the reflection can be
written as 2(uuT)v−v= (2uuT−I)v).
Reflection matrices are symmetric and also orthogonal. They also have the property Q2=I
(reflecting twice brings back the original).
Properties of orthogonal matrices
•orthogonal matrices leave lengths unchanged: ||Qx||2=||x||2for every vector x.
•orthogonal matrices preserve dot products: (Qx)T(Qy) = xTQTQy=xTy.
•Orthogonal matrices are excellent for computations - numbers can never grow too large when
lengths of vectors are fixed.
3. Recall: Frobenius norm of Ais ||A||F=qPij (aij )2
1
pf3
pf4
pf5

Partial preview of the text

Download Singular Value Decomposition - Lecture Notes | MAT 343 and more Study notes Linear Algebra in PDF only on Docsity!

Singular Value Decomposition

Preliminaries

  1. Let x = (x 1 , x 2 ,... , xn)

T and y = (y 1 , y 2 ,... , yn)

T , then

A = xy

T

x 1

x 2

. . .

xn

[

y 1 y 2... yn

]

x 1 y 1 x 1 y 2... x 1 yn

x 2 y 1 x 2 y 2 x 2 yn

. . .

xny 1 xny 2 xnyn

[

y 1 x y 2 x... ynx

]

x 1 y

T

x 2 y

T

xny T

xy

T is called the OUTER PRODUCT EXPANSION of x and y and it is a matrix of rank 1 since

R(A) = span(x) (and R(A

T ) = span(y)).

We can say more: every rank one matrix has the special form A = xy T = column times row.

The columns are multiples of x and the rows are multiples of y T .

Now assume u and v are two more vectors, then B = xy

T

  • uv

T is a rank 2 matrix, (provided

x and u are linearly independent).

  1. An n × n matrix Q is called an Orthogonal Matrix if the columns of Q are orthonormal vectors.

Then Q

T Q = I, but since Q is square, with linearly independent columns, it is invertible and

Q

T = Q

− 1 .

Examples of orthogonal matrices:

  • Rotation matrices
  • Permutation matrices (obtained by permuting rows of I).
  • Reflection matrices: they are of the form 2uu T − I where u is the unit vector in the direction

we are reflecting into. (This follows from the fact that the reflection of the vector v into the

vector u is 2p − v = 2

u T v ||u|| 2 u^ −^ v^ = 2(u

T v)u − v. Now, from the associative property of matrix

multiplication, we have (uu

T )v = u(u

T v) = (u

T v)u and it follows that the reflection can be

written as 2(uu

T )v − v = (2uu

T − I)v).

Reflection matrices are symmetric and also orthogonal. They also have the property Q

2 = I

(reflecting twice brings back the original).

Properties of orthogonal matrices

  • orthogonal matrices leave lengths unchanged: ||Qx|| 2 = ||x|| 2 for every vector x.
  • orthogonal matrices preserve dot products: (Qx) T (Qy) = x T Q T Qy = x T y.
  • Orthogonal matrices are excellent for computations - numbers can never grow too large when

lengths of vectors are fixed.

  1. Recall: Frobenius norm of A is ||A||F =

ij (aij ) 2

Singular Value Decomposition

Assume A is m × n and m ≥ n (but all results hold also if m < n). We want to factor A in the form

A = U ΣV

T

where U is m × m orthogonal matrix

V is n × n orthogonal matrix

Σ is m × n with off diagonal entries all 0’s and diagonal entries σ 1 ≥ σ 2 ≥... ≥ σn ≥ 0.

σ 1 0... 0

0 σ 2... 0

0... σn

0... 0

σi’s are called SINGULAR VALUES of A.

The factorization U ΣV

T is called the Singular Value Decomposition (SVD) of A.

In many applications we need to determine the rank of a matrix. Computationally, reducing to RREF

and counting the number of non zero rows is not efficient because of round off errors.

A better way to compute the rank is by using the following Theorem:

THEOREM:

rank(A) = number of non zero singular values σi.

Proof:

A = U ΣV

T

[

u 1 u 2... un un+1... um

]

σ 1 0... 0

0 σ 2... 0

0... σn

0... 0

v T 1 v T 2 . . .

v

T n

[

σ 1 u 1 σ 2 u 2... σnun

]

v

T 1 v

T 2 . . .

v

T n

= σ 1 (u 1 v T 1 ) + σ 2 (u 2 v T 2 ) +... + σn(unv T n

By Preliminary 1., uiv

T i are matrices of rank one, thus, if^ σ^1 , σ^2 ,... , σk^6 = 0, the sum is a matrix of rank

k. 

The previous Theorem and, in particular, the expression for A:

A = σ 1 (u 1 v

T 1 ) +^ σ^2 (u^2 v

T 2 ) +^...^ +^ σn(unv

T n )

are extremely important in applications.

From the above Theorem the following Remarks follow:

IMPORTANT REMARKS:

  1. If A has rank n,

B = σ 1 (u 1 v

T 1 ) +^ σ^2 (u^2 v

T 2 ) +^...^ +^ σk^ (ukv

T k ),^ k^ ≤^ n

is the matrix of rank k that is closest to A w.r.t the Frobenius norm, i.e.

||B − A||F = minimum among all matrices B of rank k

Thus ||Avi|| =

λi = σi.

Let Σ =

σ 1 0... 0

0 σ 2... 0

0... σn

(since rank(A) = n we have that σi 6 = 0, i = 1,... , n) and let

U = AV Σ

− 1

[

Av 1

σ 1

Av 2

σ 2

Avn

σn

]

[

u 1 u 2... un

]

We need to verify that the columns of U are orthonormal:

||ui|| =

||Avi||

σi

σi

σi

Also, u T i uj = (Avi) T Avj = v T i λj vj = λj v T i vi = 0 (since vi⊥vj ).

We then have

U = AV Σ

− 1 ⇒ U Σ = AV ⇒ A = U ΣV

− 1

and since V is an orthgonal matrix we have V T = V − 1 which implies A = U ΣV T

. 

STEPS FOR FINDING THE SVD:

  1. σi =

λi with λi e-values of A

T A.

  1. Find the e-vectors of A

T A. Since A

T A is symmetric, these e-vectors will be automatically orthogo-

nal, however, you may need to normalize them. Let v 1 , v 2 ,... , vn be these orthonormal e-vectors,

then V =

[

v 1 v 2... vn

]

  1. If σ 1 ,... , σr 6 = 0, r < n, then ui =

σi

Avi, i = 1,... , r.

The others ur+1, ur+2,... , um are an orthonormal basis of N (A T ). We can compute a basis

for N (A

T ) in the usual way (by finding the RREF of A

T ) and, if the vectors are not already

orthogonal, we can use Gram-Schmidt to orthonormalize them.

REMARK: The matrices U and V contain orthonormal bases for all four fundamental

subspaces.

Let rank(A) = r, i.e σ 1 , σ 2 ,... , σr 6 = 0, then

  • {u 1 , u 2 ,... , ur } is an orthonormal basis of R(A) (by definition the ui =

Avi σi are linear combinations

of the columns of A and they are linearly independent since they are orthogonal)

  • {ur+1,... , um} is an orthonormal basis of the nullspace of A

T , N (A

T ).

  • {v 1 , v 2 ,... , vr } is an orthonormal basis of R(A

T ). (Since A

T uj = σj vj we have that the vj are

linear combinations of the rows of A and they are lin. independent since they are orthogonal).

  • {vr+1,... , vn} is an orthonormal bases for N (A).

In the picture below we can see a geometric representation of the SVD for a 2 by 2 invertible matrix.

This matrix transforms the unit circle into an ellipse.

U and V are rotations and reflections. Σ is a stretching matrix.

The orthonormal columns of V , v 1 and v 2 , are mapped by V

T into e 1 and e 2. Σ then stretches these

vectors into σ 1 e 1 and σ 2 e 2. Since U (σ 1 e 1 ) = σ 1 u 1 and U (σ 2 e 2 ) = σ 2 u 2 , the vectors σ 1 e 1 and σ 2 e 2 are

mapped by U into σ 1 u 1 and σ 2 u 2 which are the axis of the ellipse.

EXAMPLE

Let A =

(a) Find the SVD decomposition of A

Solution:

A

T A =

[

]

, |A

T A − λI| = (10 − λ) 2 − 36. The e-values of A T A are λ 1 = 16 and λ 2 = 4,

thus the singular values are σ 1 =

16 = 4 and σ 2 =

The rref of A

T A − 16 I is

[

]

, thus an e-vector associated to λ 1 = 16 is (1, 1)

T .

The rref of A

T A − 4 I is

[

]

, thus an e-vector associated to λ 2 = 4 is (1, −1)

T .

As expected the two e-vectors are orthogonal, but not orthonormal. To find the columns of V we

need to normalize the e-vectors:

v 1 = (

1 √ 2

1 √ 2

T and v 2 = (

1 √ 2

1 √ 2

T ; thus the matrix

V =

[

]

We have u 1 =

Av 1

σ 1

)T

and u 2 =

Av 2

σ 2

)T

The matrix U is 4 × 4, thus we need two more columns: u 3 and u 4. These two columns are an

orthonormal basis of N (A

T ).

The rref of A

T is

[

]

and a basis of N (A

T ) is given by {(0, 0 , 1 , 0)

T , (0, 0 , 0 , 1)

T }.

U =

We can verify that A = U ΣV T .

(b) Determine the rank of A.

Solution: Since we have two nonzero singular values, the rank of the matrix is two.