SVD PDF
SVD PDF
SVD PDF
Those are orthogonal matrices U and V in the SVD. Their columns are orthonormal
eigenvectors of AAT and AT A. The entries in the diagonal matrix are the square
roots of the eigenvalues. The matrices AAT and AT A have the same nonzero eigenvalues.
Section 6.5 showed that the eigenvectors of these symmetric matrices are orthogonal.
I will show now that the eigenvalues of AT A are positive, if A has independent columns.
There is also a test on the pivots .all > 0/ and a test on n determinants .all > 0/.
Example 1 Are these matrices positive definite ? When their eigenvalues are positive,
construct matrices A with S D AT A and find the positive energy x T S x.
4 0 5 4 4 5
(a) S D (b) S D (c) S D
0 1 4 5 5 4
Solution The answers are yes, yes, and no. The eigenvalues of those matrices S are
(a) 4 and 1 : positive (b) 9 and 1 : positive (c) 9 and 1 : not positive.
A quicker test than eigenvalues uses two determinants : the 1 by 1 determinant S11 and
the 2 by 2 determinant of S . Example (b) has S11 D 5 and det S D 25 16 D 9 (pass).
Example (c) has S11 D 4 but det S D 16 25 D 9 (fail the test).
7.2. Positive Definite Matrices and the SVD 397
4 0 x1
x1 x2 D 4x12 C x22 > 0 Positive energy when x 0
0 1 x2
5 4 x1
x1 x2 D 5x12 C 8x1 x2 C 5x22 Positive energy when x 0
4 5 x2
4 5 x1
x1 x2 D 4x12 C 10x1 x2 C 4x22 Energy 2 when x D .1; 1/
5 4 x2
Positive energy is a fundamental property. This is the best definition of positive definiteness.
When the eigenvalues are positive, there will be many matrices A that give AT A D S .
One choice
p of A is symmetric and positive definite ! Then AT A is A2 , and this choice
A D S is a true square root of S . The successful examples (a) and (b) have S D A 2 :
4 0 2 0 2 0 5 4 2 1 2 1
D and D
0 1 0 1 0 1 4 5 1 2 1 2
We know that all symmetric matrices have the form S pD VV T with orthonormal
eigenvectors in V . The diagonal
p p has a square root , when all eigenvalues are
matrix
positive. In this case A D S D V V T is the symmetric positive definite square root :
p p p p p p
ATA D S S D .V V T /.V V T / D V V T D S because V T V D I:
p p
Starting from this unique square root S , other choices of A come easily. pMultiply S
by any matrix Q that has orthonormal columns (so that QT Q D I ). Then Q S is another
choice for A (not a symmetric choice). In fact all choices come this way :
p p p p
AT A D .Q S /T .Q S / D SQT Q S D S: (1)
Example 2 The first two matrices are singular and positive semidefinitebut not the
third :
0 0 4 4 4 4
(d) SD (e) SD (f) SD .
0 1 4 4 4 4
The eigenvalues are 1; 0 and 8; 0 and 8; 0. The energies x T S x are x22 and 4.x1 C x2 /2
and 4.x1 x2 /2 . So the third matrix is actually negative semidefinite.
The last n r vectors in V are a basis for the nullspace of A. The last m r vectors in U
are a basis for the nullspace of AT . The diagonal matrix is m by n, with r nonzeros.
Remember that V 1 D V T , because the columns v 1 ; : : : ; v n are orthonormal in Rn :
This says that the vectors ui D Av i =i are orthonormal for i D 1; : : : ; r. They are a basis
for the column space of A. And the us are eigenvectors of the symmetric matrix AAT ,
which is usually different from S D AT A (but the eigenvalues 12 ; : : : ; r2 are the same).
Example 3 Find the input and output eigenvectors v and u for the rectangular matrix A :
2 2 0
AD D U V T :
1 1 0
2 p p 3T
" p # 2
2 2 0 1 0 8 p0 0 1 4 p p2 0
AD D 2 2 0 5 :
1 1 0 0 1 0 2 0 2
0 0 2
400 Chapter 7. Applied Mathematics and A T A
I think of the SVD as the final step in the Fundamental Theorem. First come the dimen-
sions of the four subspaces in Figure 7.3. Then come the orthogonality of those pairs of
subspaces. Now come the orthonormal bases of vs and us that diagonalize A :
Av j D j uj for j r AT uj D j v j for j r
SVD T
Av j D 0 for j > r A uj D 0 for j > r
dim r dim r
row column
space space
of A of A
Av1 D 1 u1 1 u1
v1 u1
vr Avr D r ur ur
R n r ur
m
R
Avn D 0 urC1 um
vrC1 vn
nullspace
nullspace of A T
of A
dim n r dim m r
The norm of A is its largest singular value : jjAjj D 1 . This measures the largest
possible ratio of jjAvjj to jjvjj. That ratio of lengths is a maximum when v D v 1 and
Av D 1 u1 . This singular value 1 is a much better measure for the size of a matrix than
the largest eigenvalue. An extreme case can have zero eigenvalues and just one eigenvector
(1; 1) for A. But AT A can still be large : if v D .1; 1/ then Av is 200 times larger.
100 100
AD has max D 0: But max D norm of A D 200: (6)
100 100
7.2. Positive Definite Matrices and the SVD 401
1 1
Condition number of A c.A/ D jjAjj jjA jj D : (8)
n
This number c.A/ is the key to numerical stability in solving Av D b. When A is an
orthogonal matrix, the symmetric S D AT A is the identity matrix. So all singular values of
an orthogonal matrix are D 1. At the other extreme, a singular matrix has n D 0.
In that case c D 1. Orthogonal matrices have the best condition number c D 1.
1. Positive definite symmetric matrices have positive eigenvalues and pivots and energy.
2. S D AT A is positive definite if and only if A has independent columns.
3. x T AT Ax D .Ax/T .Ax/ is zero when Ax D 0. AT A can be positive semidefinite.
4. The SVD is a factorization A D U V T D (orthogonal) (diagonal) (orthogonal).
5. The columns of V and U are eigenvectors of AT A and AAT (singular vectors of A).
6. Those orthonormal bases achieve Av i D i ui and A is diagonalized.
7. The largest piece of A D 1 u1 v T1 C C r ur v Tr gives the norm jjAjj D 1 .
402 Chapter 7. Applied Mathematics and A T A
5 x T S x D 2x1 x2 certainly has a saddle point and not a minimum at .0; 0/. What
symmetric matrix S produces this energy ? What are its eigenvalues ?
6 Test to see if AT A is positive definite in each case :
2 3
1 1
1 2 1 1 2
AD and A D 4 1 2 5 and A D :
0 3 1 2 1
2 1
9 For what numbers c and d are S and T positive definite? Test the 3 determinants :
2 3 2 3
c 1 1 1 2 3
S D 41 c 15 and T D 42 d 45 :
1 1 c 3 4 5
1
10 If S is positive definite then S is positive definite. Best proof : The eigenvalues
of S 1 are positive because . Second proof (only for 2 by 2) :
1 1 c b
The entries of S D pass the determinant tests :
ac b 2 b a
11 If S and T are positive definite, their sum S C T is positive definite. Pivots and
eigenvalues are not convenient for S C T . Better to prove x T .S C T /x > 0.
12 A positive definite matrix cannot have a zero (or even worse, a negative number)
on its diagonal. Show that this matrix fails to have x T S x > 0 :
2 32 3
4 1 1 x1
x1 x2 x3 4 1 0 2 5 4 x2 5 is not positive when .x1 ; x2 ; x3 / D . ; ; /:
1 2 5 x3
13 A diagonal entry ajj of a symmetric matrix cannot be smaller than all the s. If it
were, then A ajj I would have eigenvalues and would be positive definite.
But A ajj I has a on the main diagonal.
14 Show that if all > 0 then x T S x > 0. We must do this for every nonzero x,
not just the eigenvectors. So write x as a combination of the eigenvectors and
explain why all cross terms are x Ti x j D 0. Then x T S x is
20 Which values of c give a bowl and which c give a saddle point for the graph of
z D 4x 2 C 12xy C cy 2 ? Describe this graph at the borderline value of c.
21 When S and T are symmetric positive definite, S T might not even be symmetric.
But its eigenvalues are still positive. Start from S T x D x and take dot products
with T x. Then prove > 0.
24 Write down orthonormal bases for the four fundamental subspaces of this A.
2
25 (a) Why is the trace of AT A equal to the sum of all aij ?
(b) For every rank-one matrix, why is 12 D sum of all aij
2
?
7.2. Positive Definite Matrices and the SVD 405
26 Find the eigenvalues and unit eigenvectors of AT A and AAT . Keep each Av D u:
1 1
Fibonacci matrix AD
1 0
30 The SVD for A C I doesnt use C I . Why is .A C I / not just .A/ C I ?
31 Multiply AT Av D 2 v by A. Put in parentheses to show that Av is an eigenvector
of AAT . We divide by its length jjAvjj D to get the unit eigenvector u.
32 My favorite example of the SVD is when Av.x/ D dv=dx, with the endpoint con-
ditions v.0/ D 0 and v.1/ D 0. We are looking for orthogonal functions v.x/
so that their derivatives Av D dv=dx are also orthogonal. The perfect choice is
v1 D sin x and v2 D sin 2x and vk D sin kx. Then each uk is a cosine.
The derivative of v1 is Av1 D cos x D u1 . The singular values are 1 D
and k D k. Orthogonality of the sines (and orthogonality of the cosines) is the
foundation for Fourier series.
You may object to AV D U . The derivative A D d=dx is not a matrix ! The
orthogonal factor V has functions sin kx in its columns, not vectors. The matrix
U has cosine functions cos kx. Since when is this allowed ? One answer is to
refer you to the chebfun package on the web. This extends linear algebra to matrices
whose columns are functionsnot vectors.
Another answer is to replace d=dx by a first difference matrix A. Its shape will be
N C 1 by N . A has 1s down the diagonal and 1s on the diagonal below. Then
AV D U has discrete sines in V and discrete cosines in U . For N D 2 those will
be sines and cosines of 30 and 60 in v 1 and u1 .
T
Can you construct the p p matrix A (3 byp2) and Ap A (2 by 2) ? The dis-
difference
crete sines are v 1 D . 3=2; 3=2/ and v 2 D . 3=2; 3=2/. Test that Av 1 is
orthogonal to Av 2 . What are the singular values 1 and 2 in ?