CS115 SVD QR Decompositions
CS115 SVD QR Decompositions
Eigen Decomposition.
THE SINGULAR VALUE DECOMPOSITION
Theorem: The Singular Value Decomposition Let A be
an 𝑚 × 𝑛 matrix with rank r. Then there exists an 𝑚 × 𝑛
diagonal matrix Σ whose diagonal entries are non-
negative (the first r singular values of A, 𝜎1 ≥ 𝜎2 ≥ ⋯ ≥
𝜎𝑟 > 0), and there exist an 𝑚 × 𝑚 orthogonal matrix U
and an 𝑛 × 𝑛 orthogonal matrix V such that
𝐴 = 𝑈Σ𝑉𝑇
THE SINGULAR VALUE DECOMPOSITION
𝐴 = 𝑈Σ𝑉𝑇
THE SINGULAR VALUE DECOMPOSITION
Proof Let 𝜆𝑖 and vi be as in Theorem , so that {Av1, . . . , Avr} is
an orthogonal basis for Col A.
Normalize each Avi to obtain an orthonormal basis {u1, . . . , ur},
where
1 1
𝑢𝑖 = 𝐴𝑣𝑖 = 𝐴𝑣𝑖
𝐴𝑣𝑖 𝜎1
And (*)
𝐴𝑣𝑖 = 𝜎𝑖𝑢𝑖 (1 ≤ i ≤ r)
Now extend {u1, . . . , ur} to an orthonormal basis {u1, . . . , um}
of ℝ𝑚 , and let
𝑈 = [𝑢1 𝑢2 . . . 𝑢𝑚] and 𝑉 = [𝑣1 𝑣2 . . . 𝑣𝑚]
2 0 0 2 0 0
Σ = 0 1 0 , Σ=
0 1 0
0 0 0
Step 3. Construct U. When A has rank r, the first r columns of
U are the normalized vectors obtained from Av1, . . . , Avr.
𝐴 = 𝑈Σ𝑉𝑇 𝐴𝑉 = 𝑈Σ
THE SINGULAR VALUE DECOMPOSITION
Thus
1 1
𝑢1 = 𝐴𝑣1 =
𝜎1 0
1 0
𝑢2 = 𝐴𝑣2 =
𝜎2 1
Note that {u1, u2} is already a basis for ℝ2 . Thus no
additional vectors are needed for U, and U = [u1 u2]. The
singular value decomposition of A is
1/ 2 1/ 2 0
1 0 2 0 0
𝐴= 0 0 1
0 1 0 1 0
−1/ 2 1/ 2 0
THE SINGULAR VALUE DECOMPOSITION
Example Construct a singular value decomposition of
4 11 14
𝐴=
8 7 −2
The Singular Value Decomposition
Image Compression
The Singular Value Decomposition
Image Compression
QR FACTORIZATION OF MATRICES
Theorem: The QR Factorization
If A is an m ×n matrix with linearly independent columns,
then A can be factored as A = QR, where Q is an m ×n
matrix whose columns form an orthonormal basis for
ColA and R is an n ×n upper triangular invertible matrix
with positive entries on its diagonal.
𝑥𝑘 = 𝑟1𝑘𝐮1 + ⋯ + 𝑟𝑘𝑘 𝐮𝑘 + 0 ∙ 𝐮𝑘 + 1 + ⋯ + 0 ∙ 𝐮𝑛
1 −3 0
1 1 −2/3
𝑣1 = , 𝑣2 = , 𝑣3 =
1 1 1/3
1 1 1/3
QR FACTORIZATION OF MATRICES
To simplify the arithmetic that follows, scale v3 by letting
v3 = 3v3. Then normalize the three vectors to obtain u1, u2,
and u3, and use these vectors as the columns of Q:
1/2 −3/ 12 0
1/2 1/ 12 −2/ 6
Q= .
1/2 1/ 12 1/ 6
1/2 1/ 12 1/ 6
Slide 6.4- 24
QR FACTORIZATION OF MATRICES
From the proof of Theorem, A = QR for some R. To
find R, observe that QTQ = I, because the columns of Q
are orthonormal. Hence
𝑄𝑇𝐴 = 𝑄𝑇 𝑄𝑅 = 𝐼𝑅 = 𝑅
and
1/2 1/2 1/2 1/2 1 0 0
R = −3/ 12 1/ 12 1/ 12 1/ 12 1 1 0
1 1 1
0 −2/ 6 1/ 12 1/ 6 1 1 1
2 3/2 1
= 0 3/ 12 2/ 12
0 0 3/ 12
QR Decomposition-Based Algorithm for
Background Subtraction