Professional Documents
Culture Documents
Massoud Malek
QR Decomposition
Every finite set of linearly independent vectors {X1 , X2 , , Xn } may be associated with
an orthonormal set of nonzero vectors {Q1 , Q2 , , Qn } with respect to a specific inner
product < , >; each vector Qk (k = 1, 2, , n) is a linear combination of Xj through
Xj1 . The following algorithm for producing the vectors Qj is called the Gram-Schmidt
orthonormalization process.
1
r11 X1
) and j = 1.
j1
X
rij Qi .
i=1
1
rjj Yj
< Xj , X j > .
1
rkk Xk
0
1
A=
1
1
1
0
1
1
1
1
0
1
1
1
= [A1 , A2 , A3 , A4 ] .
1
0
Numerical Analysis
First iteration:
Second iteration:
Third iteration:
QR Decomposition
Page 2
Fourth iteration:
Thus
0
1
1
1
1
0
1
1
1
1
0
1
1
0
1 1/3
=
1
1/3
0
1/ 3
3/ 15
2/ 15
1/15
1/ 15
3/35
3/ 35
4/ 35
1/ 35
1/7
3
1/7 0
0
1/ 7
2/ 7
0
2/ 3
15/3
0
0
2/ 3
2/
15
35/5
0
2/ 3
2/15
.
2/ 35
63/7
Clearly,
A(k+1) = (Q(k) )1 R(k) Q(k) k = 0, 1, 2,
The sequence finally converges to a diagonal matrix. When this occurs, the diagonal
entries of the matrix A(k) are approximations to the eigenvalues of A, and the approximations improve as we move on in the sequence. It is important to note that unlike the
California State University, East Bay
Numerical Analysis
QR Decomposition
Page 3
various power methods and deflation methods, repeated eigenvalues do not necessarily cause
any particular problem.
1
Example 2. For the matrix A = 1
1
follows:
1
2
1
3.666666
A(1) = 0.235702
0.408248
3.731707
(2)
A = 0.005322
0.034080
3.732050
A(5) = 0.000000
0.000000
3.732050
A(7) = 0.000000
0.000000
3.732050
A(10) = 0.000000
0.000000
1
1 some of the elements of the sequence are as
2
0.408248
0.288675
0.500000
0.005322
0.034080
0.982578
0.111553
0.111553
0.285714
0.000000
0.000000
0.999993
0.002199
0.002200
0.267956
0.000000
0.000000
1.000000
0.000158
0.000158
0.267949
0.000000
0.000000
1.000000
0.000003
0.000003
0.267949
0.235702
0.833333
0.288675
These results seem to indicate that the sequence is converging to a diagonal matrix with
diagonal entries 3.732050, 1, 0.267949. Since all the matrices in the sequence are similar,
these three numbers should be approximations to the eigenvalues of A. In fact, it is not
a shift at each iteration. We denote the (n,n) entry of A(k1) by sk1 . We use the QR
decomposition for the shifted matrix A(k1) sk1 In . The following example illustrates the
method.
Example 3. Let A =
A(0) 5I2 =
2
1
3
1
1
0
1
.
5
= Q(0) R(0) =
0.894427
0.447214
0.447214
0.894427
2.236068
0
0.894427
0.447124
2.236068 0.894427
0.894427 0.447214
1 0
2.6 0.2
+5
=
0
0.447124
0.447214
0.894427
0 1
0.2 5.4
2.8 0.2
0.997459 0.071247
2.807134 0.199492
(1)
(1) (1)
A 5.4I2 =
=Q R =
0.2
0
0.071247
0.997459
0
0.014249
Numerical Analysis
QR Decomposition
Page 4
2.807134 0.199492
0.997459 0.071247
1 0
A(2) = R(1) Q(1) + 5.4I2 =
+ 5.4
0
0.014249
0.071247
0.997459
0 1
2.585787 0.001015
=
0.001015 5.414213
2.828426 0.001015
(2)
A 5.414213I2 =
= Q(2) R(2)
0.001015
0
1.000000 0.000359
2.828427 0.1001015
=
0.000359
1.000000
0
0.000000
2.828427 0.1001015
1.000000 0.000359
1 0
(2) (2)
= R Q + 5.414214I2 =
+ 5.414213
0
0.000000
0.000359
1.000000
0 1
2.585786 0.000000
=
0.000000
5.414213
A(3)
It follows that the eigenvalues of A are the diagonal entries of the diagonal matrix A(3) .