Professional Documents
Culture Documents
LECTURE 6: Singular Value Decomposition (SVD)
LECTURE 6: Singular Value Decomposition (SVD)
1 u1T
T
2 u2 .
A u1 u 2 un
T
n u n
T
U D U
How do we make sense of the spectral decomposition?
A can be expressed as
A 1u1u1T 2u 2uT2 nu nuTn .
Ax 1 u x u1 2 u x u 2 n u x u n .
T
1
T
2
T
n
Largest Second
component largest
Etc…
component
The principle subspace
Span u1 , u 2 , , u k
T
U Σ V
Taking the SVD apart
v1T
T
v2
A UΣVT 1u1 2u 2 nu n .
T
vn
Then look at each entry in A
A can be expressed as
A 1u1 v1T 2u 2 vT2 nu n vTn .
If A UΣV T , then
A A UΣV
T
T T
UΣV T
VΣT UT UΣV T
VΣT ΣVT
A A VΣ ΣV
T T T
SPD/SSPD matrix
Orthogonal matrix
Diagonal matrix
T
Columns of V are orthonormal eigenvectors of A A .
Diagonal entries of ΣT Σ are the associated eigenvalues.
A few notes about the eigenvalues of AT A
T
FACT: A A is positive definite if A is full rank and semi-
positive definite if A is rank deficient.
Orthonormal means
0 whenever i j
v vj
T
i
1 whenever i j
Diagonal entries of ΣT Σ
i i 0, i 1, 2, , n.
About V
T
Recall that V appears in the spectral decomposition of A A .
V v1 v2 vn ,
…. AND WE NAIL V.
What about U?
The RHS:
U 1e1 2e 2 ne n 1Ue1 2 Ue2 n Ue n
1u1 2u 2 nu n ,
then,
1
ui Av i . i 1, 2, , k .
i
WE’VE ONLY JUST GOT THE
FIRST k COLUMNS OF U…..
What about the rest of the columns in U?
1
Σ1 2 ,
k
Σ1 0 V1T
A U1 U2 T
0 0 V2
Σ1V1T
U1 U 2
0
U1Σ1V1T THE REDUCED SVD
Orthogonal complements:
Let S be a subspace in R . Then the subspace S defined
m
by
S y R m : y T x 0 for all x S .
Theorem – (refer pg. 22 & 23 Datta)
null A range A
T
(I)
null A range A
T
(II)
What do we have in U…..
U U1 U 2
u1 u 2 u k u k 1 u k 2 u n
Spans S Spans S
WHAT IS S ???
Discovering S…..
Notice that
u i Av i , i 1, 2, , k .
ui range A
S span u1 , u 2 , , u k range A
S
range A
u1 , u 2 , , u k
When is S as big as range A ?
for any x R n .
Thus,
S span u1 , u 2 , , u n span u1 , u 2 , , u k range A .
What about S ?
S range A null AT .
AT u 0,
and determine an orthonormal basis of that space.
In summary…
The SVD:
Σ1 0 V1T
A UΣVT U1 U2 T .
0 0 V2
where
m k m n k
U1 R , U2 R ,
Σ1 R k k ,
n k n n k
V1 R , V2 R
In summary: The key points
Columns of V1 : v1 , v 2 , , v k
Eigenvectors of AT A associated with eigenvalues
Columns of V2 : v k 1 , v k 2 , , v n
Eigenvectors of AT A associated with eigenvalues k 1 k 2 n 0
Diagonal entries of 1 :
i i , i 1, 2, , k
Columns of U1 : u1 , u 2 , , u k
1
ui Av i . i 1, 2, , k .
i
Columns of U 2 : u k 1 , u k 2 , , um
Orthonormal basis of null A
T
SVD by hand:
2 2
I can now write down Σ :
2 0
Σ .
0 0
SVD by hand (cont’d):
U =
-0.7071 -0.7071 0
-0.7071 0.7071 0
0 0 1.0000
S =
2 0
0 0
0 0
V =
-0.7071 -0.7071
-0.7071 0.7071
Some image processing
Introducing Lenna
A = zeros(size(Lenna));
for i = 1:k
A = A + S(i,i)*U(:,i)*V(:,i)’;
end
Let’s compare Lenna and its truncation
k 1
Let’s compare Lenna and its truncation
k 10
Let’s compare Lenna and its truncation
k 20
Let’s compare Lenna and its truncation
k 40
Let’s compare Lenna and its truncation
k 80
Let’s compare Lenna and its truncation
k 100
What have we observed?
100
80 Significant sv’s
60
k
40
20
0
0 50 100 150 200 250
k
Observation 1
s1 t s 2 t s n t
day 1 s11 s12 s1n
A day 2 s21 s22
s2 n
day m sm1 sm 2 smn
where
U is m m with orthonormal columns;
V is n n with orthonormal columns;
Σ is m n diagonal matrix;
FULL SVD
Σ 0 V T
A UΣV U1 U 2
T 1 1
T
0 0 V2
U1Σ1V1T 0
U1Σ1V1T REDUCED
SVD
Important results (1): Columns of U and V
Orthogonal complement
of the row space of A
Important results (2): A 2
A 2 UΣV T Σ 2.
2
12
k
2
Σx i xi
Σ 2 max 2
max i 1 .
12 1
x0 x x0
k
2
xi
2
i 1
Σx 2
x achieves maximum when x e1 . That’s it!
2
Important results (3): cond(A)
cond A 1 n .
Important results (3): Proof of Corollary 6.2
Using SVD: A †
VΣ † T
U ,
where SVD of A†
1 1 0 0
0 1
Σ † ΣT Σ Σ T
1 2 .
0 1 n
Thus cond A A 2
A† 1 1 n 1 n . That’s it!
2
A F
2
1
2
2 n
2 12
.
Important results (4): Proofs
Computing x A †b VΣ 1UT b.
First notice that
1 T
u1 b
1
1 T
u2 b
O
n 2
y Σ U b 2
† T
R n
. multiplication
1 uT b
n
n
n n
1 T
Thus, x Vy yi v i ui b v i .
i 1 i 1 i
Solving least squares problem using SVD (rank deficient)
Proceed as follows:
2 2 2
b Ax 2 b UΣV x U b ΣV x .
T T T
2 2
(using orthogonality of U)
2
U b Σ1 0 V x
2
T T
U b ΣV x
T T
1
T
1
.
T
U b 0 0 V x 2
2
2 2
2 2
U b Σ1 0 V x
2
T T
U b Σ1V x T T
U b ΣV x
T T
1
T
1
T T
1
,
1
U b 0 0 V x 2 U2 b
2
2 2 2
(The last term on the right is just the L2 norm of a R m vector).
which means
2 2 2
b Ax 2 U1 b Σ1V1 x U 2 b .
T T T
2 2
Therefore
2 2 2
min b Ax 2 min U b Σ1V x U b ,
T
1 1
T T
2
x x 2 2
0 0
by definition of y 1 due to orthogonality
of the columns of V
Use the SVD method to find all the least squares solution of
Ax = b where
1 2 6
A , b ,
1 2 4
Use the SVD method to find all the least squares solution of
Ax = b where
1 1 1 89
1 1 0 67
A 0 1 1, b 53 .
1 0 0 35
0 0 1 20