Professional Documents
Culture Documents
Minghua Xia
(https://seit.sysu.edu.cn/teacher/XiaMinghua)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 1 / 108
Recap of the Overview of the Course
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 2 / 108
Table of Contents
1 QR Decomposition
2 Gram-Schmidt Orthonormalization
3 Givens Rotations
4 Householder Transformations
5 Interpolative Decomposition: CZ and CMR Factorization
CZ Factorization
CMR Factorization
Three Bases for the Column Space
6 Computing Eigenvalues and Eigenvectors
Power Iteration
Jacobi Method
QR Algorithm
Krylov Subspace Methods
Generalized Eigenvalue Problems
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 3 / 108
QR Decomposition
Definition 1 (QR Decomposition)
Any A ∈ Cm×n can be decomposed as
A = QR, (1)
Question 1
1) How do we know that QR decomposition exists?
2) How to compute the factors Q and R algorithmically?
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 5 / 108
An Illustrative Application: Solving LS Problem
Consider the LS problem for a full column-rank A ∈ Cm×n :
Let
R1
A = QR = Q1 Q2 = Q1 R1 , (3)
0
where Q1 ∈ Cm×n , Q2 ∈ Cm×(m−n) , R1 ∈ Cn×n (upper triangular). Since
2
kAx − yk22 = QH (Ax − y) 2
H 2
Q1 (Ax − y)
= (4)
QH
2 (Ax − y) 2
2 2
= R1 x − QH
1 y 2
+ QH
2 y 2
, (5)
R1 x = QH
1 y. (6)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 6 / 108
QR for Full Column-Rank Matrices
Property 1
For the thin QR in Theorem 2, we have R(A) = span(Q1 ) and
R(A)⊥ = span(Q2 ). Moreover, Q1 QH 1 is orthogonal projector onto R(A).
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 7 / 108
QR for Full Column-Rank Matrices (Cont’d)
Proof.
1) AH A is positive definite.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 8 / 108
Application: A Geometrical Interpretation of Determinant
Question 2
When X ∈ Rm×n has linearly independent columns, explain why the volume of
the n-dimensional parallelepiped generated by the columns of X is
1/2
Vn = det X T X
. (8)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 9 / 108
Application: A Geometrical Interpretation of Determinant
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 10 / 108
Classical Gram-Schmidt for Thin QR
Question 3
Given a full column-rank A, how to compute its thin QR pair (Q1 , R1 )?
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 12 / 108
Classical Gram-Schmidt for Thin QR (Cont’d)
Stage 2: since a2 = r12 q1 + r22 q2 and q1H q2 = 0, we can obtain r12 via
where y2 = a2 − r12 q1 .
Stage 3: we have a3 = r13 q1 + r23 q2 + r33 q3 , Using the same trick as above
yields
r13 = q1H a3 , r23 = q2H a3 , (17)
and
q3 = y3 /ky3 k2 , r33 = ky3 k2 , (18)
where y3 = a3 − r13 q1 − r23 q2 .
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 14 / 108
Classical Gram-Schmidt for Thin QR (Cont’d)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 15 / 108
Modified Gram-Schmidt
Let riT denote the ith row of R1 (with a slight abuse of notations). The following
illustrates a modified Gram-Schmidt, which is numerically more stable.
Modified Gram-Schmidt procedure: for k = 1, · · · , n, compute
n
X
A = Q1 R1 = qi riT . (Rank-one decomposition) (20)
i=1
qk = yk /kyk k2 , (22b)
k−1
!
X
rkT = qkT A− qi riT . (22c)
i=1
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 16 / 108
Givens Rotations
Consider yet another way for QR; again, assume the real-valued case.
Example 3
Given x ∈ R2 , consider
y1 c s x1 cx1 + sx2
= = , (23)
y2 −s c x2 −sx1 + cx2
| {z }
=J
1) J is orthogonal.
2) y2 = 0 if θ = tan−1 (x2 /x1 ), or if
x1 x2
c= p 2 , s= p 2 . (24)
x1 + x22 x1 + x22
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 18 / 108
Givens Rotations (Cont’d)
Givens rotations:
I
c s
J (i, k, θ) ,
I ,
(25)
−s c
I
where c , cos(θ), s , sin(θ); c lies in the (k, k)th and (i, i)th entries; −s the
(i, k)th entry; s the (k, i)th entry.
1) J (i, k, θ) is orthogonal;
2) Let y = J (i, k, θ)x. We have
cxi + sxk , j = i
yj = −sxi + cxk , j = k . (26)
6 i, k
xj , j =
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 19 / 108
Givens Rotations (Cont’d)
Example 4
Consider a 4 × 3 matrix.
× × × × × × × × × × × ×
× × × J2,1 0 × × J3,1 0 × × J4,1 0 × ×
× × × −−−→ × ×
A= −−−→ −−−→
× 0 × × 0 × ×
× × × × × × × × × 0 × ×
× × × × × × × × ×
J3,2 0 × × J4,2 0 × × J4,3 0 × ×
−−−→ 0 0 × −−−→ 0
−−−→ = R,
0 × 0 0 ×
0 × × 0 0 × 0 0 0
J
where B − → C means C = J B; Ji,k = J (i, k, θ), with θ that is chosen to zero out the
(i, k)th entry of the matrix transformed by Ji,k .
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 20 / 108
Givens Rotations (Cont’d)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 21 / 108
Example 5 (Givens Rotation)
T
1) Let x = 4 3 .
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 22 / 108
Characteristics of Givens QR Factorization
Remark 1
1) Straightforward implementation of the Givens method requires about
50% more work than the Householder method and requires more
storage since each rotation requires two numbers, c and s, to define
it.
Interactive example
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 23 / 108
Householder Transformations
Consider an alternative QR via the Householder transformations (to be
introduced). Assume the real-valued case for convenience.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 25 / 108
Householder Transformations (Cont’d)
Question 4
Given a ∈ Rm , find a reflection matrix H ∈ Rm×m such that
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 27 / 108
Example 8 (Householder Transformation)
T
1) If a = 2 1 2 , then we take
2 1 5
v = a + sign(a1 )kak2 e1 = 1 + kak2 0 = 1 .
2 0 2
Interactive example
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 28 / 108
Householder QR Factorization
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 29 / 108
Householder QR Factorization (Cont’d)
Householder QR procedure: for k = 1, · · · , n − 1, compute
where
Ik−1 0
Hk = , (38)
0 H̃k
in which Ik is the k × k identity matrix, and H̃k ∈ R(m−k+1)×(n−k+1) is the
(k−1)
Householder transformation w.r.t Ak:m, k:n .
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 30 / 108
Example 9 (Householder QR Factorization)
1) For the polynomial data-fitting example given previously, with
1 −1.0 1.0 1.0
1 −0.5 0.25 0.5
A= 1 0.0 0.0
, b = 0.0 .
1 0.5 0.25 0.5
1 1.0 1.0 2.0
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 31 / 108
Example 9 (Householder QR Factorization (Cont’d))
3) Applying resulting Householder transformation H1 yields transformed matrix
and right-hand side
−2.236 0 −1.118 −1.789
0
−0.191 −0.405
−0.362
H1 A = 0
0.309 −0.655 , H1 b =
−0.862 .
0 0.809 −0.405 −0.362
0 1.309 0.345 1.138
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 32 / 108
Example 9 (Householder QR Factorization (Cont’d))
5) Applying resulting Householder transformation H2 yields
−2.236 0 −1.118 −1.789
0 1.581 0 0.632
H2 H1 A = 0 0 −0.725 , H2 H1 b = −1.035 .
0 0 −0.589 0.816
0 0 0.047 0.404
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 33 / 108
Example 9 (Householder QR Factorization (Cont’d))
7) Applying resulting Householder transformation H3 yields
−2.236 0 −1.118 −1.789
0 1.581 0 0.632
H3 H2 H1 A = 0 0 0.935 , H3 H2 H1 b =
1.336 .
0 0 0 0.026
0 0 0 0.337
Interactive example
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 34 / 108
Further Study: Hilbert Transform
Question 5
Householder transform is able to change the amplitudes of elements of a vector. But how to
change their phases?
Answer:
1
Z ∞
x(τ )
x̂(t) = H {x(t)} = dτ (40)
π t−τ
−∞
Z ∞
1 x̂(τ )
x(t) = H−1 {x̂(t)} = − dτ (41)
π −∞ t − τ
Figure 3: The Hilbert transform in the time domain, which is, in essence, a π/2 phase shifter
in the frequency domain.
−j, if ω ≥ 0;
H(ω) = F {h(t)} = (42)
+j, if ω < 0.
An application in signal processing is to construct complex signals.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 35 / 108
Interpolative Decomposition
A = CZ or A = CM R, (43)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 37 / 108
Interpolative Decomposition (Cont’d)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 38 / 108
CZ Factorization
1 When C contains a basis for the column space of A, the factor Z is
completely determined by
aj = Czj . (44)
2 When the columns of C are not very independent, we first look at the row
space of C:
cTi = yiT B, (45)
where B is an r × r invertible matrix. (45) implies C = Y B. Then,
combining it with A = CZ yields
Am×n = Cm×r Zr×n = Ym×r Br×r Zr×n , (46)
where all matrices have rank r.
Remark 2 (On the values of zj and yiT )
By recalling the fact that the columns of C came directly form A and the rows of
B came directly from C, for those columns and rows, the vectors zj in (44) and
yiT in (45) came directly from the identity matrix I.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 40 / 108
CZ Factorization (Cont’d)
3 According to Remark 2, if we suppose that zj and yiT are the first r
columns and rows in A and C, then A = Y BZ has a special form:
Ir
B −1 Zn−r
Y = −1 , B = submatrix of A, Z = Ir (47)
Cm−r B
Example 11
1 2 4 2 1 0
1 2 1 0 0 0
A = 0 1 2 1 = 0 1 (48)
0 1 0 1 2 1
1 3 6 3 1 1 | {z } | {z }
| {z } B Z
Y
1 2
1 0 0 0
= 0 1 (49)
0 1 2 1
1 3 | {z }
| {z } Z
C
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 41 / 108
CZ Factorization (Cont’d)
A = Y Bmax Z (50)
= CZ. (51)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 42 / 108
CZ Factorization (Cont’d)
Example 12
1 2 4 2 1 0
1 4 1 0 0 0
A = 0 1 2 1 = 0 1 (52)
0 2 0 0.5 1 0.5
1 3 6 3 1 1 | {z } | {z }
| {z } Bmax Z
Y
1 4
1 0 0 0
= 0 2 (53)
0 0.5 1 0.5
1 6 | {z }
| {z } Z
C
A = CM R, (54)
where C (resp., R) are actual columns (resp. actual rows) of A – thoughtfully chosen,
and M is a mixing matrix. Otherwise, we have the approximation
A ≈ CM R, (55)
with
kA − CM Rk ≤ kUr−1 k + kVr−1 k σr+1 .
(56)
The basic idea for implementing the CMR factorization is the discrete empirical
interpolation method (DEIM). Specifically, based on the SVD decomposition
A = U ΣV T , the DEIM procedure uses U and V to select the columns and rows of A
that form C and R, respectively. For more details, please refer to the work1 .
1
D. C. Sorensen and M. Embree, A DEIM Induced CUR Factorization, SIAM Journal on Scientific Computing, vol. 38,
no. 3, pp. A1454-A1482, 2016.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 45 / 108
Three Bases for the Column Space
Motivation: As the matrices get large, their rank is also large if there is random
noise. But the effective rank, when the noise is removed, may be considerably
smaller than m and n. So,
1) Don’t use AT A and AAT when you can operate directly on A;
2) Don’t assume that the original order of the rows and columns is necessarily
the best.
The first warning would apply to the least squares and SVD problems because by
forming AT A, we are squaring the condition number σ1 /σn . This measures the
sensitivity and vulnerability of A. Also, for really large matrices, the cost of
computing and storing AT A is just unthinkable.
Question 6
What do we really need from A?
Answer: We need a good basis for the column space! From that starting point,
we can do anything!
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 47 / 108
Three Bases for the Column Space (Cont’d)
1 Singular vectors u1 , · · · , ur from the SVD, with σ1 ≥ σ2 ≥ · · · ≥ σr :
A = Ur × Σr VrT .
(57)
where A = Qr Rr PT + E ≈ Qr Rr PT.
3) Find the SVD of the matrix Rr P T with only r rows: Rr P T = Ur ΣV T .
4) Multiply Qr times Ur to find U = Qr Ur such that
A = Qr Ur ΣV T + E = U ΣV T + E. (62)
5) With U and V , the CMR decomposition can be derived according to 1.
2
Gilbert Strang, Linear Algebra and Learning from Data, Wellesley-Cambridge University Press, 2019, pp. 138-155.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 49 / 108
Power Iteration (λmax )
xk = Axk−1 (63)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 52 / 108
Convergence of Power Iteration
1) To see why power iteration converges to the dominant eigenvector,
express starting vector x0 as a linear combination
n
X
x0 = αi vi , (64)
i=1
2) Then
xk = Axk−1 = A2 xk−2 = · · · = Ak x0
n n
!
X X
= λki αi vi = λk1 α1 v1 + k
(λi /λ1 ) αi vi
i=1 i=2
= λk1 α1 v1 , as k → ∞. (65)
3) Since |λi /λ1 | < 1 for i > 1, successively higher powers go to zero,
leaving only component corresponding to v1 .
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 53 / 108
Example 14 (Power Iteration)
1) Ratio of values of given component of xk from one iteration to next
converges to dominant eigenvalue λ1 .
1.5 0.5 0
2) For example, if A = and x0 = , we obtain
0.5 1.5 1
k xTk ratio
0 0.0 1.0
1 0.5 1.5 1.500
2 1.5 2.5 1.667
3 3.5 4.5 1.800
4 7.5 8.5 1.889
5 15.5 16.5 1.941
6 31.5 32.5 1.970
7 63.5 64.5 1.985
8 127.5 128.5 1.992
3) Ratio converges to the dominant eigenvalue, which is 2.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 54 / 108
Limitations of Power Iteration
2) There may be more than one eigenvalue having the same (maximum)
modulus, in which case iteration may converge to a linear
combination of corresponding eigenvectors.
3) For real matrix and starting vector, iteration can never converge to a
complex vector.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 55 / 108
Normalized Power Iteration
yk = Axk−1 , (66)
xk = yk /kyk k∞ . (67)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 56 / 108
Example 15 (Normalized Power Iteration)
Repeating the previous example with the normalized scheme,
k xTk kyk k∞
0 0.000 1.0
1 0.333 1.0 1.500
2 0.600 1.0 1.667
3 0.778 1.0 1.800
4 0.882 1.0 1.889
5 0.939 1.0 1.941
6 0.969 1.0 1.970
7 0.984 1.0 1.985
8 0.992 1.0 1.992
Interactive example
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 57 / 108
Geometric Interpretation
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 58 / 108
Power Iteration with Shift (to Accelerate Convergence)
1) Convergence rate of power iteration depends on ratio |λ2 /λ1 |, where
λ2 is eigenvalue having second largest modulus.
2) May be possible to choose shift, A − σI such that
λ2 − σ λ2
< , (68)
λ1 − σ λ1
so convergence is accelerated.
3) Shift must then be added to the result to obtain the eigenvalue of the
original matrix.
4) In the earlier example, for instance, if we pick the shift of σ = 1
(which is equal to another eigenvalue), then the ratio becomes zero,
and the method converges in one iteration.
5) In general, we would not be able to make such a fortuitous choice,
but shifts can still be extremely useful in some contexts, as we will see
later.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 59 / 108
Inverse Iteration (λmin )
1) If the smallest eigenvalue of the matrix required rather than the
largest, can make use of the fact that eigenvalues of A−1 are
reciprocals of those of A, so smallest eigenvalue of A is reciprocal of
the largest eigenvalue of A−1 .
2) This leads to inverse iteration scheme
Interactive example
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 61 / 108
Inverse Iteration with Shift (to Accelerate Convergence)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 62 / 108
Rayleigh Quotient
xλ ∼
= Ax. (71)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 63 / 108
Example 17 (Rayleigh Quotient)
1) Rayleigh quotient can accelerate the convergence of iterative methods
such as power iteration since Rayleigh quotient xTk Axk /xTk xk gives a
better approximation to eigenvalue at iteration k than does basic
method alone.
2) For the previous example using power iteration, the value of the
Rayleigh quotient at each iteration is shown below.
k xTk kyk k∞ xTk Ax/xTk xk
0 0.000 1.0
1 -0.333 1.0 1.500 1.500
2 -0.600 1.0 1.667 1.800
3 -0.778 1.0 1.800 1.941
4 -0.882 1.0 1.889 1.985
5 -0.939 1.0 1.941 1.996
6 -0.969 1.0 1.970 1.999
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 64 / 108
Rayleigh Quotient Iteration
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 65 / 108
Rayleigh Quotient Iteration (Cont’d)
4) Rayleigh quotient iteration is especially effective for symmetric
matrices and usually converges rapidly.
5) Using different shifts at each iteration means the matrix must be
refactored each time to solve the linear system. Hence, the cost per
iteration is high unless the matrix has a special form that makes
factorization easy.
6) The same idea also works for complex matrices, for which transpose is
replaced by conjugate transpose, so Rayleigh quotient becomes
xH Ax/xH x.
7) Using the same matrix as previous examples and randomly chosen
starting vector x0 , Rayleigh quotient iteration converges in two
iterations.
k xTk σk
0 0.807 0.397 1.896
1 0.924 1.000 1.998
2 1.000 1.000 2.000
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 66 / 108
Deflation
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 67 / 108
Deflation (Cont’d)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 68 / 108
Deflation (Cont’d)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 69 / 108
Jacobi Method
1) One of oldest methods for computing eigenvalues is Jacobi method,
which uses similarity transformation based on plane rotations.
is diagonal.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 71 / 108
Jacobi Method (Cont’d)
c2 b + cs(a − d) − s2 b = 0. (78)
s a − d s2
1+ − 2 = 0. (79)
c b c
7) Making substitution t = s/c, we get quadratic equation
a−d
1+t − t2 = 0. (80)
b
for tangent
√ t of angle of rotation, from which we can recover
c = 1/ 1 + t2 and s = c · t.
8) Advantageous numerically to use the root of smaller magnitude.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 72 / 108
Example 18 (Plane Rotation)
Consider 2 × 2 matrix
1 2
A= .
2 1
Quadratic equation for tangent reduces to t2 = 1, so t = ±1.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 73 / 108
Jacobi Method (Cont’d)
10) Plane rotations are repeatedly applied from both sides in systematic
sweeps through the matrix until the off-diagonal mass of the matrix is
reduced to within some tolerance of zero.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 74 / 108
Jacobi Method (Cont’d)
13) Except for small problems, more modern methods usually require 5 to
10 times less work than Jacobi.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 75 / 108
Example 19 (Jacobi Method)
1 0 2
1) Let A0 = 0 2 1.
2 1 1
to obtain
3 0.707 0
A1 = J0T A0 J0 = 0.707 2 0.707 .
0 0.707 −1
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 76 / 108
Example 19 (Jacobi Method (Cont’d))
3) Next, annihilate (1,2) and (2,1) entries using rotation
0.888 −0.460 0
J1 = 0.460 0.888 0
0 0 1
to obtain
3.366 0 0.325
A2 = J1T A1 J1 = 0 1.634 0.628 .
0.325 0.628 −1
to obtain
3.366 0.072 0.317
A3 = J2T A2 J2 = 0.072 1.776 0 .
0.317 0 −1.142
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 77 / 108
Example 19 (Jacobi Method (Cont’d))
5) Beginning a new sweep, again annihilate (1,3) and (3,1) entries using rotation
0.998 0 −0.070
J3 = 0 1 0
0.070 0 0.998
to obtain
3.388 0.072 0
A4 = J3T A3 J3 = 0.072 1.776 −0.005 .
0 −0.005 −1.164
7) Result is a diagonal matrix orthogonally similar to the original matrix, with the orthogonal
similarity transformation given by the product of plane rotations.
Interactive example
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 78 / 108
Simultaneous Iteration
Xk = AXk−1 . (82)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 80 / 108
Orthogonal Iteration
1) As with power iteration, normalization is needed with simultaneous
iteration.
Ak = Rk Qk = QH
k Ak−1 Qk . (87)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 83 / 108
Example 20 (QR Iteration)
7 2
1) Let A0 = .
2 4
2) Compute QR factorization
0.962 −0.275 7.28 3.02
A0 = Q1 R1 = ,
0.275 0.962 0 3.30
3) Off-diagonal entries are now smaller, and diagonal entries are closer
to eigenvalues, 8 and 3.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 84 / 108
QR Iteration with Shifts (to Accelerate Convergence)
Qk Rk = Ak−1 − σk I,
Ak = Rk Qk + σk I,
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 85 / 108
Example 21 (QR Iteration with Shifts)
1) Repeat previous example, but with shift of σ1 = 4, which is lower
right corner entry of matrix.
2) We compute QR factorization
0.832 0.555 3.61 1.66
A0 − σ1 I = Q1 R1 = ,
0.555 −0.832 0 1.11
Interactive example
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 86 / 108
Preliminary Reduction
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 87 / 108
Preliminary Reduction (Cont’d)
8) If any zero entries on the first subdiagonal, then the matrix is block
triangular, and the problem can be broken into two or more smaller
subproblems.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 88 / 108
Preliminary Reduction (Cont’d)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 89 / 108
Cost of QR Iteration
2) General matrices
10n3 for eigenvalues only;
25n3 for eigenvalues and eigenvectors.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 90 / 108
Krylov Subspace Methods (Russian applied mathematician,
1863–1945)
1) Krylov subspace methods reduce the matrix to Hessenberg (or tridiagonal)
form using only matrix-vector multiplication, developed by Krylov in 1931.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 93 / 108
Arnoldi Iteration (American engineer, 1917–1995)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 94 / 108
Arnoldi Iteration (Cont’d)
2) If
Q k = q1 · · · qk , (95)
then
Hk = QH
k AQk . (96)
is upper Hessenberg matrix.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 95 / 108
Arnoldi Iteration (Cont’d)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 96 / 108
Lanczos Iteration (Hungary, 1893–1974, Einstein’s
assistant in Berlin in 1928)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 98 / 108
Lanczos Iteration (Cont’d)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 99 / 108
Lanczos Iteration (Cont’d)
11) If eigenvalues are needed in the middle of the spectrum, say near σ,
then the algorithm can be applied to matrix (A − σI)−1 , assuming it
is practical to solve systems of form (A − σI)x = y.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 100 / 108
Example 22 (Lanczos Iteration)
For a 29 × 29 symmetric matrix with eigenvalues 1, · · · , 29, the behavior
of Lanczos iteration is shown below.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 101 / 108
Generalized Eigenvalue Problems
Ax = λBx, (97)
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 103 / 108
Generalized Eigenvalue Problems: QZ Algorithm
1) If A and B are triangular, then eigenvalues are given by λi = aii /bii ,
for bii 6= 0.
2) QZ algorithm reduces A and B simultaneously to upper triangular
form by orthogonal transformations.
3) First, B is reduced to upper triangular form by orthogonal
transformation from left, which is also applied to A.
4) Next, transformed A is reduced to upper Hessenberg form by
orthogonal transformation from left while maintaining the triangular
form of B, which requires additional transformations from the right.
5) Finally, analogous to QR iteration, A is reduced to triangular form
while still maintaining the triangular form of B, which again requires
transformations from both sides.
6) Eigenvalues can now be determined from mutually triangular form,
and eigenvectors can be recovered from products of left and right
transformations, denoted by Q and Z.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 104 / 108
Generalized Eigenvalue Problems: Matlab Application
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 105 / 108
Extension: Computing SVD
Barry A. Cipra, “The Best of the 20th Century: Editors Name Top 10
Algorithms”, SIAM News, vol. 33, no. 4.
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 107 / 108
Thank you very much for your attention!
Minghua Xia
Email: xiamingh@mail.sysu.edu.cn
Web: https://seit.sysu.edu.cn/teacher/XiaMinghua
Minghua Xia (Sun Yat-sen University) Matrix Analysis and Applications November 15, 2023 108 / 108