4.
6 The Q R decomposition:
Let A be an nxn real nonsingular matrix. A matrix Q is said to be an
orthogonal matrix if QQT=I=QTQ. We shall see that given the matrix we can find
an orthogonal matrix Q and an upper triangular matrix R (with rii >0) such that
A=QR called the QR decomposition of A. The Q and R are found as follows:
Let a(1) ; a(2) ; . , a(n) be the columns of A
q(1) ; q(2) ; , q(n) be the columns of Q
r(1) , r(2) , ., r(n) be the columns of R.
Note: Since Q is orthogonal we have
q (1)
= 1 = q (2 )
(q ( ) , q ( ) ) = 0
i
= ....... = q (n ) .......... ..( A )
2
if i j .. (B).
and since R is upper triangular we have
r (i )
r1i
r2 i
M
= rii .......... .......... ..(C )
0
M
0
Also the ith column of QR is; Qr(i) and ith column of
QR = r1i q (1) + r2i q (2 ) + ..... + rii q (i ) ....................(D )
We want A = QR.
Comparing 1st column on both sides we get
160
a(1) = QR s first column
= Qr(1)
= r11q(1) by (D)
a (1)
= r11 q (1)
= r11 q (1)
r11 > 0 and q 1
= r11
r11 = a (1 )
and q (1) =
= 1by( A)
1 (1)
a .......... ....... (E )
r11
giving 1st columns of R and Q.
Next comparing second columns on both sides we get
a(2) = Qr(2) = r12 q(1) +r22 q(2) .. (*)
Therefore from (*) we get
(a ( ) , q ( ) ) = r (q ( ) , q ( ) ) + r (q ( ) , q ( ) )
2
12
22
= r12 Q q (1) , q (1) = q (1 )
2
2
= 1by ( A )
and q ( 2 ) , q (1) = 0by (B )
r12 = a ( 2 ) , q (1) ............(F )
(*) gives
r22 q ( 2 ) = a (2 ) r12 q (1 )
and r22 q (2 )
= a ( 2 ) r12 q (1 )
r22 = a ( 2 ) r12 q (1 ) .......... .......... (G )
2
and
q (2 ) =
1
a ( 2 ) r12 q (1 ) .......... .......... ..(H
r22
(F), (G), (H) give 2nd columns of Q and R. We can proceed having got the first i
- 1 columns of Q and R we get ith columns of Q and R as follows:
r1i = a (i ) , q (1) ; r2i = a (1) , q (2 ) ,............, ri 1i = a (i ) , q (i1)
)
161
rii = a (i ) r1i q (1) r2i a (2 ) ....... ri 1i q (i 1)
q (i ) =
i (i )
a r1i q (1) r2i q (2 ) .......... ri 1 q (i 1)
rii
Example:
A = 1
0
2 1
0 1
1 1
1st column of Q and R
r11 = a (1)
q (1 ) =
= 12 + 12 = 2
1 (1 )
a
r11
2
1
=
2
0
2nd column of Q and R:
r12 = a (2 ) , q (1 )
r22 = a
(2 )
r12 q
2
= 0 ,
1
(1 )
2
2
1
2
=
=
2
2
0
2 1
= 0 1
1 0
1
= 1
1
= 3
2
162
q (2 ) =
[a ( ) r
2
12
q (1 )
3
1
3
1
3
1
3rd column of Q and R:
r13 = a (3 ) , q (1)
1
= 1 ,
1
r23 = a (3 ) , q (2 ) =
2
2
1
=
=
2
2
0
1
3
r33 = a (3 ) r13 q (1) r23 q (2 )
1 1
1
= 1 1
3
1 0
3
1
3
2
3
1
3
1
3
1
1 1 4
+ + =
9 9 9
2
3
and
163
q (3 ) =
1 (3 )
a r13 q (1) r23 q (2 )
r33
1
3
3 1
=
2 3
2
Q =
1
2
1
2
3
1
3
1
3
1
6
1
6
2
1
6
1
6
2
R = 0
2
3
0
2
1
3
2
3
and
QR = 1
0
2 1
0 1 = A
1 1
giving us QR decomposition of A.
The QR algorithm
Let A be any nonsingular nxn matrix.
Let A = A1 = Q1 R1 be its QR decomposition.
Let A2 = R1 Q1. Then find the QR decomposition of A2 as A2 = Q2 R2
Define A3 = R2 Q2 ; find QR decomposition of A3 as
A3 = Q3 R3.
Keep repeating the process. Thus
A1 = Q1 R1
A2 = R1 Q1
and the ith step is
Ai = Ri-1 Qi-1
Ai = Qi Ri
164
Then Ai converges to an upper triangular matrix exhibiting the eigenvalues of
A along the diagonal.
165