numerical linear algebra biswa nath datta part ii_ch7-11

392

Upload: lpvasam

Post on 27-Apr-2015

788 views

Category:

Documents


37 download

TRANSCRIPT

Page 1: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

CHAPTER 7

LEAST SQUARES SOLUTIONS

TO LINEAR SYSTEMS

Page 2: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

7. LEAST SQUARES SOLUTIONS TO LINEAR SYSTEMS

Objectives

The major objectives of this chapter are to study least squares solution to the linear system

problem Ax = b. Here are the highlights of the chapter.

� Some applications giving rise to least squares problems (Sections 7.2 and 7.5).

� A result on the existence and uniqueness of the solution of least squares problems (The-

orem 7.3.1 of Section 7.3).

� Computational methods for least squares problem: The normal equations (Section

7.8.1) and theQR factorization (Section 7.8.2) methods for the full-rank overdetermined

problem; the QR factorization with column pivoting algorithm for the rank-de�cient

overdetermined problem (Section 7.8.3); and the normal equations (Section 7.9.1) and

the QR factorization methods (Section 7.9.2) for the minimum-norm solution of the

full-rank underdetermined problem.

� Sensitivity analyses of least squares and generalized inverse problems (Section 7.7).

� Iterative Re�nement procedure for least-squares problems (Section 7.10).

Background Material Needed for this Chapter

The following background material and the tools developed in previous chapters will be needed

for the smooth reading of this chapter.

1. The Cholesky factorization algorithm for solving a symmetric positive de�nite system

(Section 6.4.7).

2. The QR factorization using the Householder and Givens methods (Algorithms 5.4.2

and 5.5.2), The QR factorization of a non-square matrix.

3. Orthogonal projections (Section 5.6).

4. The QR factorization with column pivoting (Section 5.7).

5. The Iterative re�nement algorithm from Chapter 6 (Algorithm 6.9.1).

6. Perturbation analysis of linear systems (Section 6.6).

388

Page 3: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

7.1 Introduction

In Chapter 6 we discussed several methods for solving the linear system

Ax = b;

where A was assumed to be square and nonsingular. However, in several practical situations, such

as in statistical applications, geometric modeling, signal processing etc., one needs to solve

a system where the matrix A is non-square and/or singular. In such cases, solutions may not

exist at all; in cases where there are solutions, there may be in�nitely many. For example, when

A is m � n and m > n, we have an overdetermined system (that is, the number of equations is

greater than the number of unknowns), and an overdetermined system typically has no solution.

In contrast, an underdetermined system (m < n) typically has an in�nite number of solutions.

In these cases, the best one can hope for is to �nd a vector x which will make Ax as close as

possible to the vector b. In other words, we seek a vector x such that r(x) = kAx� bk is minimized.

When the Euclidean norm k � k2 is used, this solution is referred to as a least squares solution to

the system Ax = b. The term \least squares solution" is justi�ed, because it is a solution that

minimizes the Euclidean norm of the residual vector and, by de�nition, the square of the Euclidean

norm of a vector is just the sum of squares of the components of the vector. The problem of �nding

least squares solutions to the linear system Ax = b is known as the linear least squares problem

(LSP). The linear least squares problem is formally de�ned as follows:

Statement of the Least Squares Problem

Given a real m� n matrix A of rank k � min(m;n), and a real vector b, �nd a real

n-vector x such that the function r(x) = kAx� bk2 is minimized.

If the least squares problem has more than one solution, the one having the minimum Euclidean

norm is called the minimum length solution or the minimum norm solution.

This chapter is devoted to the study of such problems. The organization of the chapter is as

follows.

In Section 7.2 we show how a very simple business application leads to an overdetermined least

squares problem. In this section we simply formulate the problem as a least squares problem and

later in Section 7.5 we present a solution of the problem using normal equations.

389

Page 4: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

In Section 7.3 we prove a theorem on the existence and uniqueness of solution of an overdeter-

mined least squares problem.

In Section 7.7 we analyze the sensitivity of the least squares problems due to perturbations in

data. We prove only a simple result here and state other results without proofs.

Section 7.8 deals with computational methods for both full rank and rank-de�cient overdeter-

mined problems. We discuss the normal equations methods and the QR factorization methods

using Householder transformations, modi�ed Gram-Schmidt and Classical Gram-Schmidt orthog-

onalizations.

Underdetermined least squares problems are considered in Section 7.9. We again discuss here

the normal equations and the QR methods for an underdetermined problem.

In Section 7.10 an iterative improvement procedure for re�ning approximate solutions is pre-

sented.

In Section 7.11 we describe an e�cient way of computing the variance-covariance matrix of a

least squares solution, which is (ATA)�1.

7.2 A Simple Application Leading to an Overdetermined System

Suppose that the number of units bi of a product sold by a company in the district i of a town

depends upon the population ai1 (in thousands) of the district and the per capita income ai2 (in

thousands of dollars). The table below (taken from Neter, Wasserman and Kunter (1983)) compiled

by the company shows the sales in �ve districts, as well as the corresponding population and per

capita income.

District Sales Population Per Capita Income

i bi ai1 ai2

1 162 274 2450

2 120 180 3254

3 223 375 3802

4 131 205 2838

5 67 86 2347

Suppose the company wants to use the above table to predict future sales and believes (from past

experience) that the following relationship between bi, ai1, and ai2 is appropriate:

bi = x1 + ai1x2 + ai2x3:

If the data in the table has satis�ed the above relation, we have

162 = x1 + 274x2 + 2450x3

390

Page 5: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

120 = x1 + 180x2 + 3254x3

223 = x1 + 375x2 + 3802x3

131 = x1 + 205x2 + 2838x3

67 = x1 + 86x2 + 2347x3

or

Ax = b;

where

A =

0BBBBBBBB@

1 274 2450

1 180 3254

1 375 3802

1 205 2838

1 86 2347

1CCCCCCCCA; b =

0BBBBBBBB@

162

120

223

131

67

1CCCCCCCCA; x =

0BB@x1

x2

x3

1CCA :

The above is an overdetermined system of �ve equations in three unknowns.

7.3 Existence and Uniqueness

As in the case of solving a linear system, questions naturally arise:

1. Does a least squares solution to Ax = b always exist?

2. If the solution exists, is it unique?

3. How do we obtain such solutions?

The following theorem answers the questions of existence and uniqueness. Assume that the

system Ax = b is overdetermined, or square, that is, A is of order m� n where m � n.

An overdetermined system Ax = b can be represented graphically as:

x

A

=

b

m > n

The underdetermined case will be discussed later in this chapter.

391

Page 6: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Theorem 7.3.1 (Least Squares Existence and Uniqueness Theorem)

There always exists a solution to the linear least squares problem. This solution

is unique i� A has full rank, that is, rank(A) = n. If A is rank de�cient, then the

least squares problem has in�nitely many solutions.

We present a proof here in the full-rank case, that is, in the case when A has full rank. The

rank-de�cient case will be treated later in this chapter and in the chapter on the Singular Value

Decomposition (SVD) (Chapter 10).

First, we observe the following

Lemma 7.3.1 x is a least squares solution to an overdetermined system Ax = b if

and only if x satis�es

ATAx = A

Tb: (7.3.1)

Proof. We denote the residual r = b�Ax by r(x) to emphasize that given A and b, r is a function

of x. Let y be an n-vector. Then r(y) = b�Ay = r(x) +Ax �Ay = r(x) +A(x� y). So,

kr(y)k22 = kr(x)k22 + 2(x� y)TATr(x) + kA(x� y)k22:

First assume that x satis�es

ATAx = A

Tb;

that is, ATr(x) = 0. Then from the above, we have

kr(y)k22 = kr(x)k22+ kA(x� y)k22 � kr(x)k2;

implying that x is a least squares solution.

Next assume that ATr(x) 6= 0. Set AT

r(x) = z 6= 0. De�ne now a vector y such that

y = x+ �z:

Then

r(y) = r(x) + A(x� y) = r(x)� �Az

kr(y)k22 = kr(x)k22+ �2kAzk22 � 2�AT

r(x)zT

= kr(x)k22+ �2kAzk22 � 2�kzk22 < kr(x)k22;

392

Page 7: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

for any � > 0 if Az = 0, and for 0 < � <

2kzk22kAzk22

if Az 6= 0. This implies that x is not a least

squares solution.

Proof. (of Theorem 7.3.1) Since A has full rank, ATA is symmetric and positive de�nite and is

thus, in particular, a nonsingular matrix. The theorem, in the full rank case, is now proved from

the fact that the linear system

ATAx = A

Tb

has a unique solution i� ATA is nonsingular.

7.4 Geometric Interpretation of the Least Squares Problem

Let A be an m � n matrix with m > n. Then A is a linear mapping of Rn ! R

m. R(A) is a

subspace of Rm. Every vector u 2 R(A) can be written as u = Ax for some x 2 Rn. Let b 2 Rm.

Because k � k2 is a Euclidean norm, kb� Axk2 is the distance between the end points of b and Ax.

It is clear that this distance is minimal if and only if b�Ax is perpendicular to R(A) (see Fig. 7.1).

In that case, kb� Axk2 is the distance from the end point of b to the \plane" R(A).

R(A)

bb-Ax

Ax

Figure 7.1

From this interpretation, it is easy to understand that a solution of the least squares problem

to the linear system Ax = b always exists. This is because one can project b to the \plane" R(A)

to obtain a vector u 2 R(A) and there is x 2 Rn such that u = Ax. This x is a solution.

Because b� Ax is perpendicular to R(A) and every vector in R(A) is a linear combination of

column vectors of A, then b� Ax is orthogonal to every column of A. That is,

AT (b� Ax) = 0

393

Page 8: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

or

ATAx = A

Tb:

7.5 Normal Equations and Polynomial Fitting

De�nition 7.5.1 The system of equations

ATAx = A

Tb

is called the normal equations.

A well-known example of how normal equations arise in practical applications is the �tting of

a polynomial to a set of experimental data.

The engineers and scientists gather data from experiments. A meaningful representation of the

collected data is needed to make meaningful decisions for the future.

Let (x1; y1); (x2; y2); : : : ; (xn; yn) be a set of paired observations. Suppose that the mth (m � n)

degree polynomial

y(x) = a0 + a1x+ a2x2 + � � �+ amx

m (7.5.2)

is the \best-�t" for this set of data. One strategy for \best-�t" is to minimize the sum of the

squares of the residuals

E =

nXi=1

(yi � a0 � a1xi � a2x2i � � � � � amx

mi )

2: (7.5.3)

We must then have�E

�ai

= 0; i = 1; : : : ; m:

Now,

�E

�a0

= �2nXi=1

(yi � a0 � a1xi � a2x2i � � � � � amx

mi )

�E

�a1

= �2nXi=1

xi(yi � a0 � a1xi � a2x2i � � � � � amx

mi ) (7.5.4)

...

�E

�am

= �2nXi=1

xmi (yi � a0 � a1xi � � � � � amx

mi )

394

Page 9: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Setting these equations to zero, we have

a0n + a1

Xxi + a2

Xx2i + � � �+ am

Xxmi =

Xyi

a0

Xxi + a1

Xx2i + � � �+ am

Xxm+1i =

Xxiyi (7.5.5)

...

a0

Xxmi + a1

Xxm+1i + � � �+ am

Xx2mi =

Xxmi yi

(whereP

denotes the summation from i = 1 to n).

SettingX

xki = Sk; k = 0; 1; � � � ; 2m and denoting the entries of the right hand side, respec-

tively, by b0; b1; � � � ; bm, the system of equations can be written as:0BBBBB@

S0 S1 � � � Sm

S1 S2 � � � Sm+1

......

Sm Sm+1 � � � S2m

1CCCCCA

0BBBBB@

a0

a1

...

am

1CCCCCA =

0BBBBB@

b0

b1

...

bm

1CCCCCA : (7.5.6)

(Note that S0 = n.)

This is a system of (m+ 1) equations in (m+ 1) unknowns a0; a1; � � � ; am.This is really a system of normal equations. To see this, de�ne

V =

0BBBBB@

1 x1 � � � xm1

1 x2 xm2

......

. . ....

1 xn xmn

1CCCCCA : (7.5.7)

Then the above system becomes equal to

VTV a = b; (7.5.8)

where a = (a0; a1; : : : ; am)T , and b = (b0; b1; : : : ; bm)

T .

This is a system of normal equations; furthermore, if the xi's are all distinct, then the matrix

V has full rank.

The matrix V is known as the Vandermonde matrix. From our discussion in the previous

section, we see that a is the least squares solution to the system (7.5.8).

Example 7.5.1

Suppose that an electrical engineer has gathered the following experimental data consisting of

the measurement of the current in an electric wire for various voltages.

x = voltage 0 2 5 7 9 13 24

y = current 0 6 7:9 8:5 12 21:5 35

395

Page 10: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

We would like to derive the normal equations for the above data corresponding to the best �t of

the data to (a) straight line (b) a quadratic, and would like to see a comparison of the predicted

results with the actual result when v = 5.

Case 1. Straight line Fit

V =

0BBBBBBBBBBBBBB@

1 0

1 2

1 5

1 7

1 9

1 13

1 24

1CCCCCCCCCCCCCCA

; y =

0BBBBBBBBBBBBBB@

0

6

7:9

8:5

12:0

21:5

35:0

1CCCCCCCCCCCCCCA

:

The Normal Equations are:

VTV a = V

Ty = b

7 60

60 904

!a = 103

0:0906

1:3385

!:

The solution of these equations are:

a0 = 0:6831

a1 = 1:4353:

The value of a0 + a1x at x = 5 is 0:6831 + 1:4345� 5 = 7:8596.

Case 2. Quadratic Fit

V =

0BBBBBBBBBBBBBB@

1 0 0

1 2 4

1 5 25

1 7 49

1 9 81

1 13 169

1 24 576

1CCCCCCCCCCCCCCA

:

The normal equations are

VTV a = V

Ty = b0

BB@7 60 904

60 904 17226

904 17226 369940

1CCA a = 104

0BB@0:0091

0:1338

2:5404

1CCA :

396

Page 11: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

The solution of these normal equations is:

a =

0BB@a0

a1

a2

1CCA =

0BB@0:8977

1:3695

0:0027

1CCA :

The value of a0 + a1x + a2x2 at x = 5 is 7.8127.

Note: The use of higher degree polynomial may not necessarily give the best result. The matrix

of the normal equations in this case is ill-conditioned:

Cond2(VTV ) = 2:3260� 105:

Indeed, it is well-known that the Vandermonde matrices become progressively ill-

conditioned as the order of matrices increases.

7.6 Pseudoinverse and the Least Squares Problem

Denote (ATA)�1AT = A

y.

De�nition 7.6.1 The matrix

Ay = (AT

A)�1AT

is called the pseudoinverse or the Moore-Penrose generalized inverse of A. From (7.3.1), it therefore

follows that the unique least-squares solution is x = Ayb.

Least Squares Solution Using the Pseudoinverse

The unique least squares solution x to the full-rank least-squares problem Ax = b

is given by

x = (ATA)�1AT

b = Ayb:

Clearly, the above de�nition of the pseudoinverse generalizes the ordinary de�nition of the

inverse of a square matrix A. Note that when A is square and invertible,

Ay = (AT

A)�1AT = A�1(AT )�1AT = A

�1:

397

Page 12: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

We shall discuss this important concept in some more detail in Chapter 10. An excellent reference

on the subject is the book Generalized Inverses by C. R. Rao and S. K. Mitra (1971). Having

de�ned the generalized inverse of a rectangular matrix, we now de�ne the condition number of such

a matrix as Cond(A) = kAk kAyk.

De�nition 7.6.2 If an m� n matrix A has full rank, then Cond(A) = kAk kAyk.

Note: If not explicitly stated, all the norms used in the rest of this chapter are

2-norms, and Cond(A) is the condition number with respect to 2-norm. That is,

Cond(A) = kAk2 kAyk2.

Example 7.6.1

A =

0BB@1 2

2 3

4 5

1CCA ; rank(A) = 2:

Thus, A has full rank.

Ay = (AT

A)�1AT =

�1:2857 �0:5714 0:8577

1 0:5000 �0:5000

!

Cond2(A) = kAk2 kAky2 = 7:6656� 2:0487 = 15:7047 :

Variance-Covariance Matrix

In certain applications, the matrix ATA is called the information matrix, since it measures

the information contained in the experiment, and the matrix (ATA)�1 is known as the variance-

covariance matrix. An algorithm for computing the variance-covariance matrix with-

out explicitly computing the inverse is given in Section 7.11.

7.7 Sensitivity of the Least Squares Problem

In this section we study the sensitivity of a least squares solution to perturbations in data, that

is, we investigate how a least squares solution changes with respect to small changes in the data.

This study is important in understanding the di�erent behaviors of di�erent methods for solving

the least squares problem that will be discussed in the next section. We consider two cases:

perturbation in the vector b and perturbation in the matrix A. The results in this section are

norm-wise perturbation results. For component-wise perturbation results, see Bj�orck (1992), and

Chandrasekaran and Ipsen (1994).

398

Page 13: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Case 1: Perturbation in the vector b

Here we assume that the vector b has been perturbed to b = b+ �b, but A has remained unchanged.

Theorem 7.7.1 (Least-Squares Right Perturbation Theorem) Let x and x,

respectively, be the unique least-squares solutions to the original and the perturbed

problems. Then if kbRk 6= 0,

kx� xkkxk � Cond(A)

k�bRkkbRk

:

Here

Cond(A) = kAk kAyk;

and bR and �bR are, respectively, the projections of the vectors b and �b onto R(A).

Proof. Since x and x are the unique least squares solutions to the original and the perturbed

problems, we have

x = Ayb

x = Ay(b+ �b):

Thus,

x� x = Ayb+ A

y�b�A

yb = A

y�b: (7.7.1)

Let �bN denote the projection of �b onto the orthogonal complement of R(A). That is,

�b = �bR + �bN :

Since �bN lies in the orthogonal complement of R(A) = N(AT ), we have AT (�bN) = 0. So

x� x = Ay�b = A

y(�bR + �bN)

= Ay(�bR) +A

y(�bN) = Ay�bR + (AT

A)�1AT�bN = A

y�bR:

Again, since x is the unique least squares solution, we have

Ax = bR

from which (again taking norms on both sides) we get

kxk � kbRkkAk : (7.7.2)

399

Page 14: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Combining (7.7.1) and (7.7.2), we have the theorem.

Interpretation of Theorem 7.7.1

Theorem 7.7.1 tells us that if only the vector b is perturbed, then, as in the case of

linear systems, Cond(A) = kAk kAyk serves as the condition number in the sensitivity

analysis of the unique least squares solution. If this number is large, then even with a small

relative error in the projection of b onto R(A), we might have a drastic change in the least squares

solution. On the other hand, if this number is small and the relative error in the projection of b

onto R(A) is also small, then the least squares solution will not change much. Note that it is the

smallness of the relative error in the projection of b onto R(A), namelyk�bRkkbRk

, that plays the role

here, not merely the smallness of k�bRk.

Example 7.7.1 An Insensitive Problem

A =

0BB@1 2

0 1

1 0

1CCA ; b =

0BB@1

1

1

1CCA ; �b = 10�4

0BB@1

1

1

1CCA

PA = Projection of A onto R(A)

=

0BB@0:9333 0:3333 0:1667

0:3333 0:3333 �0:33330:1667 �0:3333 0:8333

1CCA

(See Example 5.6.2 of Chapter 5.)

bR = PAb =

0BB@1:3333

0:3333

0:6667

1CCA

�bR = PA�b = 10�3

0BB@0:13333

0:03333

0:06667

1CCA

Cond(A) = 2:4495:

Sincek�bRkkbRk

= 10�4, a small number, and A is well-conditioned, from Theorem 7.7.1 above, we

expect that the least squares solution will not be perturbed much. The following computations

400

Page 15: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

show this is indeed the case.

x = Ayb =

:6667

:3333

!

x = Ay(b+ �b) =

:6667

:3334

!

kx� xkkxk = 2:4495� 10�4

Example 7.7.2 A Sensitive Problem

A =

0BB@

1 1

10�4 0

0 10�4

1CCA ; b =

0BB@

2

10�4

10�4

1CCA

�b = 10�3

0BB@1

:1

0

1CCA ; Cond(A) = O(104) :

x =

1

1

!; x =

1:5005

0:5005

!:

Using results of Example 5.6.3 from Chapter 5, we have

bR = PAb =

0BB@

2

10�4

10�4

1CCA ; bN =

0BB@0

0

0

1CCA

Since the product of the condition number andk�bRkkbRk

is 7.0888, we should expect a substantial

change in the solution. Indeed this is true.

kx� xkkxk = 0:5000 (Large!)

Case 2. Perturbation in the matrix A

The analysis here is much more complicated than the previous case. We will state the result here

(without proof) and the major consequences of the result. Let the perturbation E of the matrix

be small enough so that

rank(A) = rank(A+E):

401

Page 16: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Let x and x denote the unique least squares solutions, respectively, to the original and to the

perturbed problem. Let EA and EN denote the projections of E onto R(A) and onto the orthogonal

complement of R(A), respectively. Then if bR 6= 0, we have the following theorem due to Stewart

(1969).

Theorem 7.7.2 (Least-Squares Left Perturbation Theorem) Let x and x be

the unique least-squares solutions to Ax = b and (A+E)x = b, and let rank(A+E)

be the same as rank(A). Then

kx� xkkxk � 2Cond(A)

kEAkkAk + 4(Cond(A))2

kENkkAk

kbNkkbRk

+O

�kENkkAk

�2

Interpretation of Theorem 7.7.2

Theorem 7.7.2 tells us that in the case where only the matrix A is perturbed, the

sensitivity of the unique least squares solution, in general, depends upon the squares

of the condition number of A. However, if kENk or kbNk is zero or small, then the

sensitivity will depend only on the Cond(A). Note that the residual r = b � Ax is zero if

bN = 0.

Two Examples with Di�erent Sensititivities

We now present two examples with the same matrix A, but with di�erent b, to illustrate

the di�erent sensitivities of the least squares problem in di�erent cases. In the �rst example,

(Cond(A))2 serves as the condition number of the problem; in the second example,

Cond(A) serves as the condition number.

Example 7.7.3 Sensitivity Depending Upon the Square of the Condition Number

A =

0BB@

1 1

0:0001 0

0 0:0001

1CCA ; b =

0BB@1

1

1

1CCA

bR = PAb =

0BB@1:0001

0:0001

0:0001

1CCA ; bN =

0BB@�0:00010:9999

0:9999

1CCA ;

kbNkkbRk

= 1:

402

Page 17: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

(Using PA from Example 5.6.3 of Chapter 5.) Let

E = 10�4

0BB@0 �0:00010 0:9999

0 0:9999

1CCA

A+E =

0BB@

1 1

0:0001 0:0001

0 0:0002

1CCA ; EN = 10�4

0BB@0 10�4

0 0:9999

0 0:9999

1CCA

kENkkAk =

kEkkAk = 9:999� 10�5:

Though the product ofkENkkAk and

kbNkkbRk

is rather small, since (Cond(A))2 = 2 � 108 is large, we

should expect a drastic departure of the computed solution from the true solution. This is indeed

true, as the following computations show:

x = 103

�4:999

5

!; x =

0:5

0:5

!

kx� xkkxk = 9:999� 103 (Large!) :

Note thatkENkkAk � kbNkkbRk

� (Cond(A))2 = 9:999� 10�5 � 2� 108 = 1:9998� 104:

Example 7.7.4 Sensitivity Depending Upon the Condition Number

Let

E = 10�4

0BB@0 �0:00010 0:9999

0 0:9999

1CCA (same as in Example 7.7.3)

A =

0BB@

1 1

0:0001 0

0 0:0001

1CCA ; b =

0BB@

2

0:0001

0:0001

1CCA :

In this case, bR = b and bN =

0BB@0

0

0

1CCA. Note that PA =

0BB@

1 10�4 10�4

10�4 0:5000 �0:500010�4 �0:5000 0:5000

1CCA. (See

Example 5.6.3 of Chapter 5.)

403

Page 18: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Thus, according to Theorem 7.7.2, the square of Cond(A) does not have any e�ect; the least

squares solution is a�ected only by Cond(A). We verify this as follows:

x = Ayb =

1

1

!

x ==

1:4999

0:5000

!

Cond(A) = 1:4142� 104

EA = 10�4

0BB@

1 1

10�4 0

0 10�4

1CCA

kEAkkAk = 10�4

kx � xkkxk = 0:5000 :

Residual Sensitivity. We have just seen that the sensitivities of the least squares solutions due

to perturbations in the matrix A are di�erent for di�erent solutions; however, the following theorem

shows that the residual sensitivity always depends upon the condition number of the

matrix A. We state the result in somewhat simpli�ed and crude form. See Golub and Van Loan,

MC (1983, pp. 141{144) for a precise statement and proof of a result on residual sensitivity.

Theorem 7.7.3 (Least-Squares Residual Sensitivity Theorem) Let r and r

denote the residuals, respectively, for the original and the perturbed least squares

problems; that is,

r = b�Ax

r = b� (A+E)(x):

Thenkr � rkkbk � kENk

kAk + 2Cond(A)kENkkAk + O

�kENkkAk

�2

:

Interpretation of Theorem 7.7.3

404

Page 19: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

The above result tells us that the sensitivity of the residual depends at most on

the condition number of A.

Example 7.7.5

A =

0BB@

1 1

10�4 0

0 10�4

1CCA ; b =

0BB@1

1

1

1CCA

E = 10�4

0BB@0 �0:00010 0:9999

0 0:9999

1CCA

x =

0:5

0:5

!; x = 103

�4:9999

5

!

r = b� Ax =

0BB@�0:00010:9999

0:9999

1CCA

r = b� (A+E)x =

0BB@

�10:9998

0:9999

1CCA

kr � rkkbk = 0:5; EN = PN �EA = 10�4

0BB@0 �10�4

0 0:9999

0 0:9999

1CCA

Cond(A) = 1:4142� 104

and

Cond(A) � kENkkAk = 1:4142:

The inequality in Theorem 7.7.3 is now easily veri�ed.

Sensitivity of the Pseudoinverse. The following result, due to Wedin (1973), shows that it is

Cond(A) again that plays a role in the sensitivity analysis of the pseudoinverses of a matrix.

405

Page 20: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Theorem 7.7.4 (Pseudoinverse Sensitivity Theorem) Let A be m�n, wherem � n. Let Ay and ~

Ay be, respectively, the pseudoinverse A and of ~

A = A + E.

Then, provided that rank(A) = rank( ~A), we have ~Ay � Ay ~Ay �

p2Cond(A)

kEkkAk :

Example 7.7.6

A =

0BB@1 2

2 3

4 5

1CCA ; E = 10�4A =

0BB@0:0010 0:0020

0:0020 0:0030

0:0040 0:0050

1CCA

Ay =

�1:2857 �0:5714 0:8571

1 0:5000 �0:5000

!

A+ E = ~A =

0BB@1:001 2:002

2:002 3:003

4:004 5:005

1CCA

~Ay =

�1:2844 �0:5709 0:8563

0:9990 0:499995 �0:4995

!

~Ay �Ay ~Ay = 10�4 � kEk

kAk :

Note that

Cond(A) = 15:7047:

7.8 Computational Methods for Overdetermined Least Squares Problems

7.8.1 The Normal Equations Method

One of the most widely used approaches (especially in statistics) for computing the least squares

solution is the normal equations method. This method is based upon the solution of the system of

normal equations

ATAx = A

Tb:

406

Page 21: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

We assume that A is m � n (m > n) and that it has full rank. Since in this case ATA is

symmetric and positive de�nite it admits the Cholesky decomposition

ATA = HH

T:

Therefore, the normal equations approach for solving the least squares problem can be stated as

follows:

Algorithm 7.8.1 Least Squares Solution Using Normal Equations

Given an m � n (m > n) matrix A with rank(A) = n, the following algorithm computes the

least squares solution x from normal equations using Cholesky factorization.

(1) Form c = ATb.

(2) Find the Cholesky factorization of ATA = HH

T .

(3) Solve the triangular systems in the sequence

Hy = c

HTx = y:

Flop-Count. The above method for solving the full rank least squares problem requires aboutmn

2

2+n3

6 op:

mn2

2for computing A

TA and A

Tb,

n3

6for computing the Cholesky factorization

of ATA, and n

2 op to solve two triangular systems. Thus, the method is quite e�cient.

Example 7.8.1 Normal Equation Solution of the Case-Study Problem

A =

0BBBBBBBB@

1 274 2450

1 180 3254

1 375 3802

1 205 2838

1 86 2347

1CCCCCCCCA; b =

0BBBBBBBB@

112

120

223

131

67

1CCCCCCCCA

(1) Form ATA =

0BB@

5 1120 14691

1120 297522 3466402

14691 3466402 44608873

1CCA

(2) Form ATb =

0BB@

703

182230

2164253

1CCA

407

Page 22: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

(3) Solve the normal equations:

ATAx = A

Tb

x =

0BB@7:0325

0:5044

0:0070

1CCA :

Note that the system is very ill conditioned:

Cond(ATA) = 3:0891� 108:

To see how the computed least squares solution agrees with the data of the table, we compute

( 1 274 2450 )

0BB@x1

x2

x3

1CCA = 162:4043

(True value = 162)

( 1 180 3254 )

0BB@x1

x2

x3

1CCA = 120:6153

(True value = 120)

( 1 375 3802 )

0BB@x1

x2

x3

1CCA = 222:8193

(True value = 223)

( 1 205 2838 )

0BB@x1

x2

x3

1CCA = 130:3140

(True value = 131)

( 1 81 2347 )

0BB@x1

x2

x3

1CCA = 66:847

(True value = 67):

Suppose that the company would like to predict, using the above results, the sales in a district

with the population 220,000 and per capita income of $2,500. Then the best prediction using the

408

Page 23: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

given model is

( 1 220 2500 )

0BB@7:0325

0:5044

0:0070

1CCA = 135:5005

Note: In this example, the residuals are small in spite of the fact that the data matrix A is

ill-conditioned.

Example 7.8.2

A =

0BB@1 2

2 3

3 4

1CCA ; b =

0BB@3

5

9

1CCA

rank(A) = 2; rank(A; b) = 3. Thus the system Ax = b does not have a solution. We therefore

calculate the least squares solution.

(1) c = ATb =

40

57

!

(2) Cholesky factorization of ATA:

H =

3:7417 0

5:3452 0:6547

!

(3) Solutions of the triangular systems:

y =

10:6904

�0:2182

!;

x =

3:3333

�0:3333

!:

The unique least squares solution is x =

3:3333

�0:3333

!.

Note that

Ay = (AT

A)�1AT =

�1:8333 �0:3333 1:1667

1:3333 0:3333 �0:6667

!

and

Ayb =

3:3333

�0:3333

!:

Numerical di�culties with the normal equations method

409

Page 24: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

The normal equations method, though easy to understand and implement, may give rise to

numerical di�culties in certain cases.

First, we might lose some signi�cant digits during the explicit formation of ATA and the

computed matrix ATA may be far from positive de�nite; computationally, it may even be singular.

Indeed, it has been shown by Stewart (IMC, pp. 225{226) that, unless Cond(A) is less than 10t

2 ,

where it is assumed that ATA has been computed exactly and then rounded to t signi�cant digits,

then ATA may fail to be positive de�nite or even may not be nonsingular. The following simple

example illustrates that fact.

Example 7.8.3

Consider

A =

0BB@

1 1

10�4 0

0 10�4

1CCA

with t = 9. The columns of A are linearly independent. Now, compute

ATA =

1 + 10�8 1

1 1 + 10�8

!

Since t = 9, we will get

ATA =

1 1

1 1

!;

which is singular. Note that Cond(A) = 1:4142� 104 > 10t

2 = 104.

Second, the normal equations approach may, in certain cases, introduce more errors than those

which are inherent in the problem. This is seen as follows.

From the perturbation analysis done in Chapter 6, we easily see that, if x is the computed least

squares solution obtained by the normal equations method, then

kx� xkkxk � � Cond(AT

A)

= � (Cond(A))2: (Exercise):

Thus, the accuracy of the least squares solution using normal equations will depend upon the square

of the condition number of the matrix A. However, we have just seen in the section on perturbation

analysis of the least squares problem that in certain cases such as when the residual is zero, the

sensitivity of the problem depends only on the condition number of A (see Theorems 7.7.1 and

7.7.2). Thus, in these cases, the normal equations method will introduce more errors

in the solution than what is warranted by the data.

410

Page 25: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

A Special Note on the Normal Equations Method

In spite of the drawbacks mentioned above about the normal equations method, we must stress

that the method is still regarded as a useful tool for solving the least squares problem, at least in

the case where the matrix A is well conditioned. In fact, it is routinely used in many practical

applications and seems to be quite popular with practicing engineers and statisticians. Note that

in the example above, if we would use an extended precision in our computations, the computed

matrix ATA could be obtained as a symmetric positive de�nite matrix and the normal equations

method would yield an accurate answer, despite ill-conditioning; as the following computations

show:

ATA =

1:00000001 1

1 1:00000001

!

C = ATb =

2:00000001

2:00000001

!

H = the Cholesky factor of ATA =

1:000000005 0

0:999999995 0:00014142135581

!:

Solution of Hy = c:

y =

2

0:00014142135651

!:

Solution of HTx = y:

x =

0:999999999500183

1:0000000499817

!� 1

1

!:

(The exact solution.)

7.8.2 The QR Factorization Methods for the Full-Rank Problem

Let QTA = R =

R1

0

!be the QR decomposition of the matrix A. Then, since the length of a

vector is preserved by an orthogonal matrix multiplication, we have

kAx� bk22

= QTAx� Q

Tb

22

= kR1x� ck22+ kdk2

2;

where QTb =

c

d

!. Thus, kAx� bk22 will be minimized if x is chosen so that

R1x� c = 0:

411

Page 26: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

The corresponding residual then is given by

krk2 = kdk2

This observation immediately suggests the following QR approach for solving the least squares

problem:

Least Squares Using QR

(1) Decompose Am�n = Qm�mRm�n.

(2) Form QTn�mbm�1 =

c

d

!.

(3) Solve the upper triangular system

R1x = c

where

R =

R1

0

!:

Use of Householder Matrices

Once A is decomposed into QR and the vector QTb is formed, the solution x is obtained by back

substitution. Suppose that the Householder method is used to compute the QR decomposition of

A. Then, following the notations of Chapter 5, we see that the product QTb can be formed as:

For k = 1; 2; : : : ; n

b = Hkb,

where Hk; k = 1; : : : ; n are the Householder matrices such that

QT = HnHn�1 � � �H2H1:

Thus, the matrix Q does not have to be formed explicitly.

The idea of solving the least squares problem based on the QR factorization of A using the

Householder transformation was �rst suggested by Golub (1965).

412

Page 27: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Algorithm 7.8.2 The Householder-Golub method for the full-rank least squares prob-

lem

Given an m�n matrix A (m � n) with rank(A) = n and an m-vector b, the following algorithm

computes the least squares solution x using Householder matrices H1 through Hn.

1. Apply the Householder method toA. Obtain R1 and the Householder matricesH1; H2; : : : ; Hn.

2. Form HnHn�1 � � �H2H1b =

c

d

!, where c is an n-vector.

3. Solve R1x = c.

Flop-count. Since the cost of the algorithm is dominated by the cost of the QR decomposition

of A, the overall op-count for the full-rank least squares solution using Householder's method is

n2

�m� n

3

�(Exercise):

Thus, the method is about twice as expensive as the normal equations method. Note that the

normal equations method requires about

�n2m

2+n3

6

� op.

Round-o� Error and Stability. The method is stable. It has been shown in Lawson and

Hanson (SLP, p. 90) that the computed solution x is such that it minimizes

k(A+ E)x� (b+ �b)k2

where E and �b are small. Speci�cally,

kEkF

� c�n kAkF+O(�2)

and k�bk2 � c� kbk2 +O(�2);

where c � (6m� 3n+ 41)n and � is machine precision. That is, the computed solution is the

exact least squares solution of a nearby problem.

Example 7.8.4

A =

0BB@1 2

2 3

3 4

1CCA ; b =

0BB@3

5

9

1CCA

413

Page 28: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

(1) A = QR:

Q =

0BB@�0:2673 0:8724 0:4082

�0:5345 0:2182 �0:8165�0:8018 �0:4364 0:4082

1CCA

R =

0BBBBB@

�3:7417 �5:34520 0:6547

0 0

1CCCCCA =

R1

0

!:

(2)

QTb =

c

d

!

=

0BB@�10:6904�0:21820:8165

1CCA :

(3) Solution of the system R1x = c: �3:7417 �5:3452

0 0:6547

!x =

�10:6904�0:2182

!

The least squares solution is

x =

3:3332

�0:3333

!:

Norm of the residual = krk2 = kdk = 0:8115

Example 7.8.5

A =

0BB@

1 1

0:0001 0

0 0:0001

1CCA ; b =

0BB@

2

0:0001

0:0001

1CCA

(1) A = QR

Q =

0BB@

�1 0:0001 �0:0001�0:0001 �0:7071 0:7071

0 0:7071 0:7071

1CCA

R =

0BB@�1 �10 0:0001

0 0

1CCA =

R1

0

!

(See Example 5.4.3 from Chapter 5.)

414

Page 29: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

(2)

QTb =

0BB@

�20:0001

0

1CCA =

c

d

!

(3) Solution of the system: R1x = c

�1 �10 0:0001

! x1

x2

!=

�2

0:0001

!

x1 = 1

x2 = 1:

The unique least squares solution is

1

1

!. Note that

Ay = 103

0:0005 5 �50:0005 �5 5

!

Ayb =

1

1

!:

Norm of the residual = krk2 = kdk = 0.

Use of Givens Rotations

We can, of course, use the Givens rotations to decompose A into QR and then use this decom-

position to solve the least squares problem. However, as we have seen before, the use of Givens

rotations will be more expensive than the use of Householder matrices. Recall that computations

of Givens rotations require evaluations of square roots; however, there are \square-root free"

Givens rotations, introduced by M. Gentleman (1973), which can be used to solve the least

squares problem. The square-root free Givens rotations are also known as fast Givens rotations.

For details, see Golub and Van Loan MC 1984 (pp. 156-157).

Use of Gram-Schmidt and Modi�ed Gram-Schmidt Algorithms

Another technique, known as the Gram-Schmidt process, can be used to decompose A

into QR. A properly implemented Gram-Schmidt process, when used to solve the linear least

squares problem, is just slightly more expensive than the Householder method, but seems to be as

numerically as e�ective as the Householder method for solving the least squares problem. We �rst

state these algorithms for QR factorization and then show how the modi�ed Gram-Schmidt can be

used to solve the least squares problem.

415

Page 30: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Algorithm 7.8.3 Classical Gram-Schmidt (CGS) for QR Factorization

Given A = (a1; a2; : : : ; an) of orderm�n with rank(A) = n, the following algorithm computes a

matrix Qm�n = (q1; : : : ; qn) with orthonormal columns and an upper triangular matrix R = (rij)n�n

such that A = Qm�nRn�n.

For k = 1; 2; : : : ; n do

For i = 1; 2; : : : ; k� 1 do

rik � qTi ak

qk � ak �k�1Xi=1

rikqi

rkk = kqkk2qk �

qk

rkk

:

The algorithm, as outlined above, is known to have serious numerical di�culties. During the

computations of the qk's, cancellation can take place and, as a result, the computed

qk's can be far from orthogonal. (See later in this section for details.)

The algorithm, however, can be modi�ed to have better numerical properties. The following

algorithm, known as the modi�ed Gram-Schmidt algorithm, computes the QR factorization

of A in which, at the kth step, the kth column of Q and the kth row of R are computed (note that

the Gram-Schmidt algorithm computes the kth columns of Q and R at the kth step).

Algorithm 7.8.4 Modi�ed Gram-Schmidt (MGS) for QR Factorization

Set qk = ak; k = 1; 2; : : : ; n.

For k = 1; 2; : : : ; n do

rkk = kqkk2qk �

qk

rkk

For j = k + 1; : : : ; n do

rkj � qTk qj

qj � qj � rkjqk:

The above is the row-oriented modi�ed Gram-Schmidt method. The column-oriented version

can similarly be developed (Exercise #17). The two versions are numerically equivalent.

Remarks: The modi�ed Gram-Schmidt algorithm is not as satisfactory as the Householder or

Givens method for computing the QR factorization of A. It can be shown (Bj�orck (1992)) that the

computed Q by MGS, denoted by ~Q, satis�es ~

QT ~Q = I +E, where kEk � �Cond(A), whereas the

Householder method produces ~QT ~Q = I+E where kEk � �. (For more details, see the discussions

in the next section.)

416

Page 31: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Flop-count. The op-count for the MGS is mn2, compared to mn

2 � n3

3needed by the

Householder method. (Note that MGS works with the full length column vector at each

step, whereas the Householder method deals with successively shorter columns.)

Although in the 2 � 2 case the CGS and MGS algorithms produce the same results, we use a

2� 2 example to illustrate here how the computational arrangements di�er with the same matrix.

All computations are performed with 4-digit arithmetic.

Example 7.8.6

A =

0BB@

1 1

0:0001 0

0 0:0001

1CCA ; b =

0BB@

2

0:0001

0:0001

1CCA

Gram-Schmidt

k=1:

q1 = a1 =

0BB@

1

0:0001

0

1CCA ; r11 = kq1k2 = 1

q1 =q1

r11

=

0BB@

1

0:0001

0

1CCA

k=2:

r12 = 1; q2 = a2 � r12q1 = 10�1

0BB@

0

�11

1CCA

q2 =

0BB@

0

�0:70710:7071

1CCA

qT1 q2 = �7:0711� 10�5

Form Q and R:

Q = (q1; q2) =

0BB@

1 0

0:0001 �0:70710 0:7071

1CCA

R =

r11 r12

0 r22

!=

1 1

0 1:414� 10�4

!

417

Page 32: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Form c:

c = QTb =

2

0

!

The least squares solution is x =

2

0

!.

Modi�ed Gram-Schmidt

q1 = a1; q2 = a2

k=1:

r11 = kq1k2 = 1

q1 =

0BB@

1

0:0001

0

1CCA

r12 = qT1 q2; q2 = q2 � r12q1 =

0BB@

0

�0:00010:0001

1CCA

k=2:

r22 = kq2k = 1:4142� 10�4

q2 =q2

r22

=

0BB@

0

�0:70710:7071

1CCA

Form Q and R:

Q =

0BB@

1 0

0:0001 �0:70710 0:7071

1CCA ; R =

1 1

0 1:4142� 10�4

!

The least squares solution is x =

2

0

!. (Note that for the same problem, the Householder-

QR method produced x =

1

1

!, which is correct (Example 7.8.5).)

418

Page 33: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Modi�ed Gram-Schmidt versus Classical Gram-Schmidt Algorithms

Mathematically, the CGS and MGS algorithms are equivalent. However, as remarked earlier,

their numerical properties are di�erent. For example, consider the computation of q2 by the CGS

method, given q1 with kq1k2 = 1. We have

q2 � a2 � r12q1;

where r12 = qT1 a2. Then it can be shown (Bj�orck (1992)) that

k (q2)� q2k < (1:06)(2m+ 3)� ka2k2 :

Since qT1 q2 = 0, it follows that

jqT1 (q2)j < (1:06)(2m+ 3)� ka2k2 :

This shows that in CGS two computed vectors, q1 and q2, can be far from being or-

thogonal. On the other hand, it can be shown Bj�orck (1992) that in MGS the loss of orthogonality

depends upon the condition number of the matrix A. Speci�cally, it has been shown that

I � QTQ

2� c1�Cond2(A)

1� c2�Cond2(A);

assuming that c2�Cond2(A) < 1, where c1 and c2 are small constants.

Since in MGS the loss of orthogonality depends upon the condition number, one could use

column pivoting to maintain orthogonality as much as possible. Thus, as far as �nding the QR

factorization of A is concerned, neither algorithm can be recommended over the Householder or the

Givens method. With CGS the orthogonality of Q can be completely lost; with MGS,

the orthogonality of Q may not be acceptable when A is ill-conditioned.

Note that in the above 2� 2 example, the computed Q (in four-digit arithmetic) is such that

QTQ =

1 �0:0001

�0:0001 1

!:

On the other hand, for the same problem using the Householder method, QTQ = I (in four-digit

arithmetic).

To compare the computations with the di�erent Gram-Schmidt processes, we also computed QR

factorizations of the 5� 5 Hilbert matrix using the Gram-Schmidt, the modi�ed Gram-Schmidt,

and the Householder methods (which is known to be very stable) and tabulated the results of

kI � QTQk in extended precision. The results are displayed in the following table.

419

Page 34: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

TABLE 7.1

Comparison of QR Factorization with Di�erent Methods

Method kI � QTQk

Gram-Schmidt 1:178648780488241� 10�7

Modi�ed

Gram-Schmidt 4:504305729523455� 10�12

Householder 4:841449989971538� 10�16

Remark: The table clearly shows the superiority of the Householder method over

both the Gram-Schmidt and modi�ed Gram-Schmidt methods; of the latter two meth-

ods, the MGS is clearly preferred over the CGS.

Use of the MGS method in the least squares solution

We have just seen that the MGS is superior to the CGS for QR factorization, but it is still

not fully satisfactory. However, as far as the least squares problem is concerned, it is a di�erent

story. There seems to be a growing tendency to use MGS in solutions of least squares problems

even over the Householder method, especially for solving large and sparse problems. Bj�orck and

Paige (1992) have recently shown that the MGS is numerically equivalent to Householder

QR factorization applied to A augmented with a square matrix of zero elements on

top. However, while using MGS in the solution of a least squares problem, special care has to be

taken. Since Q may not be computationally orthogonal, if c = QTb is computed using Q obtained

from MGS, and this c is used to solve Rx = c, then the computed least squares solution may not be

accurate. The MGS should be applied to the augmented matrix (A; b) to compute the factorization:

(A; b) = (Q1; qn+1)

R z

0 �

!:

From this it follows that

Ax� b = (A; b)

x

�1

!

= (Q1; qn+1)

R z

0 �

! x

�1

!

= Q1(Rx� z)� �qn+1:

Chris Paige is a Australian-Canadian numerical linear algebraist, who rejuvenated the use of the Lanczos algo-

rithm in matrix computations by detailed study of the break-down of the algorithm. He is a professor of computer

science at McGill University, Montreal, Canada.

420

Page 35: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

If qn+1 is orthogonal to Q1, then kAx� bk2will be a minimum when Rx = z. Thus, the least

squares solution can be obtained by solving

Rx = z;

and the residual r will be given by r = �qn+1 . Details can be found in Bj�orck (1990). The

above discussion leads to the following least squares algorithm.

Algorithm 7.8.5 Least Squares Solution by MGS

1. Apply MGS to Am�n to obtain Q = (q1; : : : ; qn) and R.

2. For k = 1; : : : ; n do

�k = qTk b

b � b� �kqk

3. Solve Rx = (�1; : : : ; �n)T .

Example 7.8.7

Consider solving the least squares problem using the MGS with

A =

0BB@

1 1

:0001 0

0 :0001

1CCA ; b =

0BB@

2

:0001

:0001

1CCA :

The exact solution is x =

1

1

!.

Q =

0BB@

1 0

:0001 �:70710 :7071

1CCA ; R =

1 1

0 :0001

!:

If we now form c = QTb and solve Rx = c, we obtain x =

2

0

!. On the other hand, if we obtain

x using the algorithm above, we get (�1; �2) = (2; 0:0001), and the solution of Rx = (�1; �2)T is

x � 1

1

!.

Round-o� property and op-count. It can be shown (see Bj�orck and Paige (1992)) that

the MGS for the QR factorization method is numerically equivalent to the Householder method

applied to

0 0

A b

!; that is,

HnHn�1 � � �H2H1

0 0

A b

!=

R c1

0 c2

!:

421

Page 36: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

From this equivalence, it follows that the MGS method is backward stable for the least

squares problem. The method is slightly more expensive than the Householder method. It

requires about mn2 op, compared to the mn

2 � n3

3 op needed by the Householder

method.

7.8.3 The QR Factorization Method for the Rank-De�cient Case

In this section we consider the rank-de�cient overdetermined problem. As stated in Theorem 7.3.1,

there are in�nitely many solutions in this case. There are instances where, the rank-de�ciency is

actually desirable, because it provides a rich family of solutions which might be used for optimizing

some other aspects of the original problem.

In case the m � n matrix A, m � n, has rank r < n, the R matrix in a QR factorization of A

is singular. However, we have seen that the use of the QR factorization with column pivoting can

theoretically reveal the rank of A. Recall that Householder's method with column pivoting yields

QTAP =

R11 R12

0 0

!;

where P is a permutation matrix, R11 is an r � r nonsingular upper triangular matrix and R12

is r � (n � r). This factorization can obviously be used to solve the rank-de�cient least squares

problem as follows.

Let

PTx = y

AP = ~A

and

QTb =

c

d

!:

Then

kAx� bk22 = QTAPP

Tx�Q

Tb

22

(2-norm remains invariant under orthogonal matrix multiplication)

= QT ~

Ay �QTb

22

=

R11 R12

0 0

! y1

y2

!� c

d

! 2

2

= (R11y1 +R12y2 � c)2

22+ d

22

422

Page 37: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Thus, kAx� bk22will be minimized if y is chosen so that

R11y1 = c�R12y2:

Moreover, the norm of the residual in this case will be given by:

krk2 = kb� Axk2 = kck2 :

This observation suggests the following QR factorization algorithm for rank-de�cient least

squares solutions.

Algorithm 7.8.6: Least Squares Solutions for the Rank-De�cient Problem Using QR

Step 1: Decompose Am�nP = Qm�nRn�m using column pivoting.

Step 2: Form QTb =

c

d

!.

Step 3: Choose an arbitrary vector y2.

Step 4: Solve the r � r nonsingular upper triangular system:

R11y1 = c�R12y2:

Step 5: Recover x from

x = Py:

Minimum Norm Solution

Since y2 is arbitrary, the above method will yield in�nitely many least squares solutions, as

Theorem 7.3.1 states. The solution obtained by setting y2 = 0 is called the basic solution. In

case R12 = 0, the basic solution is the minimum norm least squares solution, i.e., among the

in�nite number of least squares solutions, it has the minimum norm. In case R12 6= 0, the basic

solution can not be minimum norm solution (Exercise 20). In such a case the complete QR

factorization with column pivoting can be used. Recall from Chapter 5 that the complete QR

factorization of an m� n matrix A is given by

QTAW =

T 0

0 0

!:

If pivoting is used, then

AP = Q

T 0

0 0

!W

T;

423

Page 38: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

where P is a permutation matrix.

The minimum norm solution will then be given by

x = PW

T�1c

0

!; PW

T�1c

0

!

where c is a vector consists of the �rst r elements of QTb. (Exercise #21(a))

Remarks:

1. A note on the use of column pivoting: We have shown that the column pivoting is useful

for the rank-de�cient least squares problem. However, even in the full rank case, the

use of column pivoting is suggested (see Golub and Van Loan MC 1984).

2. For the rank-de�cient least squares problem, the most reliable approach is the

use of singular value decomposition (see Section 7.8.4 and Chapter 10).

Round-o� property. It can be shown (Lawson and Hanson, SLP p. 95) that for the minimum

length least squares problem, the computed vector x is close to the exact solution of a perturbed

problem. That is, there exist a matrix E and vectors x and �b such that x is the minimum length

least squares solution of (A+E)x � b+ �b, where

kEkF � (6m+ 6n� 6k � 3s+ 84)s� kAkF + O(�2)

and k�bk � (6m� 3k+ 40)k� kbk+O(�2), where k is the rank of A and s = min(m;n). Moreover,

kx � xk � (6n� 6k+ 43)s� kxk+O(�2):

Note: In the above result we have assumed that R22 in R =

R11 R12

0 R22

!is zero. But in

practical computations it will not be identically zero. In that case, if R22 is the computed version

of R22, then we have

kEkF� R22

F+ (6m+ 6n� 6k � 3s+ 84)s� kAk

F+ O(�2):

Example 7.8.8 A Consistent Rank-De�cient Problem

A =

0BB@1 0

2 0

0 0

1CCA ; b =

0BB@3

6

0

1CCA ; rank(A) = 1:

424

Page 39: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Step 1: AP = QR; P =

1 0

0 1

!.

Q =

0BB@�:4472 :8940 0

�:8944 �:4472 0

0 0 1

1CCA

R =

0BB@�2:2361 0

0 0

0 0

1CCA :

Step 2: QTb =

0BB@�6:7082

0

0

1CCA ; c = (�6:7082).

Step 3: Choose y2 = 0.

Step 4: Solve R11y1 = c�R12y2:

y1 =c

R11

=�6:7082�2:2361 = 3:

The minimum norm least squares solution is

x = y =

3

0

!:

Example 7.8.9 An Inconsistent Rank-De�cient-Problem

A =

0BB@1 0

2 0

0 0

1CCA ; b =

0BB@1

2

0

1CCA :

Step 1: PA = QR; P =

1 0

0 1

!, Q =

0BB@�0:4472 �0:8944 0

�0:8944 �0:4472 0

0 0 1

1CCA ; R =

0BB@�2:2361 0

0 0

0 0

1CCA :

Step 2: QTb =

c

d

!; c = �2:2361.

Step 3: Choose y2 = 0.

Step 4: The minimum norm least squares solution is x = y =

1

0

!.

(Note that R11y1 = c1 � R12y2 gives y1 = 1)

425

Page 40: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

7.8.4 Least Squares Solution Using the SVD

Acting on the remark in the previous section, for the sake of curious readers and those who know

how to compute the Singular Value Decomposition (SVD) of a matrix (for instance, using some

software package such as MATLAB, LAPACK or LINPACK), we just state the following results

which show how the SVD can be used to solve a least squares problem. A full treatment will be

given in Chapter 10.

Let

A = U�V T

be the SVD of A, where A is m� n with m � n and � = diag(�1; : : : ; �n). Let

b0 = U

Tb =

0BB@b0

1...

b0

m

1CCA :

Least Squares Solutions Using the SVD

A family of the least-squares solutions is given by

x = V y;

where

y =

0BB@y1

...

yn

1CCA ; yi =

8><>:

b0

i

�i

; �i 6= 0

arbitrary, �i = 0:

In the rank-de�cient case, an expression for the minimum norm solution is

x =rXi=1

uTi b

0

�i

vi;

where r = rank(A), and ui and vi are the columns of U and V , respectively. (Note

that rank(A) = the number of nonzero singular values of A.)

426

Page 41: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Example 7.8.10

A =

0BB@

1 1

0:0001 0

0 0:0001

1CCA ; b =

0BB@

2

0:0001

0:0001

1CCA

A = U�V Tgives

U =

0BB@1 0 �0:00010 �0:7071 0:7071

0 0:7071 0:7071

1CCA

� =

0BB@1:4142 0

0 0:0001

0 0

1CCA

V =

0:7071 �0:70710:7071 0:7071

!

b0 = U

Tb =

0BB@2

0

0

1CCA ; y =

y1

y2

!=

1:4142

0

!; x = V y =

1

1

!:

7.9 Underdetermined Systems

Let A be m� n and m < n. Then the system

Ax = b

has more equations than unknowns. Such a system is called an underdetermined system. An

underdetermined system can be illustrated graphically as follows:

=

b

x

A

m < n

Underdetermined systems arise in a variety of practical applications. Unfortunately, underde-

termined systems are not widely discussed in the literature. An excellent source is the survey paper

by Cline and Plemmons (1976). An underdetermined system has either no solution or an in�nite

number of solutions. This can be seen from the following theorem:

427

Page 42: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Theorem 7.9.1 Let Ax = b be an underdetermined system. Then every solution

x of the system can be represented as

x = xR + xN ;

where xR is any solution; that is,

AxR = b;

and xN is in the null space of A, that is,

AxN = 0:

Note. A full-rank underdetermined system has an in�nite number of solutions. In

this case, the complete solution set is given by

An Expression for the Solution Set of the Full-Rank Underdetermined

System

x = AT (AAT )�1b+ (I � A

T (AAT )�1A)y, where y is arbitrary.

In the following, we describe two approaches for computing the minimum norm solution

assuming that A has full rank, i.e., rank(A) = m.

428

Page 43: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

7.9.1 The MinimumNorm Solution of the Full-rank Underdetermined Problem Using

Normal Equations

Theorem 7.9.2 Let A be m � n (m < n) and have full rank. Then the unique

minimum norm solution x to the underdetermined system

Ax = b (7.9.1)

is given by

x = AT (AAT )�1b: (7.9.2)

Proof. Since A has full rank, AAT is nonsingular and clearly x is the unique solution of the system

(7.9.1) given by (7.9.2). To see that x is indeed the minimum norm solution, let's assume that y is

another solution and de�ne

z = y � x:

Then

kyk22 = kx+ zk22

= kxk22 + kzk22 + 2(xTz)

= kxk22+ kzk2

2+ 2(bT(AAT )�1A(y � x))

= kxk22+ kzk2

2

(since A(y � x) = Ay �Ax = b� b = 0). This shows that

kyk2� kxk2

2:

Thus, x is the minimum norm solution.

The above discussion suggests immediately the following algorithm.

Algorithm 7.9.1 Minimum Norm Solution for the Full-rank Undetermined Problem

Using Normal Equations

Step 1: Solve

AATy = b:

429

Page 44: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Step 2: Form the minimum norm solution x:

x = ATy:

De�nition 7.9.1 The equations

AATy = b

are called the normal equations for the underdetermined system (7.9.1).

Example 7.9.1

A =

1 2 3

2 3 4

!; b =

6

9

!:

Step 1:

AAT =

14 20

20 29

!

y =

�11

!:

Step 2:

x = ATy =

0BB@1

1

1

1CCA :

Remarks: The same di�culties with the normal equations, as pointed out in the

overdetermined case, may arise in the underdetermined case as well. For example,

consider the explicit formation of AAT , with t-digits, when

A =

1 � 0

1 0 �

!:

If � is such that 10�t < � < 10�t

2 , then

AAT =

1 + �

2 1

1 1 + �2

!

is singular.

430

Page 45: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

7.9.2 The QR Approach for the Full-Rank Underdetermined Problem

A QR factorization of A can, of course, be used to solve an underdetermined system and, in

particular, to compute the minimum norm solution.

Since A in this case has more rows than columns, we decompose AT into QR instead of A.

Thus, we have

QTAT =

R

0

!:

(Note that AT is n�m; n � m.) So, the system Ax = b becomes

(RT; 0T)QT

x = b:

Denote y = QTx. Then we have

(RT; 0T)y = b:

Partitioning y conformably, we get

(RT; 0T)

yR

yN

!= b

or

RTyR = b:

The unique minimum norm least squares solution is obtained by setting

yN = 0:

So, the minimum norm solution is given by

x = Qy = (Q1; Q2)

yR

0

!= Q1yR:

The above discussion suggests the following algorithm.

Algorithm 7.9.2 MinimumNorm Solution for the Full-rank Underdetermined Problem

Using QR

Step 1: Find the QR factorization of AT :

QTAT =

R

0

!:

Step 2: Partition Q = (Q1; Q2).

Step 3: Solve

RTyR = b:

Step 4: Form x = Q1yR.

431

Page 46: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

A note on implementation. Note that if we use the Householder method to compute the

QR factorization of A, the product Q1yR can be computed from the factored form of Q as the

product of Householder matrices.

Flop-count. Using Householder orthogonalization, m2n� m3

3 ops will be required to imple-

ment the above algorithm.

Round-o� property. It has been shown (Lawson and Hanson SLP (pp. 93)) that the com-

puted vector x is close to the exact minimum length least squares solution of a perturbed problem.

That is, there exist a matrix E and a vector x such that x is the minimum length solution of

(A+ E)x � b

where

kEkF � (6n� 3m+ 41)m� kAkF +O(�2):

Example 7.9.2

A =

1 2 3

2 3 4

!; b =

6

9

!:

Step 2:

Q1 =

0BB@�:2673 :8729

�:5345 :2182

�:8018 �:4364

1CCA

R =

0BB@�3:7417 0

�5:3452 :6547

0 0

1CCA :

Step 3:

yR =

�1:60360:6547

!:

Step 4: The minimum norm solution:

x = Q1yR =

0BB@1

1

1

1CCA :

432

Page 47: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

7.10 Iterative Re�nement

It is natural to wonder if a computed least squares solution x can be improved cheaply in an

iterative manner, as was done in the case of a linear system. A natural analog of the iterative

re�nement procedure for the linear system problem described in a section of Chapter 6 will be the

following. The scheme was proposed by Golub (1965).

Algorithm 7.10.1 Linear System Analog Iterative Re�nement For Least Squares So-

lution

Let x(1) be an approximate solution of the least squares problem. Then

For k = 1; 2; : : :, do until convergence occurs:

(1) r(k) = b�Ax

(k) (compute the residual).

(2) Compute c(k) such that Ac

(k) � r(k) 2is minimum.

(3) Correct the solution:

x(k+1) = x

(k) + c(k):

An analysis of the above re�nement procedure by Golub and Wilkinson (1966)

reveals that the method is satisfactory only when the residual vector r = b � Ax is

su�ciently small. A successful procedure used widely in practice now follows. The method is

based upon an interesting observation made by Golub that the least squares solution x and the

corresponding residual vector r satisfy the linear system I A

AT 0

! r

x

!=

b

0

!:

Note that the above system is equivalent to

Ax+ r = b

and

ATr = 0;

which means that x is the solution of the normal equation

ATAx = A

Tb:

Thus one can apply the iterative re�nement procedure described in Chapter 6 to the above aug-

mented linear system, yielding the following scheme, which is due to Bj�orck (1967a; 1968).

Ake Bj�orck is a Swedish numerical linear algebraist, well known for his outstanding contributions to solutions of

least squares problems. He is a professor of mathematics at Link�oping University in Sweden.

433

Page 48: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Algorithm 7.10.2 Iterative Re�nement for Least Squares Solutions

Set r(0) = 0; x(0) = 0.

For k = 1; 2; : : : do

(1) Compute

r

(k)1

r

(k)2

!=

b

0

!�

I A

AT 0

! r(k)

x(k)

!. (Using accumulation of inner products

in double precision.)

(2) Solve the system

I A

AT 0

! c

(k)1

c

(k)2

!=

r

(k)1

r

(k)2

!.

(3) Update the solution and the residual:

r(k+1)

x(k+1)

!=

r(k)

x(k)

!+

c

(k)1

c

(k)2

!.

Remark: Note that for satisfactory performance of the algorithm, step 1 must be performed

using double precision; which is in contrast with the iterative re�nement procedure for the linear

system problem given in Section 6.6, where accumulation of inner products is not necessary.

Implementation of Step 2

Since the matrix

I A

AT 0

!is of order m + n, the above scheme would be quite expensive

when m is large. Fortunately, one can implement the scheme rather cheaply. Observe that if

QTA =

R1

0

!is the QR decomposition of A, then the system

I A

AT 0

! c1

c2

!=

r1

r2

!

can be transformed into

QTc1 +

R1

0

!c2 = Q

Tr1;

(RT1 ; 0)Q

Tc1 = r2:

This shows that the above augmented system can be solved by solving two triangular systems and

two matrix-vector multiplications as follows:

(1) Form QTr1 =

r0

1

r0

2

!.

(2) Solve for c02: RT1 c

0

2 = r2:

(3) Solve for c2: R1c2 = r0

1 � c0

2:

(4) Form c1 = Q

c0

2

r0

2

!.

434

Page 49: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Flop-count. With the above formulation each iteration will require only 4mn � n2 op,

assuming that the Householder method has been used and that Q has not been formed explicitly.

Note that for the matrix-vector multiplications in steps 1 and 3, Q does not need to be formed

explicitly; these products can be obtained if Q is only known in implicit form.

Round-o� error. It can be shown (Bj�orck (1992)) that the solution x(s) obtained at the

iteration step s, satis�es x(s) � x

2

kx(s�1) � xk2< c� Cond(A); s = 2; 3; : : : ; and

c is an error constant.

An Interpretation of the Result and Remarks

The above result tells us that the iterative re�nement procedure is quite satisfactory. It is even

more satisfactory for least squares problems with large residuals. Note that for these problems

(Cond(A))2 serves as the condition number. On the other hand, the above result shows error at

an iterative re�nement step depends upon the condition number of A. The procedure \may give

solutions to full single precision accuracy even when the initial solution may have no

correct signi�cant �gures" (Bj�orck (1992)). For a well-conditioned matrix, the convergence may

occur even in one iteration. Bj�orck and Golub (1967) have shown that with a 8� 8 ill-conditioned

Hilbert matrix, three digits accuracy per step both for the solution and the residual can be obtained.

Example 7.10.1

A =

0BB@1 2

2 3

3 4

1CCA ; b =

0BB@3

5

9

1CCA

r(0) = 0; x

(0) = 0; k = 0

r

(0)1

r

(0)2

!=

b

0

!=

0BBBBBBBB@

3

5

9

0

0

1CCCCCCCCA:

435

Page 50: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

(2) Solve the system: I A

AT 0

! c

(0)1

c

(0)2

!=

r

(0)1

r

(0)2

!

c

(0)1

c

(0)2

!=

0BBBBBBBB@

0:3333

�0:66670:3333

3:3333

�0:3333

1CCCCCCCCA:

(3) Update the solution and the residual:

r(1)

x(1)

!=

r(0)

x(0)

!+

c

(0)1

c

(0)2

!=

0BBBBBBBB@

0:3333

�0:66670:3333

3:3333

�0:3333

1CCCCCCCCA:

The computations of c(0)1 and c

(0)2 are shown below.

r

(0)1 = b; r

(0)2 =

0

0

!.

r0

1

r0

2

!= Q

Tb =

0BB@�10:6904�0:21820:8165

1CCA. Thus,

r0

1 =

�10:69040:2182

!

r0

2 = (0:8165):

c0

2 =

0

0

!.

c

(0)2 =

3:3333

�0:3333

!.

c

(0)1 =

0BB@

0:3333

�0:66673:3333

1CCA.

Note that

x(1) =

3:3333

�0:3333

!

is the same least squares solution as obtained by the QR and normal equation methods.

436

Page 51: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

7.11 Computing the Variance-Covariance Matrix (ATA)�1

In statistical and image processing applications very often one needs to compute the variance-

covariance matrix

X = (ATA)�1:

In order to see how this matrix arises in statistical analysis, consider the classical Linear Regression

Model:

b = Ax+ �;

with the properties

1. E(�) = 0; and

2. cov(�) = E(��T ) = �2I .

Here b is the response vector, A is the design matrix, and � is the error term. The parameters

x and �2 are unknown.

Regression analysis is concerned with prediction of one or more (response) dependent variables

from the values of a group of predictor (independent) variables. Assuming that A has full rank,

then the least squares estimate of x in the above model is, clearly, given by

x = (ATA)�1AT

b:

Also,

� = b� b = (I � A(ATA)�1AT )b

(note that AT� = 0 and b� = 0). A common estimate of �2 is: ��2 =

kb�Axk22m� n

, where A is m� n.

For details, see Johnson and Wichern (1988), and Bj�orck (1992).

Since vital information might be lost in computing ATA explicitly, one wonders if it is possible

to compute X from the QR factorization of A. We show below how this can be done.

Consider the QR factorization of A:

QTA =

~R

0

!:

Then

ATA = ( ~R)T ~R

and, thus,

X = (ATA)�1 = ( ~R)�1( ~R)T :

437

Page 52: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

One can then easily compute ( ~R)�1, since ~R is an upper triangular matrix. Note that since X is

symmetric, only one-half of its entries need to be computed, and X can overwrite R. However,

computing (ATA)�1 this way will require explicit multiplication of ( ~R)�1( ~R)�T .

This explicit multiplication can easily be avoided if the computations are reorganized. Thus, if

x1 through xn are the successive columns of X , then from

X = ( ~R)�1( ~R)�T ;

we have

~R(x1; : : : ; xn) = ( ~R)�T :

Since the last column of ~R�T is just

1

rnn

en, the last column, xn, is easily computed by solving the

upper triangular system

~Rxn =

1

rnn

en: (7.11.1)

By symmetry we also get the last row of X .

Suppose now that we have already determined xij = xji; j = n; : : : ; k + 1; i � j. We now

determine xik; i � k.

For xkk we have

xkkrkk +

nXj=k+1

rkjxjk =1

rkk

;

from which we obtain

xkk =1

rkk

0@ 1

rkk

�nX

j=k+1

rkjxkj

1A: (7.11.2)

(Note that xkj = xjk; j = k + 1; : : : ; n have already been computed.) For i = k � 1; : : : ; 1, we have

xik = � 1

rii

0@ kXj=i+1

rijxjk +

nXj=k+1

rijxkj

1A: (7.11.3)

Thus, (7.11.1){(7.11.3) determine all the entries of X .

Algorithm 7.11.1 Computing the Variance-Covariance Matrix X = (ATA)�1

1. Compute the last column xn by solving the system (7.11.1).

2. Compute xkk from (7.11.2), for k = n� 1; n� 2; :::; 2; 1:

3. Compute xik from (7.11.3), i = k � 1; :::; 1; k = 2; 3; :::; n.

438

Page 53: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Flop-count. The computation of X = (ATA)�1 using the above formulas requires about

n3

3 ops.

Example 7.11.1

A =

0BB@1 5 7

2 3 4

1 1 1

1CCA :

A = QR gives

Q =

0BB@�0:4082 0:9045 0:1231

�0:8165 �0:3015 �0:4924�0:4082 �0:3015 0:8616

1CCA

R =

0BB@�2:4495 �4:8990 �6:5320

0 3:3166 4:8242

0 0 �0:2462

1CCA :

The last column x3 =

0BB@

4

�2416:5

1CCA (using (7.11.1))

x22 = 35 (using (7.11.2))

x12 = �6x11 = 1:5

35 (using (7.11.3)) .

Then X = (ATA)�1 =

0BB@1:5 �6 4

�6 35 �244 �24 16:5

1CCA.

7.12 Review and Summary, and Table of Comparisons

1. Existence and Uniqueness. The least squares solution to the problem Ax = b always exists.

In the overdetermined case, it is unique i� A has full rank (Theorem 7.3.1).

2. Overdetermined Problems. We discussed two methods: the normal equations method and

the QR factorization method.

The normal equations method is simple to implement, but there are numerical di�culties with

this method in certain cases.

The QR factorization methods are more expensive than the normal equations method, but are

more reliable numerically. If one insists on using normal equations, the use of extended precision is

439

Page 54: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

recommended. One can use Householder or Givens transformations or the modi�ed Gram-Schmidt

method to achieve QR factorization of A needed for solution of the least squares problem.

The Householder QR factorization is the most e�cient and numerically viable; the modi�ed

Gram-Schmidt is only slightly more expensive than the Householder method and is not as reliable

as the Householder or the Givens method numerically for QR factorization. However, with some

reorganization it can be made competitive with the Householder method to compute the least

squares solution. Indeed, popularity of using the MGS method in solving the least-squares problem

is growing. Some numerical experiments even suggest the superiority of this method over other QR

methods. See Bj�orck (1992). Rice (1966) �rst noted the superiority of this algorithm.

For the rank-de�cient overdetermined problem, there are in�nitely many solutions. Here we

have discussed only the QR factorization method with column pivoting. It is reasonably accurate,

but the most numerically viable approach to deal with rank de�ciency is the SVD approach to be

discussed in Chapter 10.

3. Underdetermined Problems. For the underdetermined problem there are in�nitely many

solutions in the full-rank case. We have discussed the normal equations method and the QR

factorization method for the minimum-norm solution. The normal equations here are:

AATy = b;

whereas those of the overdetermined problem are:

ATAx = A

Tb:

The numerical di�culties with the normal equations are the same as those of the overdetermined

problem.

The round-o� error analyses for the underdetermined and the rank-de�cient overdetermined

problems are somehow complicated, because solutions in these cases are not unique unless imposing

the requirement of having the minimum-norm solution. The backward round-o� analyses

of the QR factorization methods using Householder transformations in these cases

show that the computed minimum-norm solution in each case is nearby the minimum-

norm solution of a perturbed problem. This is in contrast with the results obtained by the

Householder-QR factorization method for the full rank overdetermined problem, where it is shown

that the computed solution is the exact solution of a perturbed problem.

4. Perturbation Analysis: The results of perturbation analyses are di�erent for di�erent cases

of the perturbations in the data.

440

Page 55: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

If only b is perturbed, then Cond(A) = kAk kAyk serves as the condition number for the unique

least squares solution (Theorem 7.7.1).

If A is perturbed, then the sensitivity of the unique least squares solution, in general, depends

upon the square of the condition number (Theorem 7.7.2). In certain cases, such as when the

residual is zero, the sensitivity depends only on the condition number of A.

5. Iterative Re�nement: As in the case of the linear system problem, it is possible to improve

the accuracy of a computed least squares solution in an iterative fashion. An algorithm which is a

natural analog to the one for the linear system (section 6.9) is satisfactory only when the residual

vector r = b � Ax is su�ciently small. A widely used algorithm due to Bj�orck is presented in

section 7.10. This algorithm requires solution of an augmented system of order m+ n (where A

is m� n). It is shown how to solve the system in a rather inexpensive way using QR factorization

of A.

The solution obtained by this iterative re�nement algorithm is quite satisfactory.

6. Computing the Covariance Matrix: An e�cient computation of the matrix (ATA)�1 is

important in statistical and image processing applications. In section 7.11, we show how to compute

this matrix using QR factorization of A and without �nding the inverse explicitly.

TABLE 7.2

COMPARISONS FOR DIFFERENT LEAST SQUARES METHODS

441

Page 56: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Problem Method Flop-Count Numerical Properties

Overdetermined Normalmn

2

2+n3

6(1) Di�culties with formation of ATA

Full-Rank Equations (2) Produces more errors in the solution

than there are warranted by data, in

certain cases

Overdetermined Householder-QR mn2�

n3

3Stable: The computed solution is the

Full-Rank exact solution of a nearby problem

Overdetermined MGS-QR mn2 Almost as stable as the

Full-Rank Householder-QR

Overdetermined Householder-QR 2mnr � r2(m + n) +2r3

3, Mildly stable: The computed minimum-

Rank-De�cient with column pivoting where r = rank(A) norm solution is close to the

minimum-norm solution of a

perturbed problem

Underdetermined Normal m2n+

m3

6Same di�culties as in the case of the

Full-rank Equations overdetermined problem

Underdetermined Householder-QR m2n�

m3

3Same as the rank-de�cient

Full-rank overdetermined problem

442

Page 57: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

7.13 Suggestions for Further Reading

The techniques of least squares solutions are covered in any numerical linear algebra text, and in

some numerical analysis texts. The emphasis in most books is on the overdetermined problems. For

a thorough treatment of the subject we refer the readers to the book by Golub and Van Loan (MC).

The books by Stewart (IMC), by Watkins (FMC), and by Gil, Murray and Philip Numerical

Linear Algebra and Optimization also contain detailed discussions on perturbation analyses.

The books MC and FMC contain a very thorough treatment of the perturbation analysis.

A complete book devoted to the subject is the (almost classical) book by C. L. Lawson and

R. J. Hanson (SLP). There is a nice recent monograph by Bj�orck (1992) that contains a thorough

discussion on least squares problems. These two books are a \must" for the readers interested in

further study on the subject. The SLP by Lawson and Hanson, in particular, gives the proofs of

the round-o� error analyses of the various algorithms described in the present book.

Any book on regression analysis in statistics will contain applications of least squares problem

in statistics. We have, in particular, used the book Applied Linear Regression Models, by

John Neter, William Wasserman and Michael Kunter, Richard D. Irwin, Inc. Illinois (1983). A

classical survey paper of Golub (1969) contains an excellent exposition of the numerical linear

algebra techniques for the least squares and the singular value decomposition problems arising in

statistics and elsewhere. A paper by Stewart (1987) is also interesting to read.

The readers are highly recommended to read these papers along with other papers in the area

by Golub, Bj�orck, Stewart, etc. representing the most fundamental contributions in this area. See,

for details, the references given in the book on these papers and the list of references appearing in

the recent monograph of Bj�orck (1992). For more on underdetermined problems, see the paper by

Cline and Plemmons (1976).

443

Page 58: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Exercises on Chapter 7

PROBLEMS ON SECTION 7.3

1. Let A be m� n; m � n. Prove that the matrix ATA is positive de�nite i� A has rank n.

2. Show that the residual vector r = b� Ax is orthogonal to all vectors in R(A).

3. Prove that x is a least squares solution i�

Ax = bR and b� Ax = bN ;

where bR and bN are, respectively, the range-space and column-space components of the

vector b.

4. Prove Theorem 7.3.1, both in the full-rank and rank-de�cient cases, based on QR factorization

of A.

PROBLEMS ON SECTIONS 7.5, 7.6, AND 7.7

5. Let A have linearly independent columns. Then prove that (Cond2(A))2 = Cond2(A

TA).

6. Using least squares, �t a straight line and a quadratic to

x 0 1 3 5 7 9 12

y 10 12 18 15 20 25 36

Compare your results.

Compute the condition number of the associated Vandermonde matrix in each case.

7. Find the generalized inverse and the condition number of each of the following matrices.

A =

0:0001 1

1 1

!; A =

0BB@

1 1

0:0001 0

0 0:0001

1CCA

A =

7 6:990

4 4

!; A =

0BB@1 2 3

3 4 5

0 7 8

1CCA :

444

Page 59: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

8. Let A and ~A have full rank. Let x and ~x be, respectively, the unique least squares solutions

to the problems

Ax = b

and

~A~x = b;

where ~A = A+E. Then prove that

k~x� xkk~xk � Cond(A)

kEkkAk

�1 +

kbkk~xk

+(Cond(A))2kEkkAk

�1 +

kEkkAk

�:

(Hint: Apply the perturbation analysis of the linear systems with normal equations.)

9. Verify the inequality of problem 8 with the following data:

A =

0BB@1 2

3 4

5 6

1CCA ; b =

0BB@

3

7

11

1CCA

E = 10�4A :

10. Verify the inequality of Theorem 7.7.4 in each of the following cases.

(a) A =

0BB@1 2

3 4

5 6

1CCA ; E = 10�4A

(b) A =

0BB@

1 1

10�4 0

0 10�4

1CCA ; E = 10�4A

(c) A =

0BB@1 1

0 1

0 0

1CCA ; E = 10�3A:

11. Work out a proof of Theorem 7.7.2.

445

Page 60: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

PROBLEMS ON SECTIONS 7.7 AND 7.8

12. Develop an algorithm to solve the normal equations whose system matrix is positive semide�-

nite and singular, based on complete pivoting of the system matrix. Apply your algorithm

to the normal equations with

A =

1 1

1 1

!

and

b =

2

2

!:

13. Let A =

0BB@1 1

2 3

0 1

1CCA ; b =

0BB@0

5

1

1CCA.

(a) Find the unique least squares solution x using

(i) x = Ayb,

(ii) the normal equations method,

(iii) the Householder and the Givens QR factorization methods,

(iv) the CGS and MGS methods.

(b) Find Cond(A).

(c) Show that for this problem, the sensitivity of the least squares problem, when only A is

perturbed, depends upon Cond(A).

(d) Let �A = A = 10�4A and let ~x = ~Ayb where ~

A = A+ E. Findk~x� xkkxk and verify the

inequality of Theorem 7.7.2 for this problem.

(e) Find r and r and verify the inequality of Theorem 7.7.3.

14. Construct your own example where the sensitivity of the least squares problem will depend

upon the square of the condition number of the matrix. (Show all your work.)

15. Consider the following well-known ill-conditioned matrix

A =

0BBBBB@

1 1 1

� 0 0

0 � 0

0 0 �

1CCCCCA ; j�j � 1

(Bj�orck (1990)).

446

Page 61: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

(a) Choose an � small, so that rank(A) = 3. Then compute Cond2(A) to check that A is

ill-conditioned.

(b) Find the least squares solution to Ax =

0BBBBB@

3

1CCCCCA using

(i) the normal equations method,

(ii) the QR factorization method with the Householder, CGS and MGS methods.

(c) Change b to b1 =

0BB@3

0

0

1CCA. Keep A unchanged. Find an upper bound for the relative error

in the least squares solution.

(d) Change A to A1 = A + �A where �A = 10�3A. Keep b unchanged. Find an upper

bound for the relative error in the least squares solution.

(e) Find the maximum departure from orthogonality of the computed columns of the Q

matrix using the CGS and MGS methods.

(f) Compute the least squares solution of the problem in (b) using the SVD.

16. (Square-root free Cholesky) Given a symmetric positive de�nite matrix A, develop an

algorithm for �nding the Cholesky decomposition of A without any square-roots:

A = LDLT;

where L is a unit lower triangular matrix and D is a diagonal matrix with positive diagonal

entries.

Apply your algorithm to solve the full-rank least squares problem based on solving normal

equations.

17. (a) Derive a column-oriented version of the modi�ed Gram-Schmidt process.

(b) Show that the op-count for both the Gram-Schmidt and the modi�ed Gram-Schmidt

are mn2, where A is m� n (m � n).

(c) Show that the op-count for the Householder method is n2�m� n

3

�.

18. (a) Construct an example of the least squares problem where Gram-Schmidt will yield a

poor result but modi�ed Gram-Schmidt will do fairly well.

447

Page 62: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

(b) Apply the CGS and MGSmethods to the matrixA =

0BBBBB@

8 21

13 34

21 35

34 39

1CCCCCA, using t = 4. Show that

in both cases the loss of orthogonality between q1 and q2 is unacceptable: qT1 q2 = 0:09065.

19. Show that the op-count for QR factorization with column pivoting using the Householder

method is 2mr� r2(m+ n) + 2r3=3, where r = rank(A).

20. Show that for the QR method with column pivoting in the rank-de�cient case, the basic

solution cannot be the minimum-norm solution unless R12 is zero.

21. (a) Show that the minimum-norm solution to Ax = b, with rank(A) = r, obtained by

complete QR factorization with column pivoting is given by

x = PW

T�1c

0

!;

where c is a vector consisting of the �rst r elements of QTb.

(b) Find the minimum norm solution to the least squares problem with

A =

0BB@1 1 1

1 1 1

1 1 1

1CCA ; b =

0BB@3

3

3

1CCA :

PROBLEMS ON SECTION 7.9

22. Develop an algorithm based on the QR factorization with column pivoting to compute the

minimum norm solution to the underdetermined system

Ax = b;

where A is m� n; m < n. Give a op-count for the algorithm. Apply your algorithm to

1 2 3

4 5 6

!0BB@x1

x2

x3

1CCA =

6

15

!:

23. Develop an algorithm similar to the one given in section 7.8.2 for computing the minimum

norm solution of the full-rank underdetermined problem. Apply your algorithm to problem

#22.

448

Page 63: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

24. Using Theorem 7.9.1, prove that the minimum norm solution to an underdetermined system

can be obtained by projecting any solution to the system onto R(Ay). That is, if P yA is the

orthogonal projection onto R(Ay), then the minimum norm solution x is given by

x = P

yAy;

where y is any solution. Using the above formula, compute the minimum norm solution to

the system 0BB@1 10�4 0 0

1 0 10�4 0

1 0 0 10�4

1CCA

0BBBBB@

x1

x2

x3

x4

1CCCCCA =

0BB@1

1

1

1CCA :

25. Give a geometrical interpretation of Theorem 7.9.1.

PROBLEMS ON SECTION 7.10

26. Consider the natural algorithm for iterative re�nement for improving a computed least

squares solution described in the beginning of section 7.10 with x(1) = (0; : : : ; 0)T .

1. x(1) =

0BBBBB@

0

0...

0

1CCCCCA :

2. For k = 1; 2; : : : do

2.1 r(k) = b�Ax

(k). (Compute the residual.)

2.2 Solve the least squares problem: Find c(k) such that

Ac(k) � r(k) 2is minimum.

2.3 Correct the solution:

x(k+1) = x

(k) + c(k):

(a) Apply three iterations of the algorithm to each of the following problems:

(i) A =

0BB@1

2

3

1CCA ; b =

0BB@3

5

9

1CCA

(ii) A =

0BB@

1 1

10�4 0

0 10�4

1CCA ; b =

0BB@

2

10�4

10�4

1CCA

449

Page 64: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

(iii) A =

0BB@

1 1

10�4 0

0 10�4

1CCA ; b =

0BB@1

1

1

1CCA

(b) What is the relationship of this algorithm with the iterative algorithm using the aug-

mented system? (Algorithm 7.10.2)

27. Apply Algorithm 7.10.2 to each of the problems of exercise #26, with and without explicitly

solving the augmented system in step 2, and compare the results.

28. Apply Algorithm 7.10.2 to the least-squares problem with the 7 � 7 Hilbert matrix and

b =�1; 1

2;1

3;1

4;1

5;1

6;1

7

�T.

Tell how many digits of accuracy per iteration step both in the solution and the residual were

obtained.

PROBLEM ON SECTION 7.11

29. In many applications, only the diagonal entries of the Variance-Covariance matrix X =

(ATA)�1 are needed. Show that these diagonal entries are just the squares of the 2-norms of

the rows of R�1, and that these can be computed only with 2

3n3 ops.

450

Page 65: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

MATLAB PROGRAMS AND PROBLEMS ON CHAPTER 7

You will need the programs housqr, givqr, clgrsch, mdgrsch, lsfrqrh, lsfrmgs,

lsfrnme, lsudnme, lsudqrh, lsitrn1, lsitrn2, reganal from MATCOM.

1. Consider the following set of data points:

x 0 1 2 3 4 5 6 7 8 9

y 1 2.9 6.8 12 20.5 30.9 42.9 51.5 73 90.5

Using the MATLAB Command vander and the operation `n' compute the least-square �t of

the data to polynomials of degree 1 through 4.

Plot the original data point and the least-squares �ts using the MATLAB command plot and

polyval, and compare the results.

2. Let

A =

0BBBBB@

1 1

10�3 0

0 10�3

0 0

1CCCCCA ; b =

0BBBBB@

1

1

1

1

1CCCCCA :

EA = 10�4

0BBBBB@

0 �0:00010 0:0009

0 0:0003

0 0:0001

1CCCCCA ; �b = a0�4

0BBBBB@

:0001

:0001

:0001

:0001

1CCCCCA :

Using MATLAB commands pinv, cond, norm, orth, null, etc., verify the inequalities of

Theorems 7.7.1-7.7.4 on di�erent sensitivities of least-squares problems.

3. (Implementation of the Least-squares QR Algorithm using Givens Rotations).

Using givqr and bcksub, write a MATLAB program to implement the QR algorithm using

Givens Rotations for the full rank overdetermined least-square problem:

[x] = lsfrqrg (A,b).

451

Page 66: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Test-Data for Problems 3, 4 and 5

For problems 4 and 5 use the following sets of test-data.

1. A randomly generated matrix of order 10.

2. Hilbert matrix of order 10.

3.

0BBBBB@

1 1 1

10�3 0 0

0 10�3 0

0 0 10�3

1CCCCCA.

For problem #5, generate b so that the least-squares solution x in each

case has all entries equal to 1. (e.g. for data matrix in #3, b =

0BBBBB@

3

10�3

10�3

10�3

1CCCCCA

.)

4. (The Purpose of this exercise is to compare the accuracy and op-count and timing

for di�erent methods for QR factorization of a matrix.)

a. Compute the QR factorization for each matrix A of the data set using

i. [Q;R] = qr(A) fromMATLAB or [Q;R] = housqr (A) fromChapter 5. (Householder

QR).

ii. [Q;R] = givqr (A) (Givens QR)

iii. [Q;R]= clgrsch(A) from MATCOM (Classical Grass-Schmidt)

iv. [Q;R] = mdgrsch(A), from MATCOM (Modi�ed Gram-Schmidt)

b. Using the results of (a), make the following table for each matrix A. Q and R stand for

the computed Q and R.

452

Page 67: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Table

(COMPARISON OF DIFFERENT QR FACTORIZATION METHODS).

METHOD k(Q)TQ � Ik2kA� QRk2

kAk2Flop-Count Elapsed Time

housqr

givqr

clgrsch

mdgrsch

c. Write your conclusions.

5. (The purpose of this exercise is to compare the accuracy, op-count and timing

for di�erent least-squares methods for full-rank, overdetermined problems.)

a. Compute the least-squares solution x for each data set using

i. [x] = lsfrmgs(A,b) (Least-squares using modi�ed Gram-Schmidt)

ii. [x] = lsfrqrh (A,b) (Least-squares using Householder QR)

iii. [x] = lsfrqrg (A,b) (Least-squares using Givens QR)

iv. [x] = lsfrnme (A,b) (Least-squares using Normal Equations)

v. [x] = pinv (A) * b (Least-squares using generalized inverse)

Note: lsfrmgs, lsfrqrh and lsfrnme are all available in MATCOM. pinv is a

MATLAB command for computing the generalized inverse of a matrix.

b. Using the results of (a) make one table for each data set x.

Note also that the vector x has all entries equal to 1.

453

Page 68: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Table

(COMPARISON OF DIFFERENT METHODS FOR

FULL-RANK OVERDETERMINED LEAST-SQUARES PROBLEM)

METHOD kx� xk2=kxk2 kAx� bk2 Flop-Count Elapsed Time

lsfrmgs

lsfrqrh

lsfrqrg

lsfrnme

generalized-

inverse

c. Write your conclusions.

6. Using housqr from MATCOM or [Q;R] = qr(A) from MATLAB, and backsub from Chapter

6, write a MATLAB program, called lsrdqrh(A,b) to compute the minimum norm least-

squares solution x to the rank-de�cient overdetermined problem Ax = b, and the

corresponding residual r, using Householder QR factorization of A:

[x; r] = lsrdqrh (A,b)

(This program should implement Algorithm 7.8.6 of the book.)

Test Data: A 20� 2 matrix with all entries equal to 1 and b is vector with all entries equal

to 2.

7. Using the MATLAB function

[U,S,V] = svd (A)

to compute the singular value decomposition of A, write a MATLAB program, called lsrdsvd

to compute the minimum norm least-squares solution x to the rank-de�cient overdetermined

system Ax = b:

[x] = lsrdsvd (A,b)

Use the same test data as in problem #6 and compare the results with respect to accuracy,

op-count and elapsed time.

454

Page 69: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

8. Run the programs lsudnme (least-squares solution for the underdetermined full-rank

problem using normal equations) and lsudqrh (least-squares solution for the under-

determined full rank problem using Housholder QR factorization) from MATCOM

on the following sets of data to compute the minimum norm solution x to the full rank un-

derdetermined problem Ax = b, and compare the results with respect to accuracy, elapsed

time, and op-count.

A =

1 2 3 4 5 6

!; A =

1 1 1 1 1 1 1 1

0 1 2 3 4 5 6 7

!;

A =

0BB@10 10 10 10 10 10 10

0 1 0 0 0 0 0

0 1 0 0 0 0 0

1CCA :

Construct b for each A so that the minimum norm solution x has all its entries equal to 1.

9. Run the programs lsitrn1 (based on Algorithm 7.10.1) and lsitrn2 (based on Algorithm

7.10.2) fromMATCOM on the 8�8 Hilbert matrix A and constructing b randomly. Compare

the algorithms on this data with respect to number of iterations, op-count, and elapsed time,

both for the solution and the residual.

10.

a. Compute (ATA)�1 for each of the following matrices A as follows:

i. Compute explicitly (ATA)�1 using MATLAB command inv.

ii. Run the program reganal from MATCOM.

b. Compare the results with respect to accuracy, op-count, and elapsed time.

Test Data:

A = The 8� 8 Hilbert matrix

A =

0BBBBB@

1 1 1

10�3 0 0

0 10�3 0

0 0 10�3

1CCCCCA

A = A 8� 8 randomly generated matrix

455

Page 70: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

8. NUMERICAL MATRIX EIGENVALUE PROBLEMS

8.1 Introduction : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 457

8.2 Some Basic Results on Eigenvalues and Eigenvectors : : : : : : : : : : : : : : : : : : 458

8.2.1 Eigenvalues and Eigenvectors : : : : : : : : : : : : : : : : : : : : : : : : : : : 458

8.2.2 The Schur Triangularization Theorem and its Applications : : : : : : : : : : 460

8.2.3 Diagonalization of a Hermitian Matrix : : : : : : : : : : : : : : : : : : : : : : 463

8.2.4 The Cayley-Hamilton Theorem : : : : : : : : : : : : : : : : : : : : : : : : : : 466

8.3 The Eigenvalue Problems Arising in Practical Applications : : : : : : : : : : : : : : 466

8.3.1 Stability Problems for Di�erential and Di�erence Equations : : : : : : : : : : 467

8.3.2 Vibration Problem, Buckling Problem and Simulating Transient Current of

an Electrical Circuit : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 473

8.3.3 An Example of the Eigenvalue Problem Arising in Statistics: Principal Com-

ponents Analysis : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 488

8.4 Localization of Eigenvalues : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 490

8.4.1 The Ger�sgorin Disk Theorems : : : : : : : : : : : : : : : : : : : : : : : : : : : 490

8.4.2 Eigenvalue Bounds and Matrix Norms : : : : : : : : : : : : : : : : : : : : : : 494

8.5 Computing Selected Eigenvalues and Eigenvectors : : : : : : : : : : : : : : : : : : : 495

8.5.1 Discussions on the Importance of the Largest and Smallest Eigenvalues : : : 495

8.5.2 The Role of Dominant Eigenvalues and Eigenvectors in Dynamical Systems : 496

8.5.3 The Power Method, The Inverse Iteration and the Rayleigh Quotient Iteration497

8.5.4 Computing the Subdominant Eigenvalues and Eigenvectors: De ation : : : : 508

8.6 Similarity Transformations and Eigenvalue Computations : : : : : : : : : : : : : : : 515

8.6.1 Eigenvalue Computations Using the Characteristic Polynomial : : : : : : : : 515

8.6.2 Eigenvalue Computations via Jordan-Canonical Form : : : : : : : : : : : : : 520

8.6.3 Hyman's Method : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 520

8.7 Eigenvalue Sensitivity : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 521

8.7.1 The Bauer-Fike Theorem : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 521

8.7.2 Sensitivity of the Individual Eigenvalues : : : : : : : : : : : : : : : : : : : : : 524

8.8 Eigenvector Sensitivity : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 527

8.9 The Real Schur Form and QR Iterations : : : : : : : : : : : : : : : : : : : : : : : : : 529

8.9.1 The Basic QR Iteration : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 532

8.9.2 The Hessenberg QR Iteration : : : : : : : : : : : : : : : : : : : : : : : : : : : 535

8.9.3 Convergence of the QR Iterations and the Shift of Origin : : : : : : : : : : : 536

Page 71: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

8.9.4 The Single-Shift QR Iteration : : : : : : : : : : : : : : : : : : : : : : : : : : : 537

8.9.5 The Double-Shift QR Iteration : : : : : : : : : : : : : : : : : : : : : : : : : : 539

8.9.6 Implicit QR Iteration : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 543

8.9.7 Obtaining the Real Schur Form A : : : : : : : : : : : : : : : : : : : : : : : : 547

8.9.8 The Real Schur Form and Invariant Subspaces : : : : : : : : : : : : : : : : : 550

8.10 Computing the Eigenvectors : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 552

8.10.1 The Hessenberg-Inverse Iteration : : : : : : : : : : : : : : : : : : : : : : : : : 552

8.10.2 Calculating the Eigenvectors from the Real Schur Form : : : : : : : : : : : : 553

8.11 The Symmetric Eigenvalue Problem : : : : : : : : : : : : : : : : : : : : : : : : : : : 556

8.11.1 The Sturm Sequence and the Bisection Method : : : : : : : : : : : : : : : : : 558

8.11.2 The Symmetric QR Iteration Method : : : : : : : : : : : : : : : : : : : : : : 564

8.12 The Lanczos Algorithm For Symmetric Matrices : : : : : : : : : : : : : : : : : : : : 566

8.13 Review and Summary : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 573

8.14 Suggestions for Further Reading : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 578

Page 72: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

CHAPTER 8

NUMERICAL MATRIX EIGENVALUE PROBLEMS

Page 73: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

8. NUMERICAL MATRIX EIGENVALUE PROBLEMS

Objectives

The major objectives of this chapter are to study numerical methods for the matrix eigenvalue

problem. Here are some of the highlights of the chapter.

� Some practical applications (Section 8.3) giving rise to the eigenvalue problem.

� The Power method and the Inverse power methods for �nding the selected eigenvalues

and eigenvectors (Section 8.5).

� Eigenvalue and Eigenvector sensitivity (Sections 8.7 and 8.8).

� The QR iteration algorithm for �nding the eigenvalues of a matrix of moderate size

(Section 8.9).

� Inverse Iteration and Real Schur methods for �nding the eigenvectors (Section 8.10).

� Special methods for the symmetric eigenvalue problem: symmetric QR iteration with

Wilkinson shift and the bisection method (Section 8.11).

� The Lanczos methods for �nding the extremal eigenvalues of a large and sparse symmetric

matrix (Section 8.12).

Required Background

The following concepts and tools developed earlier in this book will be required for smooth

reading and understanding of the material of this chapter.

1. Norm Properties of Matrices (Section 1.7)

2. The QR factorization of an arbitrary and a Hessenberg matrix using Householder and

Givens transformations (Sections 5.4.1 and 5.5.1)

3. Linear system solutions with arbitrary, Hessenberg, and triangular matrices (Section 6.4)

4. The condition number and its properties (Section 6.7)

5. Reduction to Hessenberg and tridiagonal form (sections 5.4.3 and 5.5.3).

456

Page 74: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

8.1 Introduction

This chapter is devoted to the study of numerical matrix eigenvalue problem. The problem is a

very important practical problem and arises in a variety of applications areas including engineering,

statistics, economics, etc.

Since the eigenvalues of a matrix A are the zeros of the characteristic polynomial det(A� �I),

one would naively think of computing the eigenvalues of A by �nding its characteristic polynomial

and then computing its zeros by a standard root-�nding method. Unfortunately, this is not a

practical approach.

A standard practical algorithm for �nding the eigenvalues of a matrix is the QR iteration

method with a single or double shift. Several applications do not need the knowledge of the whole

spectrum. A few selected eigenvalues, usually a few largest or smallest ones, su�ce. A classical

method, based on implicit powering of A, known as the power method is useful for this purpose.

The symmetric eigenvalue problem enjoys certain remarkable special properties; one such prop-

erty is that the eigenvalues of a symmetric matrix are well conditioned. A method based

on the exploitation of some of the special properties of the symmetric eigenvalue problem, known as

the Sturm Sequence-Bisection method, is useful for �nding eigenvalues of a symmetric matrix

in an interval (note that the eigenvalues of a symmetric matrix are all real).

The QR iteration method, unfortunately, cannot be used to compute the eigenvalues and eigen-

vectors of a very large and sparse matrix. The sparsity gets lost and the storage becomes an

issue. An almost classical method by Lanczos has been rejuvenated by numerical linear algebraists

recently. The symmetric Lanczos method is useful in particular to extract a few extremal

eigenvalues and the associated eigenvectors of a very large and sparse matrix. The organization of

this chapter is as follows.

Some of the basic theoretical results on eigenvalues and eigenvectors are stated (and proved

sometimes) in Section 8.2.

Section 8.3 is devoted to the discussions of how the eigenvalue problem arises in some practical

applications such as stability analyses of a system of di�erential and di�erence equations, vibra-

tion analysis, transient behaviour of an electrical circuit, buckling problem, principal component

analysis in statistics, etc.

In Section 8.4 some classical results on eigenvalues locations such as the Gersgorin's disk

theorem etc. are stated and proved.

Section 8.5 describes the powermethod, the inverse powermethod, theRayleigh-Quotient

iteration, etc. for �nding a selected number of eigenvalues and the corresponding eigenvectors.

In Section 8.6 the di�culties of computing the eigenvalues of a matrix via the characteristic

457

Page 75: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

polynomial and the Jordan canonical form are highlighted.

The eigenvalue and eigenvector sensitivity are discussed in sections 8.7 and 8.8. The most

important result in this section is the Bauer-Fike theorem.

Section 8.9 is the most important section of this chapter. The QR iteration method with and

without shifts and their implementations are described in this section.

The Hessenberg-inverse iteration and computations of eigenvectors from the Real Schur

form are described in Section 8.10. The methods based on speci�c properties of symmetric ma-

trices are discussed in Section 8.11. These include the Sturm sequence-bisection method and

symmetric QR iteration method with the Wilkinson shift.

The chapter concludes with a brief introduction of the symmetric Lanczos algorithm for

�nding the extremal eigenvalues of a large and sparse symmetric matrix.

8.2 Some Basic Results on Eigenvalues and Eigenvectors

8.2.1 Eigenvalues and Eigenvectors

Let A be an n � n matrix. Then � is an eigenvalue of A if there exists a nonzero vector x such

that

Ax = �x

or (A� �I)x = 0:

The vector x is a right eigenvector (or just an eigenvector) of A associated with the eigenvalue

�. The vector y given by

y�A = �y

is called a left eigenvector of A associated with the eigenvalue �. It is customary to call a right

eigenvector just an eigenvector.

The homogeneous system (A� �I)x = 0 has a nontrivial solution i�

det(A� �I) = 0:

PA(�) = det(A��I) is a polynomial in � of degree n and is called the characteristic polynomial

of A.

Thus the n eigenvalues of A are the n roots of the characteristic polynomial.

The sum of the eigenvalues of a matrix A is called the trace of A. It is denoted by trace (A)

or Tr (A).

458

Page 76: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Recall also from Chapter 1, that if A = (aij), then trace(A) = a11 + � � �+ ann =

sum of the diagonal entries of A.

De�nition 8.2.1 The eigenvalue with the largest modulus is called spectral radius of A and is

denoted by �(A) : �(A) = maxi(j�ij).

De�nition 8.2.2 The set of eigenvalues of a matrix A is called the spectrum of A.

We now present some basic results on eigenvalues and eigenvectors.

Theorem 8.2.1 The eigenvalues of a triangular matrix are its diagonal entries.

Proof. If A = (aij) is triangular, then the matrix (A � �I) is also triangular with a11 � �; a22 ��; : : :; ann � � as its diagonal entries. So,

det(A� �I) =

nYi=1

(aii � �);

showing that the eigenvalues of A are a11; a22; : : : ; ann.

Theorem 8.2.2 The matrices A and TAT�1 have the same eigenvalues. In other

words, the eigenvalues of two similar matrices are the same.

Proof.

det(TAT�1 � �I) = det(T (A� �I)T�1)

= detT � det(A� �I) � det(T�1)

= detT � det(T�1) � det(A� �I)

= det(T � T�1) � det(A� �I)

= det(A� �I):

Thus, TAT�1 and A have the same characteristic polynomial and, therefore, have the same

eigenvalues.

459

Page 77: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Note: The converse is not true. Two matrices having the same eigenvalues are not necessarily

similar. Here is a simple example.

Take A =

1 1

0 1

!; B = I2�2 =

1 0

0 1

!. A and B have the same eigenvalues, but they cannot

be similar.

8.2.2 The Schur Triangularization Theorem and its Applications

Theorem 8.2.3 For any complex matrix A there exists a unitary matrix U such

that

UAU� = T

is a triangular matrix. The eigenvalues of A are the diagonal entries of T .

The theorem is of signi�cant theoretical importance. As we shall see below, several important

results on eigenvalues and eigenvectors can be derived using this theorem. We shall give a proof of

this theorem later in the chapter (Theorem 8.9.1).

Theorem 8.2.4 Let �1; : : : ; �n be the eigenvalues of A, then the eigenvalues of Am

are �m1 ; �m2 ; : : : ; �

mn .

In general, if p(x) is a polynomial of degree n,

p(x) = c0xn + c1x

n�1 + � � �+ cn;

then the eigenvalues of p(A) are p(�1); p(�2); : : : ; p(�n).

Proof. From U�AU = T we have

Tm = (U�

AU)(U�AU) � � �(U�

AU)

(m times)

= U�AmU:

But Tm is also a triangular matrix with �m1 ; � � � ; �mn as its diagonal entries. Since Am and T

m are

similar, they have the same eigenvalues.

460

Page 78: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

In the general case,

U�p(A)U = U

�(c0An + c1A

n�1 + � � �+ cnI)U

= c0U�AnU + c1U

�An�1

U + � � �+ cnU�U

= c0Tn + c1T

n�1 + � � �+ cnI = T1 = a triangular matrix.

The diagonal entries of the triangular matrix T1 are p(�1); p(�2); : : : ; p(�n): Since p(A) and T1 have

the same eigenvalues, the theorem is proved.

Theorem 8.2.5 The eigenvalues of a Hermitian matrix A are real. The eigenvec-

tors corresponding to the distinct eigenvalues are pairwise orthogonal.

Proof.

Since U�AU = T;

we have

(U�AU)� = T

or U�A�U = T

or U�AU = T

or T = T�:

Thus, T is also Hermitian and, therefore, diagonal.

Since the eigenvalues of A are the diagonal entries of T , and the diagonal entries of a

Hermitian matrix must be real, it follows that the eigenvalues of A are real.

Remark: Note that if A is real, then A� = A implies that A is symmetric (AT = A). The

eigenvalues of a real symmetric matrix are also real.

To prove the second part, let �1 and �2 be two distinct eigenvalues of A, and let x and y be the

associated eigenvectors. Then by de�nition, we have

Ax = �1x; x 6= 0;

and

Ay = �2y; y 6= 0;

from which we obtain

y�Ax = �1y

�x

461

Page 79: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

and

y�A�x = y

���2x = �

�2y�x = �2y

�x

(since ��2 = �2):

Since A� = A, we get

�1y�x = �2y

�x

or (�1 � �2)y�x = 0:

But, �1 6= �2, so, y�x = 0 thus, y and x are orthogonal.

Theorem 8.2.6 The eigenvalues of a Hermitian positive de�nite matrix are positive

and conversely, if a Hermitian matrix has all its eigenvalues positive, it must be

positive de�nite.

Proof. Let � be an eigenvalue of A and x be the corresponding eigenvector. Then from Ax = �x

we obtain

x�Ax = �x

�x:

Since A is positive de�nite, x�Ax > 0 and � is real. Since A is Hermitian, we then have

�x�x > 0:

But, x�x is always positive, so � > 0.

To prove the converse, we note that, since A is Hermitian, by the Schur Triangularization

theorem, (Theorem 8.2.3), we have

U�AU = diag(�i) = diag(�1; : : : ; �n):

De�ne now x = Uy, then x�Ax = y

�U�AUy =

P�iy

2i . Since the �i's are real and positive,

x�Ax > 0. Again, every nonzero y corresponds to a nonzero x. Thus, for every nonzero x, we have

x�Ax > 0, proving that A is positive de�nite.

Theorem 8.2.7 The eigenvectors associated with the distinct eigenvalues of a ma-

trix are linearly independent.

462

Page 80: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Proof. Let �1; : : : ; �m be the distinct eigenvalues and x1; : : : ; xm be the corresponding eigenvectors.

Consider

c1x1 + � � �+ cmxm = 0

where ci; i = 1; : : : ; m are constants. Multiplying by (�1I � A) to the left, we get

c1(�1I � A)x1 + c2(�1I � A)x2 + � � �+ cm(�1I �A)xm = 0;

or

c2(�1� �2)x2 + � � �+ cm(�1 � �m)xm = 0: (since Ax1 = �1x1):

Multiplying now to the left of the last equation by (�2I �A) we get

c3(�1 � �3)(�2 � �3)x3 + � � �+ cm(�1 � �s)(�2� �s)xm = 0:

Continuing this way (m � 1) times, we conclude that cm = 0, because �i 6= �j. Analogously, we

can show that

cm�1 = cm�2 = � � � = c2 = c1 = 0:

Thus, the vectors x1; : : : ; xm are linearly independent.

8.2.3 Diagonalization of a Hermitian Matrix

Theorem 8.2.8 For any Hermitian matrix A, there exists an unitary matrix U

such that

U�AU = D

is a diagonal matrix. The diagonal entries of D are eigenvalues of A.

Proof. It is an immediate consequence of the Schur Triangularization Theorem. Since

A� = A

from

U�AU = T;

we have

T� = T:

Since T is triangular, T � = T implies that it is diagonal.

463

Page 81: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Theorem 8.2.9 An arbitrary matrix A is similar to a diagonal matrix if its eigen-

values are distinct.

Proof. Let x1; : : : ; xn be the eigenvectors corresponding to the eigenvalues �1; : : : ; �n. De�ne

X = (x1; : : : ; xn):

Then,

AX = A(x1; : : : ; xn) = (�1x1; : : : ; �nxn)

= (x1; : : : ; xn)

0BBBBB@

�1 0

��

0 �n

1CCCCCA = XD

where D = diag(�1; : : : ; �n).

Since x1; : : : ; xn are the eigenvectors corresponding to the distinct eigenvalues �1; : : : ; �n, they

are linearly independent (by Theorem 8.2.7). Therefore, X is nonsingular. So,

X�1AX = D:

De�nition 8.2.3 An n � n matrix A is said to be nondefective if it is diagonalizable; that is,

if it is similar to a diagonal matrix. Otherwise, the matrix is defective. (Compare this de�nition

with that given in Chapter 1 (De�nition 1.3.1))

Thus any complex Hermitian matrix, any real symmetric matrix and a matrix A

having distinct eigenvalues are nondefective.

It is clear that an arbitrary matrix can not be reduced to a diagonal matrix by similarity.

However, it can always be reduced to a block diagonal matrix as the following result shows.

464

Page 82: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Theorem 8.2.10 (The Jordan Theorem) For an n� n matrix A, there exists a

nonsingular matrix T such that

T�1AT =

0BBBBBBBBBBB@

J1

� 0

��

0 �Jm

1CCCCCCCCCCCA

where

Ji =

0BBBBBBBBBBB@

�i 1

� �i 1 0

� �� �

0 � 1

�i

1CCCCCCCCCCCA

where the �i are eigenvalues of A.

Proof. See Horn and Johnson (1985, pp. 121{129).

Jordan Canonical Form

The diagonal block matrix above is called the Jordan Canonical Form of A. The matrices

J1; : : : ; Jm are Jordan matrices. If Ji is of degree vi, then

v1 + � � �+ vm = n:

De�nition 8.2.4 The polynomials

det(Ji � �I) = (�i � �)vi

are called the elementary divisors of A. If v1 = v2 = � � � = vm = 1 then the elementary divisors

are called linear elementary divisors.

Notes: We note the following:

(1) When all the eigenvalues of A are distinct, each Jordan block has order 1 and therefore

elementary divisors are linear. In fact, if there are m Jordan blocks, there are m linearly

independent eigenvectors, counting the multiplicities of the same block.

465

Page 83: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

(2) If there are some nonlinear elementary divisors, then A has eigenvalues whose multiplicities

are higher than or equal to the number of independent eigenvectors associated with them.

(3) For a real symmetric or complex Hermitian matrix, the elementary divisors are linear.

8.2.4 The Cayley-Hamilton Theorem

Theorem 8.2.11 A square matrix A satis�es its own characteristic equation; that

is, if A = (aij) is an n � n matrix and Pn(�) is the characteristic polynomial of A,

then

Pn(A) is a ZERO matrix.

Proof. See Matrix Theory by Franklin, pp. 113{114.

Example 8.2.1

Let A =

0@ 0 1

1 2

1A:

P2(�) = �2 � 2�� 1:

P2(A) =

0@ 1 2

2 5

1A� 2

0@ 0 1

1 2

1A �

0@ 1 0

0 1

1A

=

0@ 0 0

0 0

1A:

8.3 The Eigenvalue Problems Arising in Practical Applications

The problem of �nding the eigenvalues and eigenvectors arise in a wide variety of practical ap-

plications. It arises in almost all branches of science and engineering. As we have seen before,

the mathematical models of many engineering problems are systems of di�erential and di�erence

equations and the solutions of these equations are often expressed in terms of the eigenvalues and

eigenvectors of the matrices of these systems. Furthermore, many important characteristics of phys-

ical and engineering systems, such as stability, etc., often can be determined only by knowing the

nature and location of the eigenvalues. We will give a few representative examples in this section.

466

Page 84: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

8.3.1 Stability Problems for Di�erential and Di�erence Equations

A homogeneous linear system of di�erential equations with constant coe�cients of the form:

dx1(t)

dt

= a11x1(t) + a12x2(t) + � � �+ a1nxn(t)

dx2(t)

dt

= a21x1(t) + a22x2(t) + � � �+ a2nxn(t)

...

dxn(t)

dt

= an1x1(t) + an2x2(t) + � � �+ annxn(t)

or in matrix form

_x(t) = Ax(t); (8.3.1)

where

A = (aij)n�n;

and

_x(t) =d

dt

0BB@x1(t)...

xn(t)

1CCA ;

arises in a wide variety of physical and engineering systems. The solution of this system is intimately

related to the eigenvalue problem for the matrix A.

To see this, assume that (8.3.1) has a solution x(t) = ve�t, where v is not dependent on t. Then

we must have

�ve�t = Ave

�t; (8.3.2)

that is

Av = �v; (8.3.3)

showing that if � is an eigenvalue of A and v is corresponding eigenvector. Thus the eigenpair (�; v)

of A can be used to compute a solution x(t) of (8.3.1). If A has n linearly independent eigenvectors

(which will happen, as we have seen in the last section, when the eigenvalue of A are all distinct),

then the general solution of the system can be written as

x(t) = c1v1e�1t + c2v2e

�2t + � � �+ cnvne�nt

; (8.3.4)

where �1; : : : ; �n are the eigenvalues of A and v1; v2; : : : ; vn are the corresponding eigenvectors.

In the general case, the general solution of (8.3.1) with x(0) = x0 is given by

x(t) = eAtx0; (8.3.5)

467

Page 85: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

where

eAt = I +At +

A2t2

2!+ : : :

The eigenvalues �i and the corresponding eigenvectors now appear in the computation of eAt:

For example, if A has the Jordan Canonical Form

V�1AV = diag(J1; J2; : : : ; Jk); (8.3.6)

Ji =

0BBBBB@

�i 1 � � � 0. . .

. . ....

. . .. . . 1

0 � � � � � � �i

1CCCCCA ; (8.3.7)

then

eAt = V diag(eJ1t; eJ2(t); : : : ; eJkt)V �1

; (8.3.8)

where

eJit = e

�it

0BBBBBBBBBB@

1 t t2=2 � � � t

p=p!

1 t � � � tp�1

=(p� 1)!

. . .. . .

...

� � � . . . t

� � � � � � 1

1CCCCCCCCCCA: (8.3.9)

Thus, the system of di�erential equations (8.3.1) is completely solved by knowing its eigenvalues

and eigenvectors of the system matrix A.

Furthermore, as said before, many interesting and desirable properties of physical and engineer-

ing systems can be studied just by knowing the location or the nature of the eigenvalues of the

system matrix A. Stability is one such property. The stability is de�ned with respect to an

equilibrium solution.

De�nition 8.3.1 An equilibrium solution of the system

_x(t) = Ax(t); x(0) = x0; (8.3.10)

is the vector xe satisfying

Axe = 0:

Clearly, xe = 0 is an equilibrium solution and it is the unique equilibrium solution

i� A is nonsingular.

A mathematical de�nition of stability is now in order.

468

Page 86: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

De�nition 8.3.2 An equilibrium solution xe is said to be stable, if, for any t0 and � > 0, there

exists a real number �(�; t0) > 0 such that kx(t)� xek < � wherever kx0 � xek � �:

The system (8.3.1) is stable if the equilibration solution xe = 0 is stable.

In other words, the stability guarantees that the system

remains close to the origin if the initial position is chosen

close to it.

In many situations, stability is not enough, one needs more than that.

De�nition 8.3.3 An equilibrium solution is asymptotically stable if it is stable and if, for any

t0, there is a � such that

kx(t)� xek ! 0; as t!1

whenever

kx0 � xek < �:

De�nition 8.3.4 The system (8.3.1) is asymptotically stable if the equilibrium solution xe = 0 is

asymptotically stable.

In other words, the asymptotic stability not only guarantees

the stability but ensures that every solution x(t) converges

to the origin whenever the initial position is chosen close to

it.

Since an asymptotically stable system is necessarily stable, but not conversely, the following

convention is normally adopted.

De�nition 8.3.5 A system is called marginally stable if it is stable, but not asymptotically

stable.

De�nition 8.3.6 A system that is not stable is called unstable.

Mathematical Criteria for Asymptotic Stability

469

Page 87: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Theorem 8.3.1 (Stability Theorem For a Homogeneous System of Di�er-

ential Equations) A necessary and su�cient condition for the equilibrium solution

xe = 0 of the homogeneous system (8.3.1) to be asymptotically stable is that the

eigenvalues of the matrix A all have negative real parts.

Proof. It is enough to prove that x(t) ! 0 as t ! 1. Since the general solution of the system

_x(t) = Ax(t) is given by x(t) = eAtx(0), the proof follows from (8.3.6){(8.3.9).

Note that if �j = �j + i�j; j = 1; 2; : : : ; n; then e�jt = e

�jtei�jt, and e

�jt ! 0, when t !1, i�

�j < 0:

Stability of a Nonhomogeneous System

Many practical situations give rise to mathematical model of the form

_x(t) = Ax(t) + b; (8.3.11)

where b is a constant vector. The stability of such a system is also governed by the eigenvalues of

A. This can be seen as follows.

Let �x(t) be an equilibrium solution of (8.3.11). De�ne

z(t) = x(t)� �x(t):

Then

_z(t) = _x(t)� ( _�x)(t)

= Ax(t) + b� A�x(t)� b

= A(x(t)� �x(t)) = Az(t):

Thus, x(t)! �x(t) if and only if z(t)! 0. It, therefore, follows from Theorem 8.3.1 that:

Theorem 8.3.2 (Stability Theorem For a Nonhomogeneous System of Dif-

ferential Equations) (i) An equilibrium solution of (8.3.11) is asymptotically sta-

ble i� all the eigenvalues of A have negative real parts. (ii) An equilibrium solution

is unstable if at least one eigenvalue has a positive real part.

470

Page 88: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Remarks: Since the stability of an equilibrium solution depends upon the eigenvalues of the

matrix A of the system, it is usual to refer to stability of the system itself, or just the stability

of the matrix A.

Stability of a System of Di�erence Equations

Like the system of di�erential equations (8.3.11), many practical systems are modeled by a system

of di�erence equations: xk+1 = Axk + b.

A well-known mathematical criterion for asymptotic stability of such a system is given in the

following theorem. We leave the proof to the readers.

Theorem 8.3.3 (Stability Theorem for a System of Di�erence Equations).

An equilibrium solution of

xk+1 = Axk + b (8.3.12)

is asymptotically stable i� all the eigenvalues of A are inside the unit circle. The

equilibrium solution is unstable if at least one eigenvalue has magnitude greater

than 1.

Summarizing, to determine the stability and asymptotic stability of

a system modeled by a system of �rst order di�erential or di�erence

equations, all we need to know is if the eigenvalues of A are in the

left half plane or inside the unit circle, respectively.

Explicit knowledge of the eigenvalues is not needed.

Example 8.3.1 A European Arms Race

Consider the arms race of 1909-1914 between two European alliances.

Alliance 1: France and Russia.

Alliance 2: Germany and Austria-Hungary.

The two alliances went to war against each other. Let's try to explain this historical fact through

the notion of stability.

471

Page 89: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

First consider the following crude (but simple) mathematical model of war between two coun-

tries:

dx1

dt

= k1x2 � �1x1 + g1

dx2

dt

= k2x1 � �2x2 + g2

where

xi(t) = war potential of the country i, i = 1; 2

gi(t) = the grievances that country i

has against the other, i = 1; 2:

gi, �i and ki, i = 1; 2; are all positive constants. �ixi denotes the cost of armaments of the country

i. This mathematical model is due to L. F. Richardson, and is known as the Richardson model.

Note that this simple model is realistic in the sense that the rate of change of the war potential

of one country depends upon the war potential of the other country, and on the grievances that

one country has against its enemy-country, and the cost of the armaments the country can a�ord.

While the �rst two factors cause the rate to increase, the last factor has certainly a slowing e�ect

(that is why we have a � sign associated with that term).

In matrix form, this model can be written as:

_x(t) = Ax(t) + g

where

A =

0@ ��1 k1

k2 ��2

1A; x(t) =

0@ x1(t)

x2(t)

1A;

g =

0@ g1

g2

1A:

The eigenvalues of A are

� =�(�1 + �2)�

p(�1 � �2)2 + 4k1k2

2:

Thus the equilibrium solution x(t) is asymptotically stable if �1�2 � k1k2 > 0, and unstable if

�1�2 � k1k2 < 0. This is because when �1�2 � k1k2 > 0, both the eigenvalues will have negative

real parts; if it is negative, one eigenvalue will have positive real parts.

For the above European arms race, the estimates of �1; �2 and k1; k2 were made under some

realistic assumptions and were found to be as follows:

�1 = �2 = 0:2

472

Page 90: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

k1 = k2 = 0:9:

(For details of how these estimates were obtained, see the book by M. Braun (1978)). The main

assumptions are that both the alliances have roughly the same strength and �1 and �2 are the

same as Great Britain which is usually taken to be the reciprocal of the life-time of the British

Parliament (�ve years).)

With these values of �1; �2; and k1; k2, we have

�1�2 � k1k2 = �21 � k

21 = �:7700:

Thus the equilibrium is unstable. In fact, the two eigenvalues are: 1.4000 and �2:2000.For a general model of Richardson's theory of arm races and the role of eigenvalues there, see

the book Introduction to Dynamic Systems by David G. Luenberger, John Wiley and Sons,

New York, 1979 (pp. 209-214).

Convergence of Iterative Schemes for Linear Systems

In Chapter 6 (Theorem 6.10.1) we have seen that the iteration:

xk+1 = Bxk + d (8.3.13)

for solving the linear system

Ax = b

converges to the solution x for an arbitrary choice of the initial approximation x1 i� the spectral

radius �(B) < 1.

We thus see again that only an implicit knowledge of the eigenvalues of B is needed

to see if an iterative scheme based upon (8.3.13) is convergent.

8.3.2 Vibration Problem, Buckling Problem and Simulating Transient Current of an

Electrical Circuit

Analysis of vibration and buckling of structures, simulation of transient current of electrical circuits,

etc., often give rise to a system of second-order di�erential equations of the form:

B�y +Ay = 0; (8.3.14)

where

�y =

0BBBBBB@

�y1(t)

�y2(t)

...

�yn(t)

1CCCCCCA: (8.3.15)

473

Page 91: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

The solution of such a system leads to the solution of an eigenvalue problem of the type:

Ax = �Bx: (8.3.16)

This can be seen as follows:

Let y = xeiwt be a solution of the system (8.3.14). Then from (8.3.14) we must have

w2Bx = Ax:

Writing � = w2, this becomes

Ax = �Bx: (8.3.17)

Such an eigenvalue problem is called a generalized eigenvalue problem.

The number � is called a generalized eigenvalue and x is the corresponding generalized

eigenvector. Very often in practice the matrices A and B are symmetric and positive de�nite.

In such a case, an explicit solution of the system can be written down in terms of the generalized

eigenvalues and eigenvectors.

The eigenvalues of the generalized eigenvalue problem in this case are all real and positive. A

solution of (8.3.14) in this case can be written down in terms of the eigenvalues and the eigenvectors.

Eigenvalue-Eigenvector Solution of B�y +Ay = 0 with

A; B Positive De�nite

Let x1; x2; : : : ; xn be the n independent eigenvectors corresponding

to the generalized eigenvalues �1; �2; : : : ; �n, of (8.3.17), then

y =

nXi=1

ci cos(�it + di)xi;

where ci and di are arbitrary constants. (See Wilkinson, AEP pp.

34{35.)

In vibration problems the matrices B and A are, respectively, called the mass and sti�ness

matrices, and are denoted by M and K, giving rise to the symmetric generalized eigenvalue

problem:

Kx = �Mx:

474

Page 92: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

De�nition 8.3.7 The quantities wi =p�i; i = 1; : : : ; n are called natural frequencies, and

x1; : : : ; xn are called the amplitudes of vibration of the masses.

The frequencies can be used to determine the periods Tp for the vibrations. Thus

Tpi =2�

wi

is the period of vibration for the ith mode.

As we will see, the behavior of a vibrating system can be analyzed by knowing the

natural frequencies and the amplitudes . We will give a simple example below to illustrate

this. An entire chapter (Chapter 9) will be devoted to the generalized eigenvalue problem later.

Other vibration problems such as the buckling problem of a beam gives rise to boundary

value problems for the second-order di�erential equations. The solutions of such problems using

�nite di�erences lead to also eigenvalue problems. We will also illustrate this in this section .

We now describe below how the frequencies and amplitudes can be used to predict the phe-

nomenon of resonance in vibration engineering.

All machines and structures such as bridges, buildings, aircrafts, etc., possessing mass and

elasticity experience vibration to some degree, and their design require consideration of their os-

cillatory behavior. Free vibration takes place when a system oscillates due to the forces inherent

in the system, and without any external forces. Under free vibration such systems will vibrate at

one or more of its natural frequencies, which are properties of the dynamical system and depends

on the associated mass and sti�ness distribution. For forced vibration, systems oscillate under the

excitation of external forces. When such excitation is oscillatory the system is also forced to vibrate

at the excitation frequency.

475

Page 93: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Phenomenon of Resonance

If the excitation frequency coincides or becomes close to

one of the natural frequencies of the system, dangerously

large oscillations may result, and a condition of resonance

is encountered. This is the kind of situation an engineer

would very much like to avoid. The collapse of the Tacoma

Narrows (also known as Galloping Gerty) Bridgea at Puget

Sound in the state of Washington in 1940 and that of the

Broughton Suspension Bridge in England are attributed to

such a phenomenon.

aFor a complete story of the collapse of the Tacoma bridge, see the book

Differential Equations and Their Applications by M. Braun, Springer-

Verlag, 1978 (p. 167{169).

In both the above cases, a periodic force of very large amplitude was generated and, the fre-

quency of this force was equal to one of the natural frequencies of the bridge at the time of collapse.

In the case of the Broughton Bridge, the large force was set up by soldiers marching in cadence

over the bridge. In case of the Tacoma Bridge, it was the wind. Because of what happened

in Broughton, soldiers are no longer permitted to march in cadence over a bridge.

Buildings can be constructed with active devices so that the force due to wind can be controlled.

The famous Chicago Sears Tower in the windy city, Chicago, has such a device.

Another important property of dynamical systems is damping which is present in all systems

due to energy dissipation by friction and other resistances. However, for small values of damping,

it has very little e�ect on the natural frequencies, and is normally not included in the estimation

of natural frequencies. Damping becomes important in limiting the amplitude of oscillation at

resonance, major e�ect of damping is to reduce amplitude with time.

For a continuous elastic body the number of independent co-ordinates or degrees of freedom

needed to describe the motion is in�nite. However, under many situations, parts of such bodies

may be assumed to be rigid, and the system may be treated dynamically equivalent to one having

a �nite number of the degrees of freedom.

In summary, the behavior of a vibrating system can be analyzed by knowing the frequencies

and the amplitudes of the masses, and the eigenvalue and the eigenvectors of the matrix of the

mathematical model of the system are related to these quantities. Speci�cally, the frequencies

476

Page 94: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

are the square roots of the eigenvalues and the relative amplitudes are represented by

the components of the eigenvectors.

Example 8.3.2 Vibration of a Building

Consider a two-story building (Figure 8.1(a)) with rigid oor shown below. It is assumed that

the weight distribution of building can be represented in the form of concentrated weight at each

oor level, as shown in Figure 8.1(b), and the sti�ness of supporting columns are represented by

the spring constants ki.

Figure 8.3

(a) (b)

k1 = k

k2 = k

m1 = m

m2 = m

`

`

y1

y2

Figure 8.1

The equation of motion for this system can be written as

m1�y1 + (k1 + k2)y1 � k2y2 = 0

m2�y2 � k2y1 + k2y2 = 0

or m1 0

0 m2

! �y1

�y2

!+

k1 + k2 �k2�k2 k2

! y1

y2

!= 0: (8.3.18)

477

Page 95: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Taking m1 = m2 = m; k1 = k2 = k, we have

m 0

0 m

! �y1

�y2

!+

2k �k�k k

! y1

y2

!= 0: (8.3.19)

De�ning

the mass matrix M =

m 0

0 m

!

and

the sti�ness matrix K =

2k �k�k k

!

the above equation becomes

M �y +Ky = 0; where y =

y1

y2

!: (8.3.20)

Assuming that a solution y is of the form

y = xeiwt;

and multiplying the above equation by M�1 and, setting A =M�1K and � = w

2; the equations of

motion give rise to the eigenvalue problem or 2km

� k

m

� k

m

k

m

! x1

x2

!= �

x1

x2

!: (8.3.21)

The eigenvalues �1 and �2 and the corresponding eigenvectors representing two normal modes

for this 2� 2 problem are easily calculated. The eigenvalues are:

�1 =k

m

(0:3820); �2 =k

m

(2:6180):

The corresponding eigenvectors are: 0:5257

0:8507

!;

0:8507

�0:5257

!:

The vibration of the building at these two normal modes are shown in the �gure:

478

Page 96: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

-0.526

0.851

0.526

0.851

!2 = 1:618

rk

m

!1 = 0:618

rk

m

Figure 8.2

Buckling Problem (A Boundary Value Problem)

Consider a thin, uniform beam of length l. An axial load P is applied to the beam at one of

the ends.

P

`

x

y

Figure 8.3

We are interested in the stability of the beam, that is, how and when the beam buckles. We

479

Page 97: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

will show below how this problem gives rise to an eigenvalue problem and what role the eigenvalues

play.

Let y denote the vertical displacement of a point of the beam which is at a distance x from

the (de ection) left support. Suppose that both the ends of the beam are simply supported, i.e.,

y(0) = y(l) = 0: >From beam theory the basic relationship between the curvatured2y

dx2and the

internal moment M for the axes isd2y

dx2=

M

EI

where E is the modulus of elasticity, and I is the area moment of inertia of column cross-section.

Writing the bending moment at any section asM = Py, the equation gives the governing di�erential

equation which is the so-called bending moment equation:

EI

d2y

dx2= �Py: (8.3.22)

The constant EI is called the exural rigidity of the beam.

The bending moment equation along with the boundary conditions

y(0) = y(l) = 0 (8.3.23)

constitute a boundary value problem.

We will solve this boundary value problem by approximatingd2y

dx2with an appropriate �nite

di�erence scheme, as was done in Chapter 6.

Let the interval [0; l] be partitioned into n subintervals of equal length h, with x0; x1; : : : ; xn as

the points of division. That is,

0 = x0 < x1 < x2 < : : : < xj < : : : < xn�1 < xn = l

and

h =l

n

:

Letd2y

dx2

����x=xi

� yi+1 � 2yi + yi�1

h2

: (8.3.24)

Substituting this approximation ofd2y

dx2into the bending moment equation (8.3.22) and taking

into account the boundary conditions (8.3.23), we obtain the following symmetric tridiagonal

matrix eigenvalue problem:0BBBBBBBB@

2 �1 0 � � � 0

�1 2 �1 � � � 0...

. . .. . .

. . ....

.... . .

. . .. . . �1

0 0 0 �1 2

1CCCCCCCCA

0BBBBBBBB@

y1

y2

...

...

yn

1CCCCCCCCA= �

0BBBBBBBB@

y1

y2

...

...

yn

1CCCCCCCCA; (8.3.25)

480

Page 98: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

where

� =Ph

2

EI

: (8.3.26)

Each value of � determines a load

P =�EI

h2

(8.3.27)

which is called a critical load. These critical loads are the ones which are of practical interests,

because they determine the possible onset of the buckling of the beam.

In general, the smallest value of P is of primary importance, since the bending

associated with larger values of P may not be obtained without failure from occurring

under the action of the lowest critical value P .

Simulating Transient Current for an Electric Circuit ( Chapra and Canale (1988) ).

Given an electric circuit consisting of several loops, suppose we are interested in the transient

behavior of the electric circuit. In particular, we want to know the oscillation of each loop with

respect to the other. First consider the following circuit of the loop.

��AAA�

��AAA��

��

��

��

��

_

R

C L

� i

Figure 8.4

Voltage drop across a capacitor is:

VC =q

C

; q = charge in the capacitor

C = capacitance

Voltage drop across an inductor:

VL = L

di

dt

; L is inductor u;

Voltage drop across a resistor:

VR = iR; R is resistor u:

481

Page 99: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Kircho�'s law of voltage states that the algebraic sum of voltage drops around a closed loop circuit

is zero. We then have for this circuit

L

di

dt

+ Ri+q

C

= 0

or

L

di

dt

+ iR+1

C

Z 0

�1

i dt = 0

(Because, VC =q

C

=1

C

Zi dt:)

Now consider the network with four loops.

��

��

������L1

_

C1

+

i1

$

%�

������L2

_

C2

i2

$

%�

������L3

_

C3

i3

$

%�

������L4

_

C4

i4

$

%�

Figure 8.5

Kircho�'s voltage law applied to each loop gives

Loop 1:

� L1

di1

dt

� 1

C1

Z t

�1

(i1 � i2)dt = 0 (8.3.28)

Loop 2:

� L2

di2

dt

� 1

C2

Z t

�1

(i2 � i3)dt+1

C1

Z t

�1

(i1 � i2)dt = 0 (8.3.29)

Loop 3:

� L3

di3

dt

� 1

C3

Z t

�1

(i3 � i4)dt+1

C2

Z t

�1

(i2 � i3)dt = 0 (8.3.30)

Loop 4:

� L4

di4

dt

� 1

C4

Z t

�1

i4dt +1

C3

Z t

�1

(i3 � i4)dt = 0: (8.3.31)

482

Page 100: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

The system of ODEs given by (8.3.28)-(8.3.31) can be di�erentiated and rearranged to give

L1

d2i1

dt2+

1

C1

(i1 � i2) = 0 (8.3.32)

L2

d2i2

dt2+

1

C2

(i2 � i3)�1

C1

(i1 � i2) = 0 (8.3.33)

L3

d2i3

dt2+

1

C3

(i3 � i4)�1

C2

(i2 � i3) = 0 (8.3.34)

L4

d2i4

dt2+

1

C4

i4 �1

C3

(i3 � i4) = 0: (8.3.35)

Assume

ij = Aj sin(wt); j = 1; 2; 3; 4: (8.3.36)

(Recall that ij is the current at the jth loop.)

>From (8.3.32)

�L1A1w2 sinwt +

1

C1

A1 sinwt�1

C1

A2 sinwt = 0

or

(1

C1

� L1w2)A1 �

1

C1

A2 = 0: (8.3.37)

>From (8.3.33)

�L2A2w2 sinwt+

1

C2

A2 sinwt �1

C2

A2 sinwt�1

C1

A1 sinwt+1

C1

A2 sinwt = 0

or

� 1

C1

A1 + (1

C1

+1

C2

� L2w2)A2 �

1

C2

A3 = 0: (8.3.38)

>From (8.3.34)

�L3A3w2 sinwt+

1

C3

A3 sinwt �1

C3

A4 sinwt�1

C2

A2 sinwt+1

C2

A3 sinwt = 0

or

� 1

C2

A2 + (1

C2

+1

C3

� L3w2)A3 �

1

C3

A4 = 0: (8.3.39)

>From (8.3.35)

�L4A4w2 sinwt+

1

C4

A4 sinwt �1

C3

A3 sinwt�1

C3

A4 sinwt = 0

or

� 1

C3

A3 + (1

C3

+1

C4

� L4w2)A4 = 0: (8.3.40)

483

Page 101: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Gathering the equations (8.3.37){(8.3.40) together, we have

(1

C1

� L1w2)A1 �

1

C1

A2 = 0 (8.3.41)

� 1

C1

A1 + (1

C1

+1

C2

� L2w2)A2 �

1

C2

A3 = 0 (8.3.42)

� 1

C2

A2 + (1

C2

� 1

C3

� L3w2)A3 �

1

C3

A4 = 0 (8.3.43)

� 1

C3

A3 + (1

C3

+1

C4

� L4w2)A4 = 0 (8.3.44)

or

(1� L1C1w2)A1 �A2 = 0 (8.3.45)

�C2

C1

A1 + (C2

C1

+ 1� L2C2w2)A2 �A3 = 0 (8.3.46)

�C3

C2

A2 + (C3

C2

+ 1� L3C3w2)A3 �A4 = 0 (8.3.47)

�C4

C3

A3 + (C4

C3

+ 1� L4C4w2)A4 = 0: (8.3.48)

or

A1 �A2 = L1C1w2A1

�C2

C1

A1 +C2

C1

A2 +A2 �A3 = L2C2w2A2

�C3

C2

A2 + (C3

2+ 1)A3 � A4 = L3C3w

2A3

�C4

C3

A3 + (C4

C3

+ 1) +A4 = L4C4w2A4

(8.3.49)

In matrix form, (8.3.49) is:

0BBBBBB@

1 �1 0 0

�C2

C1

(C2

C1

+ 1) �1 0

0 �C3

C2

(C3

C2

+ 1) �1�C4

C3

(C4

C2

+ 1)

1CCCCCCA

0BBBBBB@

A1

A2

A3

A4

1CCCCCCA

= w2

0BBBBBB@

L1C1 0 0 0

0 L2C2 0 0

0 0 L3C3 0

0 0 0 L4C4

1CCCCCCA

0BBBBBB@

A1

A2

A3

A4

1CCCCCCA: (8.3.50)

The above is an eigenvalue problem. To see it more clearly, consider the special case

C1 = C2 = C3 = C4 = C;

484

Page 102: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

and

L1 = L2 = L3 = L4 = L;

and assume

� = LCw2;

then the above problem reduces to

(1� �)A1 �A2 = 0

�A1 + (2� �)A2 �A3 = 0

�A2 + (2� �)A3 �A4 = 0

�A3 + (2� �)A4 = 0

or 0BBBBBB@

(1� �) �1�1 (2� �) �1

�1 +(2� �) �1�1 +(2� �)

1CCCCCCA

0BBBBBB@

A1

A2

A3

A4

1CCCCCCA= 0 (8.3.51)

or since ij = Aj sin wt; j = 1; : : : ; 4:We have

0BBBBBB@

(1� �) �1�1 (2� �) �1

�1 (2� �) �1�1 (2� �)

1CCCCCCA

0BBBBBB@

i1

i2

i3

i4

1CCCCCCA= 0 (8.3.52)

or 0BBBBBB@

1 �1 0 0

�1 2 �1 0

0 �1 2 �10 0 �1 2

1CCCCCCA

0BBBBBB@

i1

i2

i2

i3

1CCCCCCA= �

0BBBBBB@

i1

i2

i3

i4

1CCCCCCA: (8.3.53)

The solution of this eigenvalue problem will give us the natural frequencies (w2i = �i=LC):Moreover

the knowledge of the eigenvectors can be used to study the circuit's physical behavior such as the

natural modes of oscillation.

These eigenvalues and the corresponding normalized eigenvectors (in four digit arithmetic) are:

�1 = :1206; �2 = 1; �3 = 2:3473; �4 = 3:5321:

485

Page 103: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

0BBBBB@

:6665

:5774

:4285

:2280

1CCCCCA ;

0BBBBB@

:5774

�0:0000�0:5774�:5774

1CCCCCA ;

0BBBBB@

�:4285:5774

:2289

�:6565

1CCCCCA ;

0BBBBB@

�:2280:5774

�:6565:4285

1CCCCCA :

From the directions of the eigenvectors we conclude that for �1 all the loops oscillate

in the same direction. For �3 the second and third loops oscillate in the opposite

directions from the �rst and fourth, and so on. This is shown in the following diagram:

486

Page 104: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

-

+

-

+

-

+

-

+

�4 = 3:5321

�3 = 2:3473

�2 = 1

�1 = 0:1206

Figure 8.6

487

Page 105: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

8.3.3 An Example of the Eigenvalue Problem Arising in Statistics: Principal Com-

ponents Analysis

Many practical-life applications involving statistical analysis (e.g. stock market, weather prediction,

etc.) involve a huge amount of data. The volume and complexities of the data in these cases can

make the computations required for analysis practically infeasible. In order to handle and analyze

such a voluminous amount of data in practice, it is therefore necessary to reduce the data. The basic

idea then will be to choose judiciously `k' components from a data set consisting of n measurement

on p(p > k) original variables, in such a way that much of the information (if not most) in the

original p variables is contained in the k chosen components.

Such k components are called the �rst k \principal components" in statistics.

The knowledge of eigenvalues and eigenvectors of the covariance matrix is needed to �nd these

principal components.

Speci�cally, if � is the covariance matrix corresponding to the random vector

X = (X1; X2; : : : ; Xp);

�1 � �2 � : : : � �p � 0 are the eigenvalues, and x1 through xp are the corresponding eigenvectors

of the matrix �, then the ith principal component is given by

Yi = xTi X; i = 1; 2; : : : ; p:

Furthermore, the proportion of total population variance due to ith principal component is given

by the ratio:

�i

�1 + �2 + : : :+ �p

=�i

trace(�); i = 1; : : : ; pn: (8.3.54)

Note: The covariance matrix is symmetric positive semide�nite, and, therefore, its

eigenvalues are all nonnegative.

If the �rst k ratios constitute the most of the total population variance, then the �rst k principal

components can be used in statistical analysis.

Note that in computing the kth ratio, we need to know only the kth eigenvalue of the covariance

matrix; the entire spectrum does not need to be computed. To end this section, we remark that

many real-life practices, such as computing the index of Dow Jones Industrial Average, etc.,

can now be better understood and explained through the principal components analysis. This is

shown in the example below.

488

Page 106: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

A Stock-Market Example (Taken from Johnson and Wichern (1992))

Suppose that the covariance matrix for the weekly rates of return for stocks of �ve major

companies (Allied Chemical, DuPont, Union Carbide, Exxon, and Texaco) in a given period of

time is given by:

R =

0BBBBBBBB@

1:000 0:577 0:509 0:387 0:462

0:577 1:000 0:599 0:389 0:322

0:509 0:599 1:000 0:436 0:426

0:387 0:389 0:436 1:000 0:523

0:462 0:322 0:426 0:523 1:000

1CCCCCCCCA:

The �rst two eigenvalues of R are:

�1 = 2:857 (8.3.55)

�2 = :809: (8.3.56)

The proportion of total population variance due to the �rst component is approximately

2:857

5= 57%: (8.3.57)

The proportion of total population variance due to the second component is:

:809

5= approximately 16%: (8.3.58)

Thus the �rst two principal components account for 73% of the total population variance. The

eigenvectors corresponding to these principal components are:

xT1 = (:464; :457; :470; :421; :421) (8.3.59)

and

xT2 = (:240; :509; :260;�:526;�:582): (8.3.60)

These eigenvectors have interesting interpretations. >From the expression of x1 we see that the

�rst component is (roughly) equally weighted sum of the �ve stocks. This component is generally

called themarket component. However, the expression for x2 tells us that the second component

represents a contrast between the chemical stocks and the oil-industries stocks. This component

will be generally called an industry component. Thus, we conclude that about 57% of total

variations in these stock returns is due to the market activity and 16% is due to industry activity.

The eigenvalue problem also arises in many other important statistical analysis, for example,

in computing the canonical correlations, etc. Interested readers are referred to the book by

Johnson and Wichern (1992) for further reading.

489

Page 107: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

A �nal comment: Most eigenvalue problems arising in statistics,

such as in principal components analysis, canonical correlations, etc.,

are actually singular value decomposition problems and should be

handled computationally using the singular value decomposition to

be described in Chapter 10.

8.4 Localization of Eigenvalues

As we have seen in several practical applications, explicit knowledge of eigenvalues may not be

required; all that is required is a knowledge of distribution of the eigenvalues in some given regions

of the complex plane or estimates of some speci�c eigenvalues. There are ways such information

may be acquired without actually computing the eigenvalues of the matrix. In this section, we shall

discuss some of the well-known approaches. We start with a well-known result of Ger�sgorin (1931).

8.4.1 The Ger�sgorin Disk Theorems

Theorem 8.4.1 (Ger�sgorin's First Theorem) Let A = (aij)n�n. De�ne

ri =

nXj=1

i6=j

jaijj; i = 1; : : : ; n:

Then each eigenvalue � of A satis�es at least one of the following inequalities:

j�� aiij � ri; i = 1; 2; : : : ; n:

In other words, all the eigenvalues of A can be found in the union of disks fz :

jz � aiij � ri; i = 1; : : : ; ng.

Proof. Let � be an eigenvalue of A and x be an eigenvector associated with �. Then from

Ax = �x

or from

(�I � A)x = 0;

490

Page 108: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

we have

(�� aii)xi =nXj=1

i6=j

aijxj ; i = 1; : : : ; n;

where xi is the ith component of the vector x. Let xk be the largest component of x (in absolute

value). Then, since jxj j=jxkj � 1 for j 6= k, we have from above

j�� akkj �nXj=1

j 6=k

jakjjjxjjjxkj

�nXj=1

j 6=k

jakjj:

Thus � is contained in the disk j�� akkj � rk.

De�nition 8.4.1 The disks Ri = jz � aiij � ri, i = 1; : : : ; n are called Ger�sgorin disks in the

complex plane.

Example 8.4.1

A =

0BB@1 2 3

3 4 9

1 1 1

1CCA

r1 = 5

r2 = 12

r3 = 2:

The Ger�sgorin disks are:

R1 : jz � 1j � 5

R2 : jz � 4j � 12

R3 : jz � 1j � 2:

(The eigenvalues of A are 7.3067, -0.6533 �0:3473i.)

Remark: It is clear from the above example that the Ger�sgorin �rst theorem gives only very

crude estimates of the eigenvalues.

491

Page 109: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

2

1

3R

R

R

Imag

Real

Figure 8.7 Ger�sgorin's Disks of Example 8.4.1

While the above theorem only tells us that the eigenvalues of A lie in the union of n Ger�sgorin

disks, the following theorem gives some more speci�c information. We state the theorem without

proof.

Theorem 8.4.2 (Ger�sgorin's Second Theorem) Suppose that rGer�sgorin disks

are disjoint from the rest, then exactly r eigenvalues of A lie in the union of the r

disks.

Proof. Horn and Johnson (1985, pp. 344{345).

Note: For generalizations of Ger�sgorin's theorems, see Horn and Johnson (1985) and Brualdi

(1993).

492

Page 110: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Example

A =

0BB@

1 0:1 0:2

0:2 4 0:3

0:4 0:5 8

1CCA

The Ger�sgorin disks are:

R1 : jz � 1j � 0:3

R2 : jz � 4j � 0:5

R3 : jz � 8j � 0:9

All the three disks are disjoint from each other. Therefore, by Theorem 8.4.2, each disk must

contain exactly one iegenvalue of A. This is indeed true. Note that the eigenvalues A are 0.9834,

3.9671, and 8.0495.

R 2 R 3R 1

1

Imag

Real84

Figure 8.8 Ger�sgorin's Disks for Example 8.4.2

493

Page 111: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

8.4.2 Eigenvalue Bounds and Matrix Norms

Simple matrix norms can sometimes be used to obtain useful bounds for the eigenvalues. Here are

two examples.

Theorem 8.4.3 For any consistent pair of matrix-vector norms, we have

j�j � kAk;

where � is an eigenvalue of A. In particular, �(A), the spectral radius of A, is

bounded by kAk : �(A) � kAk.

Proof. The proof follows immediately by taking the norm in

Ax = �x

k�xk = kAxk � kAk kxk

or

j�j kxk � kAk kxk;

or

j�j � kAk:

Note: For the above example, kAk1 = 13; �(A) = 7:3067.

Since the eigenvalues of AT are the same as those of A, we have

Corollary 8.4.1

�(A) � kATk:

Combining these two results and taking the in�nity norm in particular, we obtain

Theorem 8.4.4

�(A) � minfmaxi

nXj=1

jaijj; maxj

nXi=1

jaijjg:

494

Page 112: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Theorem 8.4.5 Let �1; �2; : : : ; �n be the eigenvalues of A, then

nXi=1

j�ij2 � kAk2F :

Proof. The Schur Triangularization Theorem (Theorem 8.2.3) tells us that there exists a unitary

matrix U such that

U�AU = T; an upper triangular matrix.

Thus

TT� = U

�AA

�U:

So, AA� is unitarily similar to TT �. Since similar matrices have the same traces,

Tr(TT �) = Tr(AA�) = kAk2F :

Again, Tr(TT �) =

nXi=1

nXj=1

jtijj2: Also

nXi=1

nXj=1

jtijj2 = kAk2F :

andnXi=1

jtiij2 =nXi=1

j�ij2:

Thus,

nXi=1

j�j2i =nXi=1

jtiij2 �nXi=1

nXj=1

jtijj2 = kAk2F .

8.5 Computing Selected Eigenvalues and Eigenvectors

8.5.1 Discussions on the Importance of the Largest and Smallest Eigenvalues

We have seen before that in several applications all one needs to compute is a few largest or smallest

eigenvalues and the corresponding eigenvectors. For example, recall that in the buckling problem,

it is the smallest eigenvalue that is the most important one.

In vibration analysis of structures, a common engineering practice is just to com-

pute the �rst few smallest eigenvalues (frequencies) and the corresponding eigenvectors

(modes), because it has been seen in practice that the larger eigenvalues and eigen-

vectors contribute very little to the total response of the system. The same remarks hold

in the case of control problems modeled by a system of second-order di�erential equations arising

495

Page 113: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

in the �nite-element generated reduced order model of large exible space structures (see the book

by Inman (1989)).

In statistical applications, such as in principal component analysis, only the �rst few largest

eigenvalues are computed. There are other applications where only the dominant and the subdom-

inant eigenvalues and the corresponding eigenvectors play an important role.

8.5.2 The Role of Dominant Eigenvalues and Eigenvectors in Dynamical Systems

Let's discuss brie y the role of dominant eigenvalues and the eigenvectors in the context of dynam-

ical systems.

Consider the homogeneous discrete-time system:

xk+1 = Axk; k = 0; 1; 2; : : : :

Let �1 be the dominant eigenvalue of A; that is, j�1j > j�2j � j�3j : : :� j�nj; where �1; �2; : : :�n arethe eigenvalues of A. Suppose that A has a set of independent eigenvectors: v1; v2; : : : ; vn: Then

the state xk at any time k > 0 is given by:

xk = �1�k1v1 + �2�

k2v2 + : : :+ �n�

knvn;

where x0 = �1v1 + : : :+ �nvn: Since j�1jk > j�ijk; i = 2; 3; : : : ; n; it follows that for large values of

k,

j�1�k1j � j�i�ki j; i = 2; 3; : : : ; n;

provided that �i 6= 0: This means that for large values of k, the state vector xk will approach the

direction of the vector v1 corresponding to the dominant eigenvalue �1. Furthermore, the rate at

which the state vector approaches v1 is determined by the ratio of the second to the �rst dominant

eigenvalue: j�2=�1j. (A proof will be presented later.)

In the case �1 = 0; the second dominant eigenvalue �2 and the corresponding eigenvector assume

the role of the �rst dominant eigenpair. Similar conclusions hold for the continuous-time system:

_x(t) = Ax(t):

For details, see the book by Luenberger (1979).

In summary, the long term behavior of a homogeneous dy-

namical system can essentially be predicted from just the

�rst and second dominant eigenvalues of the system matrix

and the corresponding eigenvectors.

496

Page 114: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

The second dominant eigenpair is particularly important in the case �1 = 0: In this case, the

long term behavior of the system is determined by this pair.

An Example on the Population Study

Let's take the case of a population system to illustrate this.

It is well known (see Luenberger (1979), p. 170) that such a system can be modeled by

pk+1 = Apk; k = 0; 1; 2; : : :

where pk is the population-vector. If the dominant eigenvalue �1 of the matrix A is less than 1

(that is, if j�1j < 1), then it follows from

pk = �1�k1v1 + : : :+ �n�

knvn;

that the population decreases to zero as k becomes large. Similarly, if j�1j > 1; then there is

long term growth in the population. In the latter case the original population approaches a �nal

distribution that is de�ned by the eigenvector of the dominant eigenvalue. Moreover, it is the

second dominant eigenvalue of A that determines how fast the original population distribution is

approaching the �nal distribution. Finally, if the dominant eigenvalue is 1, then over the long term

there is neither growth nor decay in the population.

8.5.3 The Power Method, The Inverse Iteration and the Rayleigh Quotient Iteration

In this section we will brie y describe two well-known classical methods for �nding the dominant

eigenvalues and the corresponding eigenvectors of a matrix. The methods are particularly suitable

for sparse matrices, because they rely on matrix vector multiplications only (and therefore, the

zero entries in a sparse matrix do not get �lled in during the process).

The Power Method

The power method is frequently used to �nd the dominant eigenvalue and the correspond-

ing eigenvector of a matrix. It is so named because it is based on implicit construction of the

powers of A.

Let the eigenvalues �1; �2; : : : ; �n of A be such that

j�1j > j�2j � j�3j � : : : � j�nj;

that is, �1 is the dominant eigenvalue of A. Let v1 be the corresponding eigenvector. Let max(g)

denote the element of maximum modulus of the vector g. Let � be the tolerance and N be the

maximum number of iterations.

497

Page 115: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Algorithm 8.5.1 Power Method

Step 1. Choose x0

Step 2. For k = 1; 2; 3; : : : do

xk = Axk�1,

xk = xk=max(xk).

Stop if (max(xk)�max(xk�1)) < � or if k > N .

Theorem 8.5.1 max(xk)! �1, and fxkg ! w1, a multiple of v1, as k !1.

Proof. From above, we have

xk =Akx0

max(Akx0)

:

Let the eigenvectors v1 through vn associated with �1; : : : ; �n be linearly independent. We can then

write x0 = �1v1 + �2v2 + : : :+ �nvn, �1 6= 0: So,

Akx0 = A

k(�1v1 + �2v2 + : : :+ �nvn)

= �1�k1v1 + �2�

k2v2 + : : :+ �n�

knvn

= �k1[�1v1 + �2

��2

�1

�kv2 + : : :+ �n

��n

�1

�kvn]:

Since �1 is the dominant eigenvalue,

��i

�1

�k! 0 as k!1; i = 2; 3; : : : ; n:

Thus,

xk =Akx0

max(Akx0)

! cv1;

and

fmax(xk)g ! �1:

Remarks: We have derived the power method under two constraints:

1. �1 6= 0

2. �1 is the only dominant eigenvalue.

498

Page 116: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

The �rst constraint (�1 6= 0) is not really a serious practical constraint, because after a few itera-

tions, round-o� errors will almost always make it happen.

As far as the second constraint is concerned, we note that the method still converges when

the matrix A has more than one dominant eigenvalue. For example, let �1 = �2 = : : : = �r and

j�1j > j�r+1j > : : : > j�nj; and let there be independent eigenvectors associated with �1. Then we

have

Akx0 = �

k1

rX

i=1

�ivi +

nXi=r+1

�i(�i=�1)kvi

!

� �k1

rX1

�ivi

(since (�i=�1)k is small for large values of k).

This shows that in this case the power method converges to some vector in the subspace spanned

by v1 : : : ; vn.

Example 8.5.1

A =

0BB@1 2 3

2 3 4

3 4 5

1CCA

x0 = (1; 1; 1)T:

The eigenvalues of A are 0, �0:6235, and 9.6235. The normalized eigenvector corresponding to the

largest eigenvalue 9.6233 is

(:3851; :5595; :7339)T:

k=1:

x1 = Ax0 =

0BB@

6

9

12

1CCA

max(x1) = 12

x1 =x1

max(x1)=

0BB@

1

2

34

1

1CCA =

0BB@0:50

0:75

1

1CCA

k=2:

x2 = Ax1 =

0BBB@5:00

7:25

9:50

1CCCA ; x2 =

0BBB@

0:5263

0:7632

1:0000

1CCCA

max(x2) = 9:50

499

Page 117: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

k=3:

x3 = Ax2 =

0BB@5:0526

7:3421

9:6316

1CCA

x3 = x3=max(x3)

=

0BB@0:5246

0:7623

1:000

1CCA

max(x3) = 9:6316:

Thus fmax(x3)g is converging towards the largest eigenvalue 9.6235 and fxkg is converging towardsthe direction of the eigenvector associated with this eigenvalue. (Note that the normalized dominant

eigenvector

0BB@0:3851

0:5595

0:7339

1CCA is a scalar multiple of x3.)

Convergence of the Power Method

The rate of convergence of the power method is determined by the ratio

�����2�1

���� , as is easily seen

from the following.

kxk � �1v1k = k�2

��2

�1

�kv2 + : : :+ �n

��n

�1

�kvnk

� j�2j�����2�1

����k

kv2k+ : : :+ j�nj�����n�1

����k

kvnk

������2�1

����k

(j�2jkv2k+ : : :+ j�nj kvnk) :

(Since j�i�1

j � j�2�1

j; i = 3; 4 : : : ; n).

Thus we have

kxk � �1v1k � �

�����2�1

����k

; k = 1; 2; 3; : : : ;

where

� = (j�2j kv2k+ : : :+ j�nj kvnk):

This shows that the rate at which xk approaches �1v1 depends upon how fast j�2�1

jk goes to zero.

The absolute value of the error at each step decreases by the ratio (�2

�1

), that is, if �2 is close to

�1, then the convergence will be very slow; if this ratio is small, the convergence will

be fast.

500

Page 118: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

The Power Method with Shift

In some cases, convergence can be signi�cantly improved by using a suitable shift. Thus, if �

is a suitable shift so that �1 � � is the dominant eigenvalue of A� �I , and if the power method is

applied to the shifted matrix A� �I , then the rate of convergence will be determined by the ratio�����2 � �

�1 � �

����, rather than�����2�1

����. (Note that by shifting the matrix A by �, the eigenvalues get

shifted by �, but the eigenvectors remain unaltered.)

By choosing � appropriately, in some cases, the ratio

�����2 � �

�1 � �

���� can be made signi�cantly smallerthan

�����2�1

����, thus yielding the faster convergence. An optimal choice (Wilkinson AEP, p. 572) of �,

assuming that �i are all real, is1

2(�1 + �n). This simple choice of � sometimes indeed yields very

fast convergence: but there are many common examples where the convergence can still be slow

with this choice of �.

Consider a 20� 20 matrix A with the eigenvalues 20; 19; : : : ; 2; 1. The choice of � =1 + 20

2=

10:5 yields the ratio

�����2 � �

�1 � �

���� = 8:5

9:5, still close to one. Therefore, the rate of convergence will still

be slow. Furthermore, the above choice of � is not useful in practice, because the eigenvalues are

not known a priori.

The Inverse Power Method/Inverse Iteration

The following iterative method, known as the inverse iteration, is an e�ective method for

computing an eigenvector when a reasonably good approximation to an eigenvalue is known.

Algorithm 8.5.2 Inverse Iteration

Let � be an approximation to a real eigenvalue �1 such that j�1��j � j�i��j(i 6= 1); that is, �

is much closer to �1 than to the other eigenvalues. Let � be the tolerance and N be the maximum

number of iterations.

Step 1. Choose x0:

Step 2. For k = 1; 2; 3; : : : ; do

(A� �I)xk = xk�1;

xk = xk=max(xk):

Stop if (kxk � xk�1k=kxkk) < � or if k > N .

Theorem 8.5.2 The sequence fxkg converges to the direction of the eigenvector

corresponding to �1.

501

Page 119: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Remark: Note that inverse iteration is simply the power method applied to (A� �I)�1. That is

why it is also known as the inverse power method.

Proof. The eigenvalues of (A��I)�1 are (�1��)�1; (�2��)�1; : : : ; (�n��)�1 and the eigenvectorsare the same as those of A. Thus, as in the case of the power method, we can write

xk =c1

(�1 � �)kv1 +

c2

(�2 � �)k: : :+

cn

(�n� �)kvn

=1

(�1 � �)k

"c1v1 + c2

��1 � �

�2 � �

�kv2 : : :+ cn

��1 � �

�n � �

�kvn

#:

Since �1 is closer to � than any other eigenvalue, the �rst term on the right hand side is the

dominating one and, therefore, xk converges to the direction of v1. It is the direction of v1 which

we are trying to compute.

An Illustration

Let us illustrate the above with k = 1. Suppose that x0 = c1v1 + c2v2 + � � �+ cnvn. Then

x1 = (A� �I)�1x0 = (�1 � �)�1c1v1 + (�2 � �)�1c2v2 + : : :+ (�n � �)�1cnvn:

Since �1 is closer to � than any other eigenvalue, the coe�cient of the �rst term in the expansion,

namely1

(�1� �), is the dominant one (it is the largest). Thus, x1 is roughly a multiple of v1,

which is what we desire.

Numerical Stability of the Inverse Iteration

At �rst sight inverse iteration seems to be a dangerous procedure, because if � is near �1, the

matrix (A � �I) is obviously ill-conditioned. Consequently, this ill-conditioning might a�ect the

computed approximations of the eigenvector. Fortunately, in practice the ill-conditioning of the

matrix (A� �I) is exactly what we want. The error at each iteration grows towards the direction

of the eigenvector, and it is the direction of the eigenvector that we are interested in.

Wilkinson (AEP pp. 620{621) has remarked that in practice xk is remarkably close

to the solution of

(A� �I + F )xk = xk�1;

where F is small. For details see Wilkinson (AEP pp. 620{621). a

a\The iterated vectors do indeed converge eventually to the eigenvectors of A+ F ."

502

Page 120: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Example 8.5.2

A =

0BB@1 2 3

2 3 4

3 4 5

1CCA

x0 = (1; 1; 1)T; � = 9:

k = 1:

x1 = (1; 1:5; 2)T

x1 = x1=kx1k2 = (:3714; :5571; :7428)T:

k = 2:

x2 = (:619; :8975; 1:1761)T

x2 = x2=kx2k2 = (:3860; :5597; :7334)T:

k = 3:

x3 = (:6176; :8974; 1:1772)T

x3 = x3=kx3k2 = (:3850; :5595; :7340):

k = 4:

x4 = (:6176; :8974; 1:1772)T

x4 = x4=kx4k2 = (:3850; :5595; :7340)T

k = 5:

x5 = (:6177; :8974; 1:1772)T

x5 = x5=k(x5)k2 = (:3851; :5595; :7339):

Remark: In the above example we have used norm k k2 as a scaling for the vector xi to empha-size that the scaling is immaterial since we are working towards the direction of the eigenvector.

Choosing the Initial Vector x0

To choose the initial vector x0 we can run a few iterations of the power method and then switch

to the inverse iteration with the last vector generated by the power method as the initial vector x0

in the inverse iteration. Wilkinson (AEP, p. 627) has stated that if x0 is assumed to be such that

Le = Px0

503

Page 121: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

where P is the permutation matrix satisfying

P (A� �I) = LU;

and e is the vector of unit elements, then only \two iterations are usually adequate", provided

that � is a good approximation to the eigenvalue.

Note: If x0 is chosen as above, then the computations of x1 involves only solution of the

triangular system:

Ux1 = e1:

Example 8.5.3

A =

0BB@1 2 3

2 3 4

3 4 5

1CCA :

The eigenvalues of A are:

0; �0:6235; and 9:6235:

Choose � = 9:1

A� �I =

0BB@�8:1 2:0 3:0

2:0 �6:1 4:0

3:0 4:0 �4:1

1CCA

L =

0BB@

1 0 0

�:2469 1 0

�:3704 �:8456 1

1CCA ; U =

0BB@�8:1 2 3

0 �5:6062 4:7407

0 0 1:0200

1CCA

P =

0BB@1 0 0

0 1 0

0 0 1

1CCA :

x0 = P�1Le =

0BB@

1:000

:7531

�:2160

1CCA :

k=1:

x1 = (A� �I)�1x0 =

0BB@:4003

:6507

:9804

1CCA

x1 = x1=max(x1) =

0BB@:4083

:6637

1:000

1CCA :

504

Page 122: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

k=2:

x2 = (1� �I)�1x1 =

0BB@

:9367

1:3540

1:7624

1CCA

x2 =

0BB@:5315

:7683

1:000

1CCA ;

which is about 1.3 times the normalized eigenvector.

The normalized eigenvector correct to four digits is

0BB@:3851

:5595

:7339

1CCA.

The Rayleigh Quotient

Theorem 8.5.3 Let A be a symmetric matrix and let x be a reasonably good

approximation to an eigenvector. Then the quotient

Rq = � =xTAx

xTx

;

is a good approximation to the eigenvalue � for which x is the corresponding eigen-

vector.

Proof. Since A is symmetric there exists a set of orthogonal eigenvectors v1; v2; : : : ; vn. Therefore

we can write

x = c1v1 + : : :+ cnvn:

Assume that vi; i = 1; : : : ; n are normalized, that is vTi vi = 1: Then, since Avi = �ivi; i = 1; : : : ; n,

and noting that vTi vj = 0; i 6= j, we have

� =xTAx

xTx

=(c1v1 + : : :+ cnvn)

TA(c1v1 + : : :+ cnvn)

(c1v1 + : : :+ cnvn)T(c1v1 + : : :+ cnvn)

=(c1v1 + : : :+ cnvn)

T (c1�1v1 + : : :+ cn�nvn)

c21 + c

22 + : : :+ c

2n

=�1c

21 + �2c

22 + : : :+ �nc

2n

c21 + c

22 + : : :+ c

2n

= �1

266641 +

��2

�1

��c2

c1

�2

+ : : :+

��n

�1

��cn

c1

�2

1 +

�c2

c1

�2

+ : : :+

�cn

c1

�237775 :

505

Page 123: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Because of our assumption that x is a good approximation to v1, c1 is larger than other ci; i =

2; : : : ; n. Thus, the expression within [ ] is close to 1, which means that � is close to �1.

De�nition 8.5.1 The quotient Rq =xTAx

xTx

is called the Rayleigh Quotient.

Example 8.5.4

A =

1 2

2 3

!:

Let

x =

1

�:5

!:

Then the Rayleigh Quotient

� =xTAx

xTx

= �:2

is a good approximation to the eigenvalue �:2361.

Note : It can be shown (exercise) that for a symmetric matrix A:

�n � Rq � �1

where �n and �1 are the smallest and the largest eigenvalue of A respectively.

Rayleigh-Quotient Iteration

The above idea of approximating an eigenvalue can be combined with inverse iteration to com-

pute successive approximations of an eigenvalue and the corresponding eigenvector in an iterative

fashion, known as Rayleigh-quotient iteration, described as follows. Let N be the maximum

number of iterations to be performed.

Algorithm 8.5.3 Rayleigh-Quotient Iteration

For k = 0; 1; 2; : : : ; do

1. Compute

�k = xTkAxk=x

Tk xk

2. Solve for xk+1 :

(A� �kI)xk+1 = xk;

3. Compute

xk+1 = xk+1=max(xk+1):

4. Stop if the pair (�k; xk) is an acceptable eigenvalue-eigenvector pair or if k > N .

506

Page 124: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Convergence: It can be shown (Wilkinson, AEP, p. 630) that the rate of convergence of the

method is cubic.

Choice of x0: As for choosing an initial vector x0, perhaps the best thing to do is to use the

direct power method itself a few times and then use the last approximation as x0.

Remark: Rayleigh Quotient iteration can also be de�ned in the nonsymmetric case, where one

�nds both left and right eigenvectors at each step. We omit the discussion of the nonsymmetric

case here and refer the reader to Wilkinson AEP, p. 636. See also Parlett (1974).

Example 8.5.5

A =

0BB@1 2 3

2 3 4

3 4 5

1CCA

Let us take

x0 =

0BB@:5246

:7622

1:000

1CCA ;

which is obtained after 3 iterations of the power method. Then

k=0:

�0 = xT0Ax0=(x

T0 x0) = 9:6235

x1 =

0BB@:5247

:7623

1:000

1CCA

k=1:

�1 = xT1Ax1=(x

T1 x1) = 9:6235

x2 =

0BB@

1:000

1:4529

1:9059

1CCA ;

The normalized eigenvector associated with 9.6255 is

0BB@:3851

:5595

:7339

1CCA.

Note that .3851 times x2 is this eigenvector to three digits. Thus two iterations were su�cient.

507

Page 125: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

8.5.4 Computing the Subdominant Eigenvalues and Eigenvectors: De ation

Once the dominant eigenvalue �1 and the corresponding eigenvector v1 have been computed, the

next dominant eigenvalue �2 can be computed by using de ation. The basic idea behind de ation

is to replace the original matrix by another matrix of the same or lesser dimension using a computed

eigenpair such that the de ated matrix has the same eigenvalues as the original one except the one

which is used to de ate.

Hotelling De ation

The Hotelling de ation is a process which replaces the original matrix A = A1 by a matrix A2

of the same order such that all the eigenvalues of A2 are the same as those of A1 except the one

which is used to construct A2 from A1.

Case 1: A is Symmetric

First suppose that A = A1 is symmetric. Let (�1; x1) be an eigenpair of A1. De�ne

A2 = A1 � �1x1xT1 ;

where xT1 x1 = 1: Then

A2xi = A1xi � �1x1xT1 xi; i = 1; 2; : : : ; n:

Since x1 is orthogonal to the other eigenvectors, and assuming xT1 x1 = 1; we have

For i = 1 :

A2x1 = A1x1 � �1x1xT1 x1 = �1x1 � �1x1 = 0 = 0:

For i 6= 1:

A2xi = A1xi � 0 = �ixi:

Thus the eigenvalues of A2 are 0; �2; �3; : : : ; �n, and x1 through xn are the corresponding eigenvec-

tors.

Case 2: A is Nonsymmetric

The idea above can be easily generalized to a nonsymmetric matrix; however, we need both

left and right eigenvectors here. Let (x1; y1) be the pair of right and left eigenvector of A = A1

corresponding to �1. Then de�ne

A2 = A1 � �1x1yT1

where

yT1 x1 = 1:

508

Page 126: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Then using the bi-orthogonality conditions of the eigenvectors xi and yi we have

For i = 1 :

A2x1 = A1x1 � �1x1yT1 x1 = �1x1 � �1x1 = 0

For i 6= 1 :

A2xi = A1xi � �1x1yT1 xi = �ixi � 0 = �ixi:

Again, we see that �1 = 0; and, �2 through �n are the eigenvalues of A2 corresponding to the

eigenvectors x1 through xn.

Remarks: Though the Hotelling de ation is commonly recom-

mended in the engineering literature as a practical process for com-

puting a selected number of eigenvalues and eigenvectors and is well-

suited for large and sparse matrices, the method both in the

symmetric and nonsymmetric cases is numerically unstable

(see Wilkinson AEP, p. 585).

Householder De ation

We will now construct a de ation using similarity transformation on A1 with Householder

matrices. Of course, the technique will work with any similarity transformation; however, we will

use Householder matrices for reasons of numerical stability.

The method is based upon the following result:

Theorem 8.5.4 Let (�1; v1) be an eigenpair of A and H be a Householder matrix such that Hv1

is a multiple of e1, then

A1 = HAH =

0BBBBB@

�1 � � : : : �0... A2

0

1CCCCCA =

0@ �1 b

T

0 A2

1A;

where A2 is (n� 1)� (n� 1), and the eigenvalues of A2 are the same as those of A except for �1; in

particular, if j�1j > j�2j � j�3j : : :� j�nj, then dominant eigenvalue of A2 is �2, which is the second

dominant (subdominant) eigenvalue of A.

509

Page 127: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Proof. From Av1 = �1v1 we have

HAHHv1 = �1Hv1 (since H2 = I):

That is, HAH(ke1) = �1ke1 (since Hv1 = ke1) or HAHe1 = �1e1. (This means that the �rst

column of HAH is �1 times the �rst column of the identity matrix.) Thus HAH must have the

form

HAH =

0BBBBB@

�1 � � � : : : �0... A2

0

1CCCCCA :

Since det(HAH��I) = �1 �det(A2��I), it follows that the eigenvalues of HAH are �1 plus (n�1)

eigenvalues of A2. Moreover, if

j�1j > j�2j > j�3j � j�4j � : : :� j�nj;

the dominant eigenvalue of A2 is �2, which is the second dominant eigenvalue of A.

Algorithm 8.5.4 Householder De ation to Compute the Subdominant Eigenvalue

1. Compute the dominant eigenvalue �1 and the corresponding eigenvector v1 using the power

method and the inverse power method.

2. Find a Householder matrix H such that

Hv1 =

0BBBBB@

�0...

0

1CCCCCA :

3. Compute HAH .

4. Discard the �rst row and the �rst column of HAH and �nd the dominant eigenvalue of the

(n� 1)� (n� 1) matrix thus obtained.

Example 8.5.6

A =

0BB@:2190 :6793 :5194

:0470 :9347 :8310

:6789 :3835 :0346

1CCA :

The eigenvalues of A are: .0018, -0.3083, 1.4947.

510

Page 128: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

1. �1 = 1:4947; v1 =

0BB@�:5552�:7039�:4430

1CCA :

2. u = v1 � kv1k2e1 =

0BB@�1:5552�0:7039�0:4430

1CCA

H = I � 2uuT

uTu

=

0BB@�:5552 �:7039 �:4430�:7039 :6814 �:2005�:4430 �:2005 �:8738

1CCA

Hv1 =

0BB@1

0

0

1CCA :

3. HAH =

0BB@1:4977 �:3223 �:3331

0 :1987 :2672

0 :3736 �:5052

1CCA =

0BBB@

1:4977 �:3223 �:33310 A2

0

1CCCA :

4. The dominant eigenvalue of A2 is �0:3083 which the subdominant eigenvalue of A.

Computing the Subdominant Eigenvector

Once the subdominant eigenvalue �2 has been computed using the above procedure, the cor-

responding eigenvector v2 can be found from the inverse iteration. We, however, show below that

this eigenvector can be computed directly from A2 without invoking inverse iteration.

Let v(2)2 be the eigenvector of A2 corresponding to �2. Then it can be shown that the eigenvector

v

(2)1 of A1 corresponding to �1 is given by

v

(2)1 =

v

(2)2

!;

where � is determined from

(�1 � �2)�+ bTv

(2)2 = 0:

Once v(2)1 is found, the subdominant eigenvector v2 of A corresponding to �2 is obtained from

v2 = Hv

(2)1 :

(Note that HAHv

(2)1 = �2v

(2)1 ).

Thus to compute the subdominant eigenvector v2 of A: Given

HAH = A1 =

0@ �1 b

T

0 A2

1A:

511

Page 129: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Algorithm 8.5.5 Computing the Subdominant Eigenvector

1. Compute the eigenvector v(2)2 of A2 corresponding to �2.

2. Compute � given by

� =bTv

(2)2

�2 � �1

:

3. Compute the eigenvector v(2)1 of A1:

v

(2)1 =

v

(2)2

!:

4. Compute the vector v2 of A:

v2 = Hv

(2)1 :

Example 8.5.7

A =

0BB@:2190 :6793 :5194

:0470 :9347 :8310

:6789 :3835 :0341

1CCA

HAH =

0BB@1:4947 �:3223 �:3333

0 :1987 :2672

0 :3736 �:5052

1CCA ; �1 = 1:4947 �2 = �:3083

bT = (�:3223 � :3331)

A2 =

:1987 :2672

�:3736 �:5052

!:

1. v(2)2 =

�:4662:8847

!

2. � =bTv

(2)2

�2 � �1

= :0801

3. v(2)1 =

0BB@

:0801

�:4662�:8847

1CCA

4. v2 = Hv

(2)1 =

0BB@�:1082�:55140:8314

1CCA :

Computing the other largest Eigenvalues and Eigenvectors

512

Page 130: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Once the pair (�2; v2) is computed, the matrix A2 can be de ated using this pair to compute

the pair (�3; v3). From the vector pair (�3; v3), we then compute the pair (�4; v4) and so on. Thus

by repeated applications of the process we can compute successively all the n eigenvalues and

eigenvectors of A.

Remarks: However, if more than a few eigenvalues are

needed, the QR iteration method to be described a little

later should be used, because in that case, the QR iteration

will be more cost-e�ective, and it is a stable method.

Computing the Smallest Eigenvalues

It is easy to see that the power method applied to A�1 gives us the smallest eigenvalue in

magnitude (the least dominant one) of A.

Let A be nonsingular and let the eigenvalues of A be ordered such that

j�1j > j�2j � j�3j � � � � j�n�1j > j�nj > 0:

Then the eigenvalues of A�1 (which are the reciprocals of the eigenvalues of A) are arranged as:���� 1�n

���� >���� 1

�n�1

���� ����� 1

�n�2

���� � � � � 1

j�1j> 0:

That is,1

�n

is the dominant eigenvalue of A�1. This suggests that the reciprocal of the smallest

eigenvalue can be computed by applying the power method to A�1.

Algorithm 8.5.6 Computing the Smallest Eigenvalue in Magnitude

1. Apply the power method to A�1.

2. Take the reciprocal of the eigenvalue obtained in step 1.

Note: Since the power method is implemented by matrix-vector multiplication only,

the inverse of A does not have to be computed explicitly. This is because computing A�1x,

where x is a vector, is equivalent to solving the linear system: Ay = x.

To compute the next least dominant eigenvalue (the second smallest eigenvalue in mag-

nitude), we compute the smallest eigenvalue and the corresponding eigenvector and then apply

de ation. The inverse power method applied to the (n� 1)� (n� 1) matrix at bottom right hand

513

Page 131: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

corner will yield the reciprocal of the second smallest eigenvalue of A. Once the required eigen-

values are computed, we can always use the inverse power method to compute the corresponding

eigenvectors or use de ation as shown earlier.

Remark: To accelerate the convergence, a suitable shift should be made.

Example 8.5.8

A =

0BB@1 4 5

2 3 3

1 1 1

1CCA :

The power method (without shift) applied to A�1 with the starting vector x0 = (1;�1; 1)T gave

� = 9:5145. Thus the smallest eigenvalue of A is:

1

= :1051:

(Note the eigenvalues of A are 6.3850, 01.4901 and .1051.)

Summary of the Process for Finding the Selected

Eigenvalues and Eigenvectors

To compute a selected number of eigenvalues (mainly the �rst few

largest or smallest eigenvalues and the corresponding eigenvec-

tors), the following combination of the power method, inverse it-

eration and de ation is recommended to be used in the following

sequences:

1. Use the power method (the power method applied to A�1)

to compute a reasonably good approximation of the largest

(smallest) eigenvalue in magnitude and of the corresponding

eigenvectors.

2. Use the inverse iteration with the approximate eigenvalue

(keeping it �xed) and the approximate eigenvector obtained

in step 1 as the starting vector.

3. Apply now de ation to compute the next set of eigenpairs.

514

Page 132: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

8.6 Similarity Transformations and Eigenvalue Computations

Recall (Theorem 8.2.2) that two similar matrices A and B have the same eigenvalues, that is, if

X is a nonsingular matrix such that

X�1AX = B;

then the eigenvalues of A are the same as those of B.

One obvious approach to compute the eigenvalues of A, therefore, will be to reduce A to a

suitable \simpler" form B by similarity so that the eigenvalues of B can be more easily computed.

However, extreme caution must be taken here. It can be shown (Golub and Van Loan MC 1984,

p. 198) that

Theorem 8.6.1 (X�1AX) = X

�1AX +E where

kEk2 � �kXk2 kX�1k2 kAk2:

Remark: Since the error matrix E clearly depends upon Cond2(X), the above

theorem tells us that in computing the eigenvalues and eigenvectors we

should avoid ill-conditioned transforming matrices to transform A by

similarity to a \simpler" form. Primarily because of this the eigenvalues of

a matrix A are not computed using the characteristic polynomial of A or by

transforming A to the Jordan Canonical form. Below we will discuss them in

some detail.

8.6.1 Eigenvalue Computations Using the Characteristic Polynomial

Why should eigenvalues not be computed via the characteristic polynomial?

Since the eigenvalues of a matrix are the zeros of the characteristic polynomial, it is natural

to think of computing the eigenvalues of A by �nding the zeros of its characteristic polynomial.

However, this approach is NOT numerically e�ective.

515

Page 133: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Di�culties with Eigenvalue Computations Using

the Characteristic Polynomial

First, the process of explicitly computing the coe�cients of the characteristic

polynomial may be numerically unstable.

Second, the zeros of the characteristic polynomial may be very sensitive to

perturbations on the coe�cients of the characteristic polynomial. Thus if the

coe�cients of the characteristic polynomial are not computed accurately, there

will be errors in the computed eigenvalues.

In Chapter 3 we illustrated the sensitivity of the root-�nding problem by means of theWilkinson-

polynomial and other examples. We will now discuss the di�culty of computing the characteristic

polynomial in some detail here.

Computing the characteristic polynomial explicitly amounts to transforming the matrix to a

block-companion (or Frobenius) form. Every matrix A can be reduced by similarity to

C =

0BB@C1 0

. . .

0 Ck

1CCA ;

where each Ci is a companion matrix. The matrix C is said to be in Frobenius form. If k = 1,

the matrix A is nonderogatory.

Assume that A is nonderogatory and let's see how A can be reduced to a companion matrix by

similarity. This can be achieved in two stages:

Reduction of a Matrix to a Companion Matrix

Stage 1: The matrix A is transformed to an unreduced Hessenberg

matrix H by orthogonal similarity using the Householder or

Givens method.

Stage 2: The transformed unreduced Hessenberg matrix H is fur-

ther reduced to a companion matrix by similarity.

516

Page 134: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

We have already seen in Chapter 5 how a nonderogatory matrix A can be transformed to an

unreduced Hessenberg matrix by orthogonal similarity in a numerically stable way using the

Householder or Given method.

Consider now stage 2, that is, the transformation of the unreduced Hessenberg matrix H to a

companion matrix C.

Let X be the nonsingular transforming matrix, that is HX = XC where

C =

0BBBBBBBB@

0 0 : � � � 0 c1

1 0 : � � � 0 c2

0 1 0 � � � 0 c3

......

.... . .

......

0 0 : � � � 0 cn

1CCCCCCCCA:

If x1; x2; : : : ; xn are the n successive columns of X , then from

HX = XC;

we have

Hxi = xi+1; i = 1; : : : ; n� 1;

and

Hxn = c1x1 + c2x2 + � � �+ cnxn:

Eliminating x2 through xn we have

�(H)x1 = 0;

where �(x) is the characteristic polynomial of C.

Since the two similar matrices have the same characteristic polynomial, we have by the Cayley-

Hamilton Theorem

�(H) = 0:

This means that x1 can be chosen arbitrarily. Once x1 is chosen, x2 through xn can be determined

by the recursion:

xi+1 = Hxi; i = 1; : : : ; n� 1:

Thus it follows that if x1 is chosen so that

X = (x1; Hx1; : : : ; Hxn�1)

is nonsingular, then X will transform H to C by similarity.

517

Page 135: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Choose x1 = (1; 0; : : : ; 0), then the matrix

X = (x1; Hx1; : : : ; Hxn�1) =

0BBBBBBBB@

1 � � � � � �0 h21 � � � � �0 0 h21h32 �...

.... . .

. . ....

0 0 0 0 h21h32 � � �hn;n�1

1CCCCCCCCA

is nonsingular because hi+1;i 6= 0; i = 1; : : : ; n� 1.

So, if one or more subdiagonal entries hi+1;i of H are signi�cantly small, then the

inverse of X will have large entries and consequently X will be ill-conditioned. Thus in

such a case the transformation of an unreduced Hessenberg matrix H to a companion matrix will

be unstable

Thus, the �rst stage, in which A is transformed to H using the House-

holder or the Givens method, is numerically stable, while the second

stage, in which H is further reduced to C, can be highly unstable.

Example.

H =

0BB@

1 2 3

0:0001 1 1

0 2 3

1CCA

x1 = (1; 0; 0)T; x2 = Hx1 = (1; 0:0001; 0)T;

x3 = Hx2 = (1:0002; 0:0002; 0:0002)T;

X =

0BB@1 1 1:0002

0 0:0001 0:0002

0 0 0:0002

1CCA

X�1AX = C =

0BB@0 0 1

1 0 �4:99980 1 5

1CCA

Cond2(X) = 3:1326� 104:

(Note that the existence of a small subdiagonal entry of H ; namely h21, made the transforming

matrix X ill-conditioned.)

518

Page 136: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

There are also other equivalent methods for reducing H to C. For example, Wilkinson, (AEP,

p. 406) describes a pivoting method for transforming an unreduced Hessenberg matrix H to a

companion matrix C using Gaussian elimination, which also shows that small subdiagonal entries

can make the method highly unstable. The subdiagonal entries are used as pivots and we have seen

before that small pivots can be dangerous.

Note that there are other approaches for �nding the characteristic polynomial of a matrix. For

example, LeVerrier's method (Wilkinson, AEP pp. 434{435) computes the coe�cients of the

characteristic polynomial using the traces of the various powers of A. Here Wilkinson has shown

that in LeVerrier's method, severe cancellation can take place while computing the

coe�cients from the traces using Newton's sums. The Newton's sums determining the

coe�cients ci; i = 0; : : : ; n, of the characteristic polynomial

det(A� �I) = �n + cn�1�

n�1+ � � �+ c1�+ c0;

are given by

cn�1 = �trace(A);

kcn�k = �(trace(Ak) + cn�1trace(Ak�1) + � � �+ cn�k+1trace(A));

k = 2; : : : ; n:

For details, see (Wilkinson AEP, p. 434).

Having emphasized the danger of using the Frobenius form in the eigenvalue-computations of

a matrix, let's point out some remarks of Wilkinson about Frobenius forms of matrices arising in

certain applications such as mechanical and electrical systems.

\Although we have made it clear that we regard the use of the Frobenius form as

dangerous, in that it may well be catastrophically worse-conditioned than the original

matrix, we have found the program based on its use surprisingly satisfactory in general

for matrices arising from damped mechanical or electrical systems. It is common for

the corresponding characteristic polynomial to be well-conditioned. When this is true

methods based on the use of the explicit characteristic polynomial are both fast and

accurate."

Quotation from Wilkinson

AEP p. 482

519

Page 137: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Remarks: The above remarks of Wilkinson clearly support a long tradition by engineers of

computing the eigenvalues via the characteristic polynomial.

8.6.2 Eigenvalue Computations via Jordan-Canonical Form

Let us now discuss the use of some other suitable canonical forms in eigenvalue computations. In

this connection, of course, the Jordan-Canonical Form is the one that comes to mind �rst. Recall

(Theorem 8.2.10) that given an n � n matrix A, there exists a nonsingular matrix X such that

X�1AX = diag(J1; : : : ; Jk);

where

Ji =

0BBBBB@

�i 1 0. . .

. . .

. . . 1

0 �i

1CCCCCA :

If Ji is of order �i, then

�1 + �2 + : : :+ �k = n:

The matrix on the right hand side is the Jordan Canonical Form (JCF) ofA, �i's are the eigenvalues.

Thus, the eigenvalues of A are displayed as soon as the JCF is computed.

Unfortunately, this computation can also be highly unstable.

Whenever A is close to a nondiagonalizable matrix, the

transforming matrix X will very ill-conditioned (see Golub

and Van Loan MC 1984, pp. 196{197). It then follows from

Theorem 8.6.1 that the computed JCF in that case will be inaccurate.

8.6.3 Hyman's Method

Before we leave this section, we wish to point out that there is a method for implicitly evaluating

the characteristic polynomial of a Hessenberg matrix and its derivative at a certain given point,

without explicitly computing the coe�cients of the characteristic polynomial. This method, known

as Hyman's method, can in turn be used in a root-�nding procedure (such as Newton's method) to

compute a zero of the characteristic polynomial, and hence an eigenvalue of the associated matrix.

Let H = (hij) be an unreduced upper Hessenberg matrix. Set pn(�) = 1.

520

Page 138: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Compute pn�1(�) through p1(�) using the recurrence:

pi(�) =

26666664

0@ nXj=i+1

hi+1;jpj(�)� �pi+1(�)

1A

hi+1;i

37777775; i = n� 1; : : : ; 1:

Then the characteristic polynomial det(A� �I) of A is given by

det(H � �I) = h21h32 � � �hn;n�1

0@ nX

j=1

hijpj(�)� �p1(�)

1A:

Wilkinson (AEP, p. 429) has shown that Hyman's method has favorable numerical properties.

Thus Hyman's method can be combined with Newton's method for �nding the zeros of a polynomial

to obtain an isolated eigenvalue of a matrix. However, if all the eigenvalues are needed, one

should use the QR iteration method to be described later.

8.7 Eigenvalue Sensitivity

In the previous two sections we have cautioned the readers about the danger of computing the

eigenvalue via Jordan Canonical Form or the Frobenius form of a matrix. The danger was mainly

the possibility of the transforming matrix X being ill-conditioned.

In this section we will see now what speci�c role the condition number of the transforming

matrix: Cond(X) = kXk � kX�1k, plays in the eigenvalue-sensitivity. We have illustrated the

eigenvalue-sensitivity phenomenon by means of some examples in Chapter 3. Here is a more speci�c

result, known as the Bauer-Fike Theorem, on the eigenvalue sensitivity of a diagonalizable

matrix.

8.7.1 The Bauer-Fike Theorem

Theorem 8.7.1 Let A be diagonalizable, that is, the Jordan Canonical Form of A

is a diagonal matrix D. Then for an eigenvalue � of A+ E, we have

min j�i � �j � kXk kX�1k kEk;

where k k is a subordinate matrix norm, and �1; �2; : : : ; �n are the eigenvalues of A.

Proof. Consider two cases:

521

Page 139: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Case 1: � = �i for some i. The theorem is trivially true.

Case 2: � 6= �i for any i. Then the diagonal entries of the diagonal matrix �I �D are di�erent

from zero. Since the determinant of a matrix is equal to the product of its eigenvalues, the matrix

(�I �D) is nonsingular. Now from

(A+E)x = �x

we have

Ex = (�I �A)x

= (�I �XDX�1)x (Note that A = XDX

�1:)

= X(�I �D)X�1x:

Set X�1x = y. Then from the last equation, we have, by multiplying the equation by X

�1 to the

left

(�I �D)y = X�1Ex

or

y = (�I �D)�1X�1EXy (note that x = Xy).

Taking a subordinate norm on both sides, we have

kyk = k(�I �D)�1X�1EXyk

� k(�I �D)�1k kX�1kkEk kXk kyk:

Dividing both sides by y, we get

1 � k(�I �D)�1k kX�1kkEk kXk:

Now for a subordinate norm,

k(�I �D)�1k = maxi

�1

�� �i

=1

mini(�� �i)

:

So,

1 � 1

mini(�� �i)

kX�1k kXk kEk:

or,

min(�� �i) � kX�1k kXk kEk:

522

Page 140: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Implications of the Theorem

The above theorem tells us that if

Cond(X) = kXk�1 kX�1k

is large, then an eigenvalue � of the perturbed matrix A+E

can be signi�cantly di�erent from an eigenvalue �i of A. In

general, the more ill-conditioned the eigenvector matrix X

is, the more ill-conditioned will be the eigenproblem for A.

Remark: In case A is not diagonalizable, a similar result also holds. (For details, see Golub

and Van Loan, MC 1984 p. 209.)

Example 8.7.1

A =

0BB@1 �0:2113 0:0957

0 2 �0:07560 0 3

1CCA

X = 105

0BB@0 �0:2113 :1705

0 1 �1:06360 0 1:2147

1CCA

X�1AX = diag(1; 2; 3):

The eigenvalues of A are: 1, 2, 3

E = 10�4

0BB@1 0 0

0 1 0

0 0 1

1CCA

A+E =

0BB@1:0011 �0:2113 0:0957

0 2:0001 �0:87560 0 3:0001

1CCA :

The eigenvalues of A+ E are:

1:0001; 2:0001 3:001

Cond2(X) = 1:8294� 105

523

Page 141: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

kEk2 = 10�4

Cond2(X) � kEk2 = 18:2936:

8.7.2 Sensitivity of the Individual Eigenvalues

The condition number kXk kX�1k gives an overall assessment of the changes in eigenvalues withrespect to changes in the coe�cient of the matrix. However, as we have seen from the examples

in Chapter 3, some eigenvalues of A may be more sensitive than the others. In fact, some may

be very well-conditioned while others are ill-conditioned. Similarly, some eigenvectors may be

well-conditioned while others are not.

It is therefore more appropriate to talk about conditioning of the individual eigenvalues, rather

than conditioning of the eigenvalue problem. Recall that in Chapter 3 an analysis of the ill-

conditioning of the individual eigenvalues of the slightly perturbed Wilkinson-matrix was given in

terms of the numbers si. In general, this can be done for any diagonalizable matrix.

Let X�1AX = diag(�1; : : : ; �n). Then the normalized right-hand and left-hand eigenvectors

corresponding to an eigenvalue �i are given by

xi =Xei

kXeik2; yi =

(X�1)Tei

k(X�1)Teik2:

De�nition 8.7.1 The number1

si

, where si is de�ned by

si = yTi xi

is called the condition number of the eigenvalue �i.

If this number is large then �i is an ill-conditioned eigenvalue. This typically happens when A

is close to a matrix having some nonlinear elementary divisors (see Wilkinson, AEP

p. 183).

Notes:

1. There are n condition numbers associated with the n eigenvalues of A.

2. If xi and yi are real, then si is the cosine of the angle between xi and yi.

Example 8.7.2

A =

0BB@1 2 3

0 0:999 1

0 0 2

1CCA

524

Page 142: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

x1 = (1; 0; 0)T

x2 = (1;�0:005; 0)T

x3 = (:9623; :1923; :1925)T

y1 = (0:0004; :7066;�0:7076)T

y2 = (0;�0:7075; :7068)T

y3 = (0; 0; 1)T

s1 = yT1 x1 = 3:5329� 10�4

s2 = yT2 x2 = 3:5373� 10�4

s3 = yT3 x3 = :1925:

Thus, the above computations clearly show that �1 = 1; �2 = :999 are ill-conditioned, while �3 = 2

is well-conditioned.

Indeed, when a(3; 1) was perturbed to 0.000001 and the eigenvalues of the perturbed matrix

were computed, the �rst two eigenvalues of the perturbed matrix (those corresponding to 1 and

of the .999 of the original matrix) become complex. The computed eigenvalues of the perturbed

matrix were (to three digits):

0:999 + 0:001i; 0:999� 0:001i; and 2:

For yet another nontrivial example, see exercise #23.

A Relationship Between si and Cond(X)

It is easy to see that the condition numbers si and Cond2(X) with respect to the 2-norm are

related.

si = jyTi xij =jeTi X�1

XeijkXeik2k(X�1)Teik2

=1

kXeik2k(X�1)Teik2:

Now

kXeik2 � kXk2keik2 = kXk2;

and

k(X�1)Teik2 � k(X�1)Tk2keik2

= k(X�1)Tk2 = kX�1k2:

525

Page 143: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

So,1

si

� kXk2kX�1k2 = Cond2(X):

Thus, for each i,1

si

� Cond2(X):

Example 8.7.3

A =

0BB@1 2 3

0 0:999 1

0 0 2

1CCA

1

s1

= 2:8305� 103

1

s2

= 2:8270� 103

1

s3

= 5:1940:

Cond2(X) = 6:9603� 103:

Thus,1

si

< Cond2(X); i = 1; 2; 3:

The Condition Numbers and Linear Dependence of Eigenvectors

Since for a diagonalizable matrix the columns of the matrix X are the eigenvectors of A,

Cond2(X) gives us an indication of how linearly independent the eigenvectors are:

If Cond2(X) is large it means that the eigenvectors are

nearly dependent.

For the above matrix A, the matrix of eigenvectors is:

X =

0BB@�0:4675 + :8840i �0:4675� :8840i 0:9623

�0:0005� 0:0005i �0:0005+ 0:0005i 0:1923

0:0000� 0:0000i 0:0000+ 0:000i 0:1925

1CCA :

Note the linear dependence of the �rst two eigenvectors.

Cond2(X) = 2:5965� 103:

526

Page 144: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

The Eigenvalue-Sensitivity of a Normal Matrix

A matrix A is called normal if

AA� = A

�A;

where A� = ( �A)T : A Hermitian matrix is normal. Normal matrices are diagonalizable.

A remarkable property of a normal matrix A is that if X is the transforming matrix that transform

A to a diagonal matrix, thus

Cond2(X) = 1:

Thus an immediate consequence of the Bauer-Fike theorem is:

Corollary to the Bauer-Fike Theorem: Let A be a normal matrix, and �1; : : : ; �n be the

eigenvalues of A. Then for an eigenvalue � of A+E we have

min j�i � �j � kEk2:

Eigenvalue Sensitivity of a Normal Matrix

In other words, the eigenvalues of a normal matrix are per-

fectly well-conditioned.

Remark: The normal matrices most commonly found in practical applications are symmetric (or

Hermitian, if complex) matrices. Thus, by the Corollary above, the eigenvalues of a symmet-

ric (or Hermitian) matrix are well-conditioned. We will discuss the symmetric eigenvalue

problem in more detail in Section 8.11.

8.8 Eigenvector Sensitivity

We shall not go into details in this discussion on the sensitivity of eigenvectors. We will just state

a theorem (in somewhat crude form) that will highlight the main di�erences between eigenvalue

and eigenvector sensitivities. For an exact statement and proof, see Watkins (FMC pp. 332{333).

527

Page 145: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Theorem 8.8.1 Let �A be a very small perturbation of A and let the eigenvalue

�k of A be perturbed by ��k; that is �k + ��k is an eigenvalue of A + �A: Let

xk + �xk be the eigenvector corresponding to �k + ��k. Then, assuming that the

eigenvalues of A are all distinct, we have

xk + �xk = xk +Xj 6=k

�jk

(�k � �j)sjxj + 0(k�Ak2);

where

�jk = y�

j (�A)xj:

Implications of the theorem

The above theorem tells us that if A is perturbed by a small amount, then the amount

of perturbation an eigenvector xk experiences is determined by

1. condition numbers of all the eigenvalues other than �k, and

2. the distance of �k from the other eigenvalues.

An immediate consequence of this theorem is that if there is a multiple eigenvalue or

an eigenvalue near another eigenvalue, then there are some ill-conditioned eigenvec-

tors. This is signi�cant especially for a Hermitian or a symmetric matrix, because we know that

the eigenvalues of a Hermitian matrix are all well-conditioned, but the eigenvectors

could be ill-conditioned. If the eigenvalues are well-separated and well-conditioned, then the

eigenvectors are well-conditioned.

Example 8.8.1

A =

0BB@1 0 0

0 :99 0

0 0 2

1CCA

A0 = A+�A =

0BB@

1 :0001 0

:0001 :99 0

0 0 2

1CCA :

The eigenvalues ofA+�A are 1, .99, 2. (No change, sinceA is symmetric the eigenvalues are

well-conditioned.) However, the eigenvectors of A0 are

0BB@

�1�0:010

1CCA,0BB@:01

�10

1CCA and

0BB@0

0

1

1CCA while those

528

Page 146: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

of A are

0BB@1

0

0

1CCA ;

0BB@0

1

0

1CCA and

0BB@0

0

1

1CCA. Note that the eigenvector corresponding to �3 = 2 has

not changed; while the other two eigenvectors have changed; because of the proximity

of the eigenvalues 1 and .99.

8.9 The Real Schur Form and QR Iterations

In the preceding discussions we have seen that computing eigenvalues of A via reduction of A to

the Frobenius or to the Jordan Canonical Form is not numerically e�ective. If the transforming

matrix is ill-conditioned, then there may be large errors in the computed canonical form and this

in turn will introduce large errors in the eigenvalues.

A question therefore arises as to whether we can obtain a similarity reduction of

A to a suitable canonical form using a well-conditioned transforming matrix.

A perfectly well-conditioned matrix, for example, is an orthogonal matrix (or unitary, if it is

complex) the condition number (with respect to 2-norm and F-norm) of such a matrix, being 1.

Indeed, if a matrix A is transformed to a matrix B using unitary similarity trans-

formation, then a perturbation in A will result in a perturbation in B of the same

magnitude. That is, if

B = U�AU

and

U�(A+�A)U = B + �B;

then

k�Bk2 � k�Ak2:

Example 8.9.1

A =

0BB@1 2 3

3 4 5

6 7 8

1CCA ; U =

0BB@�:5774 �:5774 �:5774�:5774 :7887 �:2113�:5774 �:2113 :7887

1CCA

B =

0BB@

13 �:6340 �2:3660�:9019 0 0

�6:0981 0 0

1CCA

�A = 10�5 � I3�3

A1 = A+�A =

0BB@1:00001 2 3

3 4:00001 5

6 7 8:00001

1CCA

529

Page 147: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

B1 = U�(A+ �A)U =

0BB@13:00001 �:633974 �2:3660�:9019 :00001 0

�6:0981 0 0:00001

1CCA

�B = B1 � B = 10�5 � I3�3

k�Ak = k�Bk = 10�5:

A perfect canonical form displaying the eigenvalues is a triangular form (the diagonal entries

are the eigenvalues). In this context we now recall a classical result due to Schur (Theorem 8.2.3).

We restate this important result below and give a proof.

Theorem 8.9.1 (The Schur Triangularization Theorem; restatement of

Theorem 8.2.3) If A is an n�n matrix, then there exists a unitary matrix U such

that

U�AU = T

where T is a triangular matrix with the eigenvalues �1; �2; : : : ; �n as the diagonal

entries.

Proof. We will prove the theorem using induction on n.

If n = 1; the theorem is trivially true. Next assume the theorem is true for n = k � 1, then we

will show that it is also true for n = k:

Let u be a normalized eigenvector of A associated with an eigenvalue �1. De�ne

U1 = (u; V );

where V is k � k � 1 and is unitary. Then U1 is unitary; and,

A1 = U�

1AU1 =

0BBBBBB@

�1 � � �0... A

0

1CCCCCCA;

where A is (k� 1)� (k� 1). By our hypothesis there exists unitary matrix V1 of order (k� 1) such

that

T = V�

1 (A)V1

530

Page 148: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

is triangular. Then, de�ning

U2 =

0BBBBBB@

1 0 � � � 0

0

... V1

0

1CCCCCCA;

we see that U2 is unitary (because V1 is so), and

U�

2A1U2 = U�

2U�

1AU1U2

= U�AU

So,

U�AU =

0BBBBBB@

�1 � � � � �0

... V�

1 AV2 = T

0

1CCCCCCA:

Since T is triangular, so is U�AU: Since the eigenvalues of a triangular matrix appear on the

diagonal, we are done.

Since a real matrix can have complex eigenvalues (occurring in complex conjugate pairs), even

for a real matrix A, U and T in the Schur Theorem above can be complex. However, we can choose

U to be real orthogonal if T is replaced by a quasi-triangular matrix R, known as the Real Schur

Form of A (RSF).

Theorem 8.9.2 (The Real Schur Triangularization Theorem) Let A be an

n� n real matrix. Then there exists an n� n orthogonal matrix Q such that

QTAQ = R =

0BBBBB@

R11 R12 � � � R1k

0 R22 � � � R2k

.... . .

...

0 0 � � � Rkk

1CCCCCA

where each Rii is either a scalar or a 2 � 2 matrix. The scalars diagonal entries

correspond to real eigenvalues and 2 � 2 matrices on the diagonal correspond to

complex conjugate eigenvalues.

531

Page 149: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Proof. The proof is similar to Theorem 8.9.1.

De�nition 8.9.1 The matrix R in Theorem 8.9.2 is known as the Real Schur Form (RSF) of

A.

Notes:

1. The 2� 2 matrices on the diagonal are usually referred to as \bumps".

2. The columns of Q are called Schur vectors. For each k(1 � k � n), the �rst k columnsof Q form an orthonormal basis for the invariant subspace corresponding to the

�rst k eigenvalues.

Remark: Since the proofs of both the theorems are based on the knowledge of eigenvalues

and eigenvectors of the matrix A, they can not be considered to be constructive. They do not help

us in computing the eigenvalues and eigenvectors.

We present below a method known as the QR iteration method, for computing the Real-Schur

form of A. A properly implemented QR-method is widely used nowadays for computing

the eigenvalues of an arbitrary matrix. As the name suggests, the method is based on the

QR factorization and is iterative in nature. The QR iteration method was proposed in algorithmic

form by J. G. Francis (1961), though its roots can be traced to a work of Rutishauser (1958). The

method was also independently discovered by the Russian mathematician Kublanovskaya (1961).

Note: Since the eigenvalues of a matrix A are the n zeros of the char-

acteristic polynomial and it is well-known (proved by Galois more

than a century ago) that the roots of a polynomial equation of

degree higher than four cannot be found in a �nite number

of steps, any numerical eigenvalue-method for an arbitrary matrix

has to be iterative in nature.

8.9.1 The Basic QR Iteration

We �rst present the basic QR iteration method.

Set A0 = A:

532

Page 150: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Compute now a sequence of matrices (Ak) de�ned by

A0 = Q0R0

A1 = R0Q0 = Q1R1

A2 = R1Q1 = Q2R2;

and so on. In general,

Ak = QkRk = Rk�1Qk�1 k = 1; 2; : : :

The matrices in the sequence fAkg have a very interesting property. Each matrix in the se-

quence is orthogonally similar to the previous one and is therefore orthogonally similar

to the original matrix. It is easy to see this. For example,

A1 = R0Q0 = QT0A0Q0(sinceQ

T0A0 = R0)

A2 = R1Q1 = QT1A1Q1:

Thus A1 is orthogonally similar to A, and A2 is orthogonally similar to A1. Therefore, A2 is

orthogonally similar to A, as the following computation shows:

A2 = QT1A1Q1 = Q

T1 (Q

T0A0Q0)Q1 = (Q0Q1)

TA0(Q0Q1):

Since each matrix is orthogonally similar to the original matrix A, and therefore, has the same

eigenvalues as A; then if the sequence fAkg converges to a triangular or quasi-triangular matrix,

we will be done. The following result shows that under certain conditions, indeed this happens (see

Wilkinson AEP, pp. 518{519).

A Condition for Convergence

Theorem 8.9.3 (A Convergence Theorem for Basic QR Iteration) Let the

eigenvalues �1; : : : ; �n be such that j�1j > j�2j > : : : > j�nj; and let the eigenvector

matrix X of the left eigenvectors (that is, X�1) be such that its leading principal

minors are nonzero. Then fAkg converges to an upper triangular matrix or to the

Real Schur Form.

In fact, it can be shown that under the above conditions, the �rst column of Ak approaches a

multiple of e1. Thus, for su�ciently large k we get

Ak =

0BB@�1 u

0 Ak

1CCA :

533

Page 151: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

We can apply the QR iteration again to Ak and the process can be continued to see that the

sequence converges to an upper triangular matrix.

Example 8.9.2

A =

1 2

3 4

!:

Eigenvalues of A are: 5.3723, and -0.3723. j�1j > j�2j.

k=0:

A0 = A = Q0R0

Q0 =

�0:3162 �0:9487�0:9487 0:3162

!

R0 =

�3:1623 �4:4272

0 �0:6325

!:

k=1:

A1 = R0Q0 =

5:2 1:6

:6 �:2

!= Q1R1

Q1 =

�0:9934 �0:1146�0:1146 �:9934

!

R1 =

�5:2345 �1:5665

0 �0:3821

!:

k=2:

A2 = R1Q1 =

5:3796 �0:9562�0:0438 �0:3796

!= Q2R2:

(Note that we have already made some progress towards obtaining the eigenval-

ues.)

Q2 =

�1 �0:0082

�0:0081 1

!

R2 =

�5:3797 0:9593

0 �0:3718

!:

k=3:

A3 = R2Q2 =

5:3718 1:0030

0:0030 �0:3718

!= Q3R3

Q3 =

1 �0:0006

�0:0006 1

!

R3 =

�5:3718 �1:0028

0 �0:3723

!:

534

Page 152: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

k=4:

A4 = R3Q3 =

5:3723 �0:9998�0:0002 �0:3723

!:

8.9.2 The Hessenberg QR Iteration

The QR iteration method as presented above is not e�cient if the matrix A is full and dense. We

have seen before that the QR factorization of such a matrix A requires 0(n3) ops and thus n

iterations of QR method will require 0(n4) ops, making the method impractical.

Fortunately, something simple can be done:

Reduce the matrix A to a Hessenberg matrix by orthogonal

similarity before starting the QR iterations. An interesting

practical consequence of this is that if A = A0 is initially reduced to

an upper Hessenberg matrix and is assumed to be unreduced, then

each member of the sequence fAkg is also upper Hessenberg.

This can be seen as follows:

Suppose Ak is an unreduced upper Hessenberg matrix, and Givens rotations are used to factorize

Ak into QkRk. Then

Qk = J(2; 1; �)J(3; 2; �) � � �J(n; n� 1; �)

is also upper Hessenberg.

Thus, since Rk is upper triangular, Ak+1 = RkQk is also upper Hessenberg.

Since the QR factorization of a Hessenberg matrix requires only 0(n2) ops, the QR iteration

method with the initial reduction of A to Hessenberg will be bounded by 0(n3), making the method

e�cient.

Example 8.9.3

A = A0 =

0BB@

0:2190 �0:5651 �0:6418�0:6805 0:1226 0:4398

�0:0000 0:8872 0:8466

1CCA

Q0 =

0BB@�0:3063 �0:4676 0:8291

0:9519 �0:1505 0:2668

0:0000 0:8710 0:4913

1CCA ; R0 =

0BB@�0:7149 0:2898 0:6152

0:0000 1:0186 0:9714

�0:0000 0 0:0011

1CCA :

535

Page 153: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

k=1:

A1 = R0Q0 =

0BB@0:4949 0:8265 �0:21320:9697 0:6928 0:7490

0:0000 0:0010 0:0006

1CCA

Q1 =

0BB@0:4546 �0:8907 �0:00210:8907 0:4546 0:0011

0:0000 �0:0023 1:0000

1CCA ; R1 =

0BB@1:0886 0:9928 0:5702

0:0000 �0:4213 0:5303

0:0000 �0:0000 0:0018

1CCA :

k=2:

A2 = R1Q1 =

0BB@

1:3792 �0:5197 0:5690

�0:3752 �0:1927 0:5299

�0:0000 �0:0000 0:0018

1CCA

Q2 =

0BB@

0:9649 0:2625 �0:0000�0:2625 0:9649 �0:0000�0:0000 0:0000 1:0000

1CCA ; R2 =

0BB@1:4293 �0:4509 0:4099

0 �0:3224 0:6607

0 0 0:0018

1CCA :

(Note that each Qi and each Ai is upper Hessenberg.)

8.9.3 Convergence of the QR Iterations and the Shift of Origin

Once it is known that the QR iteration method can be made e�cient by initial reduction of A

to a Hessenberg matrix, it is natural to wonder about the rate of convergence of the iterations.

By rate of convergence we mean how fast the subdiagonal entries of the transformed

Hessenberg matrix converge to zero.

Let A be initially reduced to an upper Hessenberg matrix H and the QR iteration is performed

on H to obtain the sequence Hk. Then it can be shown (Golub and Van Loan, MC 1984 p. 228)

that the subdiagonal entry h(k)i;i�1 of Hk converges to zero at a rate determined by the ratio

���� �i�i�1

����k

:

Thus, the rate of convergence will be very slow if the moduli of two eigenvalues �i and

�i�1 are very close to each other.

Fortunately, the rate of convergence can signi�cantly be improved by shifting the

origin.

Let �i be an approximation of an eigenvalue �i of H . Let the QR iteration be applied to the

matrix

H = H � �iI:

536

Page 154: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

The eigenvalues of H are �i � �i; �2� �i; : : : ; �n� �i: Let these eigenvalues be ordered so that

j�1 � �ij � j�2 � �ij � � � � � j�n � �ij:

Then, in this case, the ith subdiagonal entry of Hk will converge to zero at a rate determined by

the ratio ���� �i � �i

�i�1 � �i

����k

;

rather than by the ratio j �i�i�1

jk: The former is usually smaller than the latter.

Consider the convincing example from Ortega and Poole (INMD, p. 227).

Let �i = :99; �i�1 = 1:1; �i = 1: Then

���� �i � �i

�i�1 � �i

���� = :1

while ���� �i�i�1

���� = :9:

This observation tells us that if we apply the QR iteration to the shifted matrix H rather than

to the original matrix H , then the rate of convergence will be faster. Of course, once an eigenvalue

of H is found, the corresponding eigenvalue of H can be computed just by adding the shift back.

8.9.4 The Single-Shift QR Iteration

The above argument suggests the following modi�ed QR iteration method, known as the single-

shift QR iteration method.

1. Transform A to an upper Hessenberg matrix H .

2. Set H0 = H .

For k = 0; 1; 2; : : : do until h(k)n;n�1 becomes computationally zero.

Hk � h(k)nnI = QkRk,

Hk+1 = RkQk + h(k)nnI .

In the above h(k)ij denotes the (i; j)th entry of Hk. Of course, each of the matrices fHkg

can overwrite by H.

To implement the single shift QR iteration, we need to have an approximate value �i of the

eigenvalue �i. Experimentally it has been observed that if we let the unshifted QR iteration (the

537

Page 155: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Basic QR) run for a few iterations (say s), then h(s)nn can be taken as a reasonably good approximation

to an eigenvalue. Thus starting with h(s)nn as a shift, we can continue the iterations using the (n; n)th

element of the current matrix as the next shift.

Convergence: The rate of convergence of the single-shift QR iteration method is ultimately

cubic to the eigenvalue of minimum modulus (see Wilkinson AEP, pp. 548{549).

Remark: An implicit version of the single shift iteration known as the implicit QR iteration,

can be worked out, where one does not subtract the shifts but implicitly constructs the matrix

Hk+1. This is explained in the exercise #29.

Example 8.9.4 Single-shift QR Iteration

H = H0 =

0BB@1 1 1

1 2 3

0 1 1

1CCA :

k=0:

H0 � h

(0)33 I =

0BB@0 1 1

1 1 3

0 1 0

1CCA = Q0R0

Q0 =

0BB@

0 0:7071 �0:7071�1 0 0

0 0:7071 0:7071

1CCA

R0 =

0BB@�1:0000 �1:0000 �3:000

0 0:4142 0:7071

0 0 �0:7071

1CCA

H1 = R0Q0 + h

(0)33 I =

0BB@

2:000 �2:8284 �1:4142�1:4142 1:5000 0:5000

0 �0:5000 0:5000

1CCA :

k=1:

H1 � h

(1)33 I = Q1R1

Q1 =

0BB@�0:7276 �0:6342 �0:26150:6860 �0:6727 �0:2774

0 �0:3812 0:9245

1CCA

R1 =

0BB@�2:0616 2:7440 1:3720

0 1:3117 0:5606

0 0 0:2311

1CCA

538

Page 156: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

H2 = R1Q1 + h

(1)33 I =

0BB@3:8824 �1:0613 1:0464

0:8998 �0:5960 0:1544

0 �0:0881 0:7137

1CCA :

k=2:

H2 � h

(2)33 I = Q2R2

Q2 =

0BB@�0:9620 0:2721 0:0247

�0:2732 �0:9580 �0:08700 �0:0905 0:9959

1CCA

R2 =

0BB@�3:2940 1:3787 �1:0488

0 0:9740 0:1367

0 0 0:0124

1CCA

H3 = R2Q2 + h

(2)33 I =

0BB@

3:5057 �2:1221 �1:2459�0:2661 �0:2318 �:0514

0 �0:0011 0:7260

1CCA :

k=3:

H3 � h

(3)33 I = Q3R3

Q3 =

0BB@�0:9955 �0:0953 �0:00010:0953 �0:9955 �0:0010

0 �0:0010 1:000

1CCA

R3 =

0BB@�2:7924 2:0212 1:2451

0 1:1556 0:0675

0 0 0:0001

1CCA

H4 = R3Q3 + h

(3)33 I =

0BB@3:6983 �1:7472 1:2434

0:1101 �0:4244 0:0664

0 0:0000 0:7261

1CCA :

The iteration is clearly converging towards the eigenvalue .7261. (The eigenvalues of H , in four

digit arithmetic, are: :7261; 3:6511;�0:3772:)

8.9.5 The Double-Shift QR Iteration

If the desired eigenvalue is real, the above single-shift QR iteration works well. However, a real

matrix can have complex eigenvalues. In such a case:

i) at some stage of iteration, we could encounter a trailing 2�2 submatrix on the bottom right-hand

corner corresponding to a complex conjugate pair of eigenvalues, if there are any,

539

Page 157: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

ii) the (n; n)th entry of the trailing 2� 2 matrix, which is real, will not be a good approximation,

iii) it is natural to use the eigenvalues of that 2 � 2 matrix as shift parameters yielding the

double-shift QR iteration.

One Iteration-step of the Double-Shift QR (Complex)

Let the eigenvalues of the 2 � 2 bottom right hand corner of the Hessenberg matrix Hs be k1

and k2 = k1. Then one iteration-step of the double-shift QR iteration is:

Hs � k1I = QsRs; Hs+1 = RsQs + k1I

Hs+1 � k2I = Qs+1Rs+1; Hs+2 = Rs+1Qs+1 + k2I:

Example 8.9.5

H0 = H =

0BB@1 2 2

0 0 1

0 �1 0

1CCA :

k1 = i; k2 = �i:

H0 � kiI = Q0R0 :

Q0 =

0BB@�1 0 0

0 �:7071 �0:7071i0 :7071i :7071

1CCA

R0 =

0BB@�1 + i �2 �2

0 1:4142i �1:41420 0 0

1CCA

H1 = R0Q0 + k1I =

0BB@1 1:4142� 1:4142i �1:4142 + 1:4142i

0 �i 0

0 0 i

1CCA

H1 � k2I = Q1R1 :

Q1 =

0BB@�1 0 0

0 �:9124 �:2717i0 :2717i :9624

1CCA

R1 =

0BB@�1 � i �1:4142 + 1:4142i 1:4142� 1:4142i

0 0 :5434

0 0 1:9248

1CCA

H2 = R1Q1 + k2I =

0BB@1 1:7453� :9717i 1:7453� :9717i

0 �:8523i :5230

0 �:5230 :8523i

1CCA :

540

Page 158: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Note that the eigenvalues of the 2 � 2 bottom right hand corner matrix

�:8523i :5230

�:5230 :8523i

!

are �i and i.

Thus the eigenvalues of H2 are 1; i and �i.

Avoiding Complex Arithmetic in Double-Shift QR Iteration

Since k1 and k2 are complex, the above double-shift QR iteration step will require complex

arithmetic for implementation, even though the starting matrix Hs is real. However, with a little

manipulation complex arithmetic can be avoided. We will discuss this aspect now.

We will show that the matrix Hs+2 is orthogonally similar to Hs through a real

transforming matrix, and can be formed directly from Hs without computing Hs+1.

Consider the matrix

N = (Hs � k2I)(Hs � k1I) = H2s � (k1 + k2)Hs + k1k2I:

Since k2 = k1; the matrix N is real. Next, we show that (QsQs+1)(Rs+1Rs) is the QR factorization

of N .

N = (Hs � k2I)(Hs � k1I)

= (Hs � k2I)QsRs

= QsQ�

s(Hs � k2I)QsRs

= Qs(Hs+1 � k2I)Rs = QsQs+1Rs+1Rs:

Since N is real and (QsQs+1)(Rs+1Rs) is the QR factorization of N , the matrix QsQs+1 can be

chosen to be real.

Finally, we show that Hs+2 is orthogonally similar to Hs through this real transforming matrix

QsQs+1.

Hs+2 = Rs+1Qs+1 + k2I

= Q�

s+1(Hs+1 � k2I)Qs+1 + k2I

= Q�

s+1(RsQs + (k1 � k2)I)Qs+1 + k2I

= Q�

s+1[Q�

s(Hs � k1I)Qs + (k1 � k2)I ]Qs+1+ k2I

= Q�

s+1Q�

sHsQsQs+1

= (QsQs+1)�Hs(QsQs+1):

Since QsQs+1 and Hs are real, Hs+2 is also real.

From the above discussions we conclude that it is possible to obtain Hs+2 directly from Hs

through real orthogonal transformations.

541

Page 159: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Eigenvalues k1 and k2 need not be computed explicitly

Though computing the eigenvalues of a 2� 2 matrix is almost a trivial job, we note that k1 and

k2 need not be computed explicitly. To form the matrix

N = (Hs � k1I)(Hs � k2I) = H2s � (k1 + k2)Hs + k1k2I;

all we need to compute is the trace and the determinant of the 2� 2 matrix.

Let hn�1;n�1 hn�1;n

hn;n�1 hnn

!

be the 2� 2 right hand corner matrix of the current matrix Hs: Then

t = k1 + k2 = sum of the eigenvalues = trace = hn�1;n�1+ hnn is real;

d = k1k2 = product of the eigenvalues = determinant =hn�1;n�1hnn � hn;n�1hn�1;n is real:

This allows us to write the one-step of double-shift QR iteration in real arithmetic as follows:

One Step of Double Shift QR Iteration (Real Arithmetic)

1. Form the matrix N = H2s � tHs + dI .

2. Find the QR factorization of N : N = QR.

3. Form Hs+2 = QTHsQ.

We will call the above computation Explicit Double Shift QR iteration for reasons to be

stated in the next section.

Example 8.9.6

H = H0 =

0BB@1 2 3

1 0 1

0 �2 2

1CCA

t = 2; d = 2:

N = H2 � tH + dI =

0BB@

3 �8 5

�1 2 3

�2 0 0

1CCA :

542

Page 160: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Find the QR Factorization of N :

Q =

0BB@�:8018 �:5470 �:2408:2673 :0322 �0:9631:5345 �0:8365 0:1204

1CCA

H2 = QTH0Q =

0BB@�:8571 1:1007 2:5740

�1:1867 3:0455 �0:82890:0000 1:8437 0:8116

1CCA :

8.9.6 Implicit QR Iteration

After all this, we note, with utter disappointment, that the above double-shift (explicit) QR iter-

ation is not practical. The reason for this is that forming the matrix N itself in step 1 requires

0(n3) ops. Fortunately, a little trick again allows us to implement the step in 0(n2) ops.

One Iteration of the Double-Shift Implicit QR

1. Compute the 1st column n1 of the matrix N .

2. Find a Householder matrix P0 such that P0n1 is a multiple of e1.

3. Form H0

s = PT0 HsP0.

4. Transform H0

s to an upper Hessenberg matrix by orthogonal similarity

using Householder matrices:

(PTn�2 � � �PT

2 PT1 )H

0

s(P1P2 � � �Pn�2) = H0

s+2:

Using the implicit Q-theorem (Theorem 5.4.3) we can show that the matrix Hs+2

of the explicit QR and H 0

s+2of the implicit QR are both unreduced upper Hessenberg

and are essentially the same matrix.

The above four steps constitute one iteration of the double-shift implicit QR. To under-

stand how these four steps can be implemented in 0(n2) ops, we must give a close look into the

structures of the above computations.

First, since Hs is Hessenberg, computing the 1st column of N = (Hs�k1I)(Hs�k2I) is almost

trivial. It contains only three nonzero elements. They can be written down explicitly.

543

Page 161: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Let

Ne1 = n1 =

0BBBBBBBBBBB@

n11

n21

n31

0...

0

1CCCCCCCCCCCA;

then

n11 = h211 � th11 + d+ h12h21

n21 = h21(h11 + h22 � t)

n31 = h21h32:

Here hij refers to the (ij)th entry of Hs. Second, because only three elements of n1 are nonzero,

the Householder matrix P0 has the form

P0 =

P0 0

0 In�3

!;

where P0 is a 3� 3 Householder matrix. Because of this form of P0, and Hs being Hessenberg, the

matrix H0

s = P0HsP0 is not a full matrix. It is a Hessenberg matrix with a bulge. For example,

when n = 6, we have

H0

s = P0HsP0 =

0BBBBBBBBBBB@

� � � � � �0 � � � � �0 � � � � �0 � � � � �0 0 0 � � �0 0 0 0 � �

1CCCCCCCCCCCA:

A bulge will be created at each step of the reduction of Hs to Hessenberg form and the constructions

of Householder matrices P1 through Pn�2 amount to chasing these bulges systematically.

Each Pk; k = 1; 2; : : : ; n� 3 has the form

Pk =

0BB@Ik 0

Pk

0 In�k�3

1CCA ;

where Pk is a 3� 3 Householder matrix. The last Householder matrix Pn�2 has the form

Pn�2 =

In�2 0

0 Pn�2

!:

544

Page 162: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Taking into consideration the above structures of computations, it can be shown that

one step of the implicit QR iteration requires only o(n2) ops.

For details of this 0(n2) computations of one iteration of the double-shifted implicit QR, see the

book by Stewart (IMC pp. 375{378) and the recent book by Watkins (FMC, pp. 277{278).

Algorithm 8.9.1 One Iteration-Step of the Double-Shift Implicit QR

Let H be an n � n unreduced upper Hessenberg matrix. Then the following algorithm,

which constitutes one step of the double-shift implicit QR iteration, produces orthogonal matrices

P0; P1; : : : ; Pn�2 such that

QTHQ; where Q = P0P1; : : : ; Pn�2;

is an unreduced upper Hessenberg matrix. The algorithm overwrites H with QTHQ.

1. Compute the shifts:

t = hn�1;n�1 + hnn

d = hn�1;n�1hnn � hn;n�1hn�1;n:

2. Compute the 1st three nonzero entries of the 1st column of N = H2 � tH + dI :

x = n11 = h211 � th11 + d+ h12h21

y = n21 = h21(h11 + h12 � t)

z = h32 = h21h32:

3. Compute the Householder matrices P0P1 : : :Pn�2 such that the �nal matrix is upper Hessen-

berg.

For k = 0; 1; 2; : : : ; n� 3 do.

(a) Find a 3� 3 Householder matrix Pk such that

Pk

0BB@x

y

z

1CCA =

0BB@�0

0

1CCA :

Form

Pk =

0BB@Ik 0

Pk

0 In�k�3

1CCA :

545

Page 163: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Form PTk HPk and overwrite with H :

H � PTk HPk:

Update x; y and z:

x � hk+2;k+1

y � hk+3;k+1

z � hk+4;k+1 (if k < n� 3):

(b) Find a Householder matrix Pn�2 of order 2 such that

Pn�2

x

y

!=

�0

!:

Form

Pn�2 =

In�2 0

0 Pn�2

!:

Flop-count. One step of the double-shift implicit QR iteration takes about 6n2 ops. If the

transferring matrix Q is needed and accumulated, then another 6n2 ops will be needed (see Golub

and Van Loan MC 1983, p. 234).

Example 8.9.7 1. t = 2; d = 2; H =

0BB@1 2 3

1 0 1

0 �2 2

1CCA

2. x = n11 = 3; y = n21 = �1; z = n31 = �2

3. k = 0:

P0 = I � 2uuT

uTu

;where u =

0BB@

3

�1�2

1CCA

P0 =

0BB@�:8018 :2673 :5345

:2673 :9604 �0:0793:5345 �:0793 0:8414

1CCA

H = PT0 HP0 =

0BB@�:8571 �2:6248 �0:9733:0581 0:8666 1:9505

1:1852 �0:7221 2:9906

1CCA :

Update x and y:

546

Page 164: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

x = h21 = :0581 y = h31 = 1:1852

Find P1:

P1 =

0:0490 �0:9988�0:9988 0:0490

!; P1

x

y

!=

�1:1866

0

!;

P1 =

0BB@1 0 0

0 0:0490 �0:99880 �0:9988 0:0490

1CCA ;

H = PT1 HP1 =

0BB@�0:8571 1:1008 2:5739

�1:1867 3:0456 �0:82900 1:8436 0:8116

1CCA :

Note that the matrix H obtained by the implicit QR is the same as H2 obtained earlier

in section 8.9.5 by the explicit QR. (Example 8.9.6)

8.9.7 Obtaining the Real Schur Form A

1. Transform the matrix A to Hessenberg form.

2. Iterate with the implicit double step QR method.

Typically, after two to three steps of the doubly-shift implicit QR iteration, one or two

(and sometime more) subdiagonal entries from the bottom of the Hessenberg matrix

converge to zero.

This then will give us a real or pair of complex conjugate eigenvalues. Once a real or a

pair of complex conjugate eigenvalues is computed, the last row and the last column in

the �rst case, or the last two rows and the last two columns in the second case, can be

deleted and computation of the other eigenvalues can be continued with the submatrix.

This process is also known as de ation.

Note that the eigenvalues of the de ated submatrix are also the eigenvalues of the

original matrix. For, suppose immediately before de ation, the matrix has the form:

Hk =

A0

C0

0 B0

!;

where B0 is the 2 � 2 trailing submatrix or is a 1 � 1 matrix. Then the characteristic

equation of Hk:

det(�I �Hk) = det(�I � A0) det(�I �B

0):

547

Page 165: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Thus, the eigenvalues of Hk are the eigenvalues of A0 together with those of B0. But Hk

is orthogonally similar to the original matrix A and therefore has the same eigenvalues

as A.

When to Accept a Subdiagonal Entry as Zero

A major decision that we have to make during the iteration procedure is when to accept

a subdiagonal entry as zero so that the matrix can be de ated. It seems that there are

no clear-cut conventions here; however, we have given a commonly used criterion above.

For a good discussion on this matter, see the book \The Symmetric Eigenvalue Problem"

by B. N. Parlett (1980).

Accept a subdiagonal entry hi;i�1 to be zero if

jhi;i�1j � �(jhiij+ jhi�1;i�1j):

Example 8.9.8 Find the Real Schur Form of

H =

266641 2 3

1 0 1

0 �2 2

37775 :

Iteration h21

1 �1:18672 0.3543

3 0.0129

4 0.0000

The RSF is 26664�1:1663 �1:3326 �2:0531

0 1:2384 1:6659

0 �1:9409 2:9279

37775 :

The eigenvalues of the 2� 2 right-hand lower corner submatrix are 2:0832� 1:5874i.

Beresford Parlett is a professor of mathematics at the University of California at Berkeley. He has made some

outstanding contributions in the area of numerical matrix eigenvalue problem, especially for large and sparse problems.

His book \The Symmetric Eigenvalue Problem" is an authoritative book in this area."

548

Page 166: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Example 8.9.9 Find the Real Schur Form of

h =

26666664

0:2190 �0:0756 0:6787 �0:6391�0:9615 0:9032 �0:4571 0:8804

0 �0:3822 0:4526 �0:06410 0 �0:1069 �0:0252

37777775

Iteration h21 h32 h43

1 0.3860 �0:5084 �0:00842 �0:0672 �0:3773 0.0001

3 0.0089 �0:3673 0

4 �0:0011 �0:3590 0

5 0.0001 �0:3905 0

.

The RSF is

h =

26666664

1.4095 0.7632 �0:1996 0.8394

0.0001 0.1922 0.5792 0.0494

0 �0:3905 0.0243 �0:40890 0 0 �0:0763

37777775:

The eigenvalues of

24 0:1922 0:5792

�0:3905 0:0243

35 are 0:1082� 0:4681i.

Balancing

As in the process of solving linear system problems, it is advisable to balance the entries of the

original matrix A, if they vary widely, before starting the QR iterations.

The balancing is equivalent to transforming the matrix A to D�1AD, where the diagonal matrix

D is chosen so that a norm of each row is approximately equal to the norm of the corresponding

column.

The EISPACK routine BALANC that balances the entries of the matrix A is applied to A

before the other routines are used to compute the eigenvalues.

In general, preprocessing the matrix by balancing improves the accuracy of the QR iteration

method. Note that no round-o� error is involved in this computation and it takes only 0(n2) ops.

Flop-count. Since QR iteration method is an iterative method, it is hard to give an exact

op-count for this method. However, empirical observations have established that it takes about two

549

Page 167: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

QR iterations per eigenvalue. Thus, it will require about 8n3 ops to compute all the eigenvalues

(Golub and Van Loan, MC 1984 p. 235). If the transforming matrix Q and the �nal quasitriangular

matrix T are also needed, then the cost will be about 15n3 ops.

Round-o� Property

The QR iteration method is quite stable. An analysis of the round-o� property of the

algorithm shows that the computed real Schur form (RSF) is orthogonally similar to a nearby

matrix A+ E, where

kEkF � �(n)�kAkF

�(n) is a slowly growing function of n. The computed orthogonal matrix Q is also orthogonal.

8.9.8 The Real Schur Form and Invariant Subspaces

De�nition 8.9.2 Let S be a subspace of the complex plane C n. Then S will be called an invariant

subspace (with respect to premultiplication by A) if x 2 S implies that Ax 2 S.

Thus, since

Ax = �x

for each eigenvalue �, each eigenvector is an invariant subspace of dimension 1 associated with the

corresponding eigenvalue.

The Real Schur Form of A displays information on the invariant subspaces.

Basis of an Invariant Subspace from RSF

Let

QTAQ = R =

R11 R12

0 R22

!

and let us assume that R11 and R22 do not have eigenvalues in com-

mon. Then the �rst p columns of Q, where p is the order

of R11, forms a basis for the invariant subspace associated

with the eigenvalues of R11.

In many applications, such as in the solution of algebraic Riccati equations (see Laub (1979)),

one needs to compute the orthonormal bases of an invariant subspace associated with a selected

550

Page 168: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

number of eigenvalues. Unfortunately, the transformed Real Schur Form obtained by QR iteration

may not give the eigenvalues in some desired order. Thus, if the eigenvalues are not in a desired

order, one wonders if some extra work can be done to bring them into that order. That this can

indeed be done is seen from the following simple discussion. Let A be 2� 2.

Let

QT1AQ1 =

�1 r12

0 �2

!; �1 6= �2:

If �1 and �2 are not in right order, all we need to do to reverse the order is to form a Givens rotation

J(1; 2; �) such that

J(1; 2; �)

r12

�2 � �1

!=

�0

!:

Then Q = Q1J(1; 2; �)T is such that

QTAQ =

�2 r12

0 �1

!:

Example 8.9.10

A =

1 2

2 3

!

Q1 =

:8507 :5257

�:5257 :8507

!

QT1AQ1 =

�0:2361 0:0000

0:0000 4:2361

!

J(1; 2; �) =

0 �1�1 0

!

J(1; 2; �)

0

�4:4722

!=

4:4722

0

!

Q = Q1J(1; 2; �)T =

�0:5257 �0:8507�0:8507 0:5257

!

QTAQ =

4:2361 0:00

0:00 �0:2361

!:

The above simple process can be easily extended to achieve any desired ordering of the eigenvalues

in the Real Schur Form. For details see (Golub and Van Loan, MC 1984 p. 241).

The process is quite inexpensive. It requires only k(8n) ops, where k is the number of inter-

changes required to achieve the desired order. Stewart (1976) has provided useful Fortran routines

for such an ordering of the eigenvalues.

551

Page 169: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

8.10 Computing the Eigenvectors

8.10.1 The Hessenberg-Inverse Iteration

As soon as an eigenvalue � is computed by QR iteration, we can invoke inverse iteration (algo-

rithm 8.5.2) to compute the corresponding eigenvector. However, since A is initially reduced to a

Hessenberg matrix H for the QR iteration, it is natural to take advantage of the structure of the

Hessenberg matrix H in the solutions of the linear system that need to be solved in the process of

inverse iteration. Thus the Hessenberg-Inverse iteration can be stated as follows:

Algorithm 8.10.1 The Hessenberg-Inverse Iteration

1. Reduce the matrix A to an upper Hessenberg matrix H :

PTAP = H:

2. Compute an eigenvalue �; whose eigenvector x is sought, using the implicit QR iteration.

3. Apply the inverse iteration

For k = 1; 2; : : : do

Solve (H � �I)z(k) = y(k�1)

y(k) = z

(k)=max(z(k)):

Stop if k(y(k) � y(k�1))=y(k)k < � or if k > N , the maximum number of iterations.

4. Recover the eigenvector x:

x = Py(k);

where y(k) is the approximation of the eigenvector y obtained from Step 3.

Note: From Ax = �x we have

PTAPPx = �Px

or

Hy = �y:

That is,

x = Py:

552

Page 170: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

8.10.2 Calculating the Eigenvectors from the Real Schur Form

The eigenvectors can also be calculated directly from the Real Schur Form without invoking the

inverse iteration. The process is described as follows:

Let A be transformed to the RSF T by the implicit QR iteration:

Q�AQ = T:

Then Ax = �x can be written as

Q�AQQ

�x = �Q

�x:

That is, writing Q�x = y, we have

Ty = �y:

Thus, after A has been transformed to the RSF T , an eigenvector x corresponding to an eigenvalue

� can be computed as follows:

1. Solve the homogeneous triangular system Ty = �y.

2. Compute x = Qy:

We now show how the solution of Ty = �y can be simpli�ed assuming that T is triangular and

that all the eigenvalues of A (that is, the diagonal entries of T ) are distinct.

Let � = tkk: That is we are trying to �nd a y such that

(T � tkkI)y = 0:

Write

T � tkkI =

T11 T12

0 T22

!;

where T11 is k � k. Partition y accordingly:

y =

y1

y2

!;

where y1 has k-entries. Then

(T � tkkI)y = 0

gives T11 T12

0 T22

! y1

y2

!= 0

that is,

T11 y1 + T12 y2 = 0; T22 y2 = 0:

553

Page 171: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Now, T22 is nonsingular, because its diagonal entries are tjj � tkk; j = k + 1; : : : ; n; which are

di�erent from zero. So, the homogeneous system

T22y2 = 0

has only the trivial solution y2 = 0. From above, we have

T11y1 = 0:

Since the ith diagonal entry of T11 is zero, T11 is singular; therefore, y1 6= 0: Again, note that T11

has the form

T11 =

0@ T11 s

0 0

1A;

where T11 is (k � 1)� (k � 1) and nonsingular. Thus T11y1 = 0 reduces to

T11y1 + sz = 0;

where

y1 =

y1

z

!;

z can be chosen to be any nonzero number. Since T11 is upper triangular, y1 can be computed by

back substitution.

Algorithm 8.10.2 Computing an Eigenvector Directly from the RSF

1. Transform A to RSF by the implicit QR iteration:

Q�AQ = T

(Assume that T is triangular and that the diagonal entries of T are di�erent.)

2. Select the eigenvalue � = tkk whose eigenvector x is to be computed:

3. Partition

(T � tkkI) =

T11 T12

0 T22

!:

4. Partition

T11 =

T11 s

0 0

!:

5. Solve by back substitution:

T11y1 = �sz;

choosing z as a nonzero number.

554

Page 172: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

6. Form y1 =

y1

z

!:

7. Form y =

y1

0

!:

8. Compute x = Qy:

Example 8.10.1

A =

0BB@1 1 1

2 3 4

4 6 7

1CCA

T =

0BB@10:8998 2:5145 2:7563

0 0:3571 :2829

0 0 �0:2569

1CCA

Q =

0BB@�:1358 �:9606 �:2423�:4747 :2778 �:8352�:8696 �:0016 :4937

1CCA :

Suppose we want to compute the eigenvector corresponding to � = t22 = :3571: Then

T11 =

10:5428 2:5145

0 0

!:

T11 = 10:5428

s = 2:5145

Choose z = 1

y1 = �(T11)�1sz = �:2385

y1 =

y1

z

!=

�:2385

1

!:

Choose y2 = 1. Then

y =

y1

y2

!=

0BB@�:2385

1

0

1CCA

x = Qy =

0BB@�0:92830:3910

0:2058

1CCA :

555

Page 173: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

It is easily veri�ed that

Ax =

0BB@�0:33150:1396

0:0734

1CCA

and

�2x =

0BB@�0:33150:1396

0:0734

1CCA :

8.11 The Symmetric Eigenvalue Problem

The QR iteration can, of course, be applied to �nd the eigenvalues of a symmetric matrix. Indeed,

in the symmetric case the method simpli�es to a large extent. We will discuss below the symmetric

QR iteration brie y. However, since the eigenvalues and eigenvectors of a symmetric matrix enjoy

certain special remarkable properties over those of the nonsymmetric case, some special methods

exploiting these properties can be developed for the symmetric problem. One such method is based

on the Sturm sequence property of the characteristic polynomial of the matrix.

Some Special Properties

A. The eigenvalues of a real symmetric matrix are real. The eigenvectors associated with

the distinct eigenvalues are orthogonal (Theorem 8.2.5).

B.

The Real Schur form of a real symmetric matrix is a diag-

onal matrix.

Proof. >From the Real Schur Triangularization Theorem (Theorem

8.9.2) we have

QTAQ = R

where R is in Real Schur Form, that is, R is a triangular matrix

with each diagonal entry as either a scalar or a 2� 2 matrix. Now,

each 2� 2 matrix on the diagonal corresponds to a pair of complex

conjugate eigenvalues. Since a real symmetric matrix cannot have a

complex eigenvalue, it follows that R can not have a 2� 2 matrix on

the diagonal; therefore R is a diagonal matrix.

C. General Perturbation Property.

556

Page 174: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Let A be a n � n real symmetric matrix. Let A0 = A + E; where E is a real symmetric

perturbation of the matrix A, and let �1 � �2 � � � � � �n and �0

1 � �0

2 � � � � �0

n be the

eigenvalues of A and A0, respectively. Then it follows from the Bauer-Fike Theorem (Theorem

8.7.1) that

�i � kEk2 � �0

i � �i + kEk2; i = 1; 2; : : : ; n:

This result is remarkable.

Perturbation Result on the Eigenvalues of a Symmetric

Matrix

The eigenvalues of a real symmetric matrix are well-

conditioned, that is, small changes in the elements of A cause only

small changes in the eigenvalues of A. In fact, since

kEk2 = maxflargest and smallest of the eigenvalues of Eg;

then the eigenvalues of the perturbed matrix A0cannot di�er

from the eigenvalues of the original matrix A by more than

the largest eigenvalue of the perturbated matrix E. (See also

the corollary of the Bauer-Fike Theorem given earlier.) (Section

8.7.2)

Example 8.11.1

A =

0BB@1 2 3

2 3 4

3 4 6

1CCA ; E = 10�4 � I3�3:

The eigenvalues of A are �0:4203, 0.2336, and 10.1867. The eigenvalues of A+E are �0:4203,.2337, 10.1868. Note that kEk2 = 10�4.

D. Rank-one Perturbation Property.

In this section we state a theorem that shows how are the eigenvalues shifted if E is a rank-one

perturbation. The result plays an important role in the divide and conquer algorithm

(Dongarra and Sorensen (1987)) for the symmetric eigenvalue problem.

557

Page 175: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Eigenvalues of a Rank-One Perturbed Matrix

Theorem 8.11.1 Suppose B = A+ �bbT , where A is an n � n symmetric matrix,

� is a scalar and b is an n-vector. Let �1 � �2 � ::: � �n be the eigenvalues of A

and �0

1 � : : : � �0

n be the eigenvalues of B. Then

�0

i 2 [�i; �i�1]; i = 2; :::; n; if � � 0;

�0

i 2 [�i+1; �i]; i = 1; :::; n� 1; if � < 0;

Proof. See Wilkinson APE, pp. 97-98.

Example 8.11.2

A =

0BB@1 2 3

2 4 5

3 5 6

1CCA ; � = �1; b = (1; 2; 3)T:

The eigenvalues of B are: �0

3 = �3:3028; �02 = 0; �0

1 = 0:3023. The eigenvalues of A are:

�3 = �0:5157; �2 = 0:1709; �1 = 11:3443. It is easily veri�ed that �2 < �0

1 < �1; and �3 < �0

2 < �2:

8.11.1 The Sturm Sequence and the Bisection Method

In this section we describe a method to �nd the eigenvalues of a symmetric matrix. The method

is particularly useful if eigenvalues are required in an interval. In principle, it can be used to

�nd all eigenvalues. However, in practice, if all the eigenvalues are required explicitly,

the symmetric QR iteration method is preferred over the method of this section for

matrices of moderate sizes.

First, the symmetric matrix A is transformed to a symmetric tridiagonal matrix T using House-

holder's method described earlier:

PAPT = T =

0BBBBBBBBBBB@

�1 �1

�1 �2 �2 0. . .

. . .. . .

. . .. . .

. . .

0 �n�2 �n�1 �n�1

�n�1 �n

1CCCCCCCCCCCA:

558

Page 176: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Let pi(�) denote the characteristic polynomial of the i � i principal submatrix of T . Then these

polynomials satisfy a three term recursion:

pi(�) = (�i � �)pi�1(�)� �2i�1pi�2(�); i = 2; 3; : : : ; n

with

p0(�) = 1 and p1(�) = �1 � �:

Without loss of generality, we may assume that �i 6= 0; i = 1; 2; : : : ; n � 1: Recall that the

matrix T with this property is called unreduced. If a subdiagonal entry of T is zero, then T is a

block diagonal and its eigenproblem can thus be reduced to that of its submatrices. For unreduced

symmetric tridiagonal matrix T , the following interlacing property is very important.

Theorem 8.11.2 (Interlacing property) Let T be an unreduced symmetric

tridiagonal matrix and �

(k)i the ith smallest eigenvalue of its k � k principle sub-

matrix. Then

(k+1)1 < �

(k)1 < �

(k+1)2 < � � � < �

(k+1)i < �

(k)i < �

(k+1)i+1 < � � � < �

(k+1)

k < �

(k)

k < �

(k+1)

k+1 :

(See Golub and Van Loan, MC 1989 p. 438.)

We shall show that this interlacing property leads to an interesting result on the number of

eigenvalues of T.

It is clear that pk(�) = (�1)k�k+� � �. Thus pk(�) is positive if � is negative with large magnitude.The zeros �

(k)1 < �

(k)2 < � � � < �

(k)

k of pk separate the real line into k + 1 intervals

(�1; �

(k)1 ); (�

(k)1 ; �

(k)2 ); : : : ; (�

(k)

k�1; �(k)

k ); (�(k)

k ;1):

pk(�) is positive in the �rst interval and takes alternative signs in consecutive intervals. The

interlacing property and the sign changes of pk(�) can be illustrated in the following �gure.

559

Page 177: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

------

----

-----

--

-----

++

++++

+

++++

+++++

+

+

+

+

+

+

++

+

+

+

++

+

+

+

+

++++++++++

5

4

3

2

1

0

p

p

p

p

p

p

(λ)

(λ)

(λ)

(λ)

(λ)

(λ)

Let � be a real number. There are two cases for the signs of p0(�) and p1(�):

---+++

++++++

Case 2: signs agreeCase 1: no sign agreement

(1)

µ

(1)

µ

- - -+++

++++++

1

0

p

p

(λ)

(λ)

Clearly, a sign agreement between p0(�) and p1(�) \pushes" �(1)1 to the right of �. By interlacing

property, this implies

� < �

(1)1 < �

(2)2 < � � � < �

(n)n :

Thus, it \pushes" one eigenvalue �(n)n of A (or T ), as well as one eigenvalue of each k�k submatrix,to the right of �.

Suppose we have counted the sign agreements between consecutive two terms of p0(�); p1(�); : : : ; pk(�).

Let's consider the signs of pk(�) and pk+1(�) and interlacing property:

560

Page 178: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

i+1ii-1

(k+1)(k+1)(k+1)

(k)

ii-1

(k)λλ

λλ

-

µ

-++(λ)

kp

λ

++

-+ +--+k+1

Case 1: no sign agreement

+p (λ)

Case 2: signs agree

i+1ii-1

(k+1)(k+1)(k+1)

(k)

ii-1

(k)λλ

λλ

-

µ

-++(λ)

kp

λ

++

-+ +--+k+1

+p (λ)

Let � be between �(k)i�1 and �

(k)i . It is clear from the above �gure that a sign agreement between

pk(�) and pk+1(�) \pushes" �k+1i to the right of �, or it means that pk+1 has one more zeros than

pk in [�;1).

There is no zero of p0 in [�;1). We know the number of zeros of p1 in [�;1) by the sign

agreement or disagreement of p0(�) and p1(�). Generally, when we know the number of zeros of

pk in [�;1), then we know the number of zeros of pk+1 in [�;1) by checking the sign agreement

between pk(�) and pk+1(�). This recursion can be continued until we know the number of zeros of

pn, i.e., the number eigenvalues of T . The rule is clear:

The number of sign agreements between consecutive terms

of p0(�); p1(�); : : : ; pn(�) equals to the number of eigenvalues

of T larger than �.

Note : It is also clear that pk+1(�) = 0 should be considered an sign agreement with

pk(�) because one more zero is \pushed" into [�;1).

Example 8.11.3 Let

T =

0BB@2 1 0

1 2 1

0 1 2

1CCA :

561

Page 179: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

p0(�) = 1; p1(�) = 2� �;

p2(�) = (2� �)2 � 1

p3(�) = (2� �)p2(�)� p1(�)

= (2� �)[(2� �)2� 1]� (2� �)

= (2� �)3 � 2(2� �):

Let � = 0.

Then the sequence p0; p1(�); p2(�) and p3(�) is 1, 2, 3, 4. There are three agreements in sign.

Thus all the eigenvalues of T are greater than or equal to zero. In fact, since p3(0) = 4 6= 0,

it follows that all the eigenvalues of T are positive. The eigenvalues of T are easily seen to be

2; 2 +p2; 2�

p2:

Let � = 2 then, the sequence p0(�); p1(�); p2(�); and p3(�) is:

1; 0;�1; 0:

We count the agreements in sign of

+ + ��

There are two agreements; con�rming that T has two eigenvalues greater than or equal to 2.

The Sturm-sequence and Bisection method for computing a speci�ed zero of pn(�) now can be

stated as follows:

Algorithm 8.11.1 The Sturm Sequence { Bisection Algorithm

Let �1 < �2 < � � � < �n be the eigenvalues of T , that is, the zeros of pn(�). Suppose the desired

eigenvalue is �n�m+1 for a given m � n. Then

I. Find an interval [s1; s2] containing �n�m+1: Since �i � kTk, initially, we can take

s1 = �kTk1; s2 = kTk1:

II. Compute s3 =s1 + s2

3.

III. Compute N(s3) = the number of agreements in sign in the sequence

1; p1(s3); p2(s3); : : : ; pn(s3):

If N(s3) < m, set s2 = s3 otherwise, set s1 = s3.

Let � > 0 be a preassigned small positive number. Test if js2 � s1j < �. If so accept s3 =s1 + s2

2as an approximate value of �n�m+1. Otherwise go to II.

562

Page 180: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Note: After k steps, the desired zero is located in an interval of width(s2 � s1)

2k.

Example 8.11.4 Let

A =

0BB@2 1 0

1 2 1

0 1 2

1CCA :

Suppose we want to approximate �1 = 2�p2

m = 3:

Iteration 0. Initially,

s1 = �4; s2 = 4

s3 = 0

N(s3) = N(0) = 3:

Set s1 = s3:

Iteration 1.

s1 = 0; s2 = 4

s3 =0 + 4

2= 2

N(s3) = N(2) = 2 < 3:

Set s2 = s3

Iteration 2.

s1 = 0; s2 = 2; s3 =0 + 2

2= 1

N(s3) = number of agreements of sign in the sequence:

1;�1; 0;�1:

(+���)

N(s3) = 2 < 3

Set s2 = s3:

Iteration 3.

s1 = 0; s2 = 1; s3 = :5

N(s3) = 3:

Set s1 = s3:

563

Page 181: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

The eigenvalue �1 is clearly in the interval [:5; 1], which is, in fact, the case. We can continue

our iterations until the length of the interval js2 � s1j < �:

8.11.2 The Symmetric QR Iteration Method

When A is symmetric, the transformed Hessenberg matrix PAPT = H is also symmetric; therefore,

it is symmetric tridiagonal. So, in this case we have to deal with the eigenvalue problem of a

symmetric tridiagonal matrix rather than of a Hessenberg matrix.

To apply the QR iteration method to a symmetric tridiagonal matrix, we note that, if the

starting matrix is a symmetric tridiagonal matrix T , then so is each matrix Tk in the sequence

Tk � �kI = QkRk

and, furthermore, we need only 0(n) ops to generate each Tk (note that the QR factorization of a

symmetric tridiagonal matrix requires only 0(n) ops). Thus, the symmetric QR iteration is

much more e�cient than the nonsymmetric case.

Also, since the eigenvalues of a symmetric matrix are all real and the Real Schur Form of a

symmetric matrix is a diagonal rather than triangular matrix, the double-shift strategy discussed

for the general eigenvalue problem is not needed in this case. However, in this case a popular shift,

known as the Wilkinson-shift, is normally used.

Instead of taking the (n; n)th entry at every iteration as the shift, the eigenvalue of the trailing

2� 2 matrix that is closer to the (n; n)th entry, is usually chosen as the shift. This is known as the

Wilkinson-shift. Thus if a trailing 2� 2 submatrix of Tk is given by t

(k)n�1;n�1 t

(k)n;n�1

t

(k)n;n�1 t

(k)nn

!;

then the Wilkinson-shift is

� = t(k)nn + r � sign(r)

rr2 +

�t

(k)n;n�1

�2

where

r =(t(k)n�1;n�1� t

(k)nn)

2:

Thus the symmetric method comes in two stages:

Algorithm 8.11.2 Symmetric QR Iteration

I. TransformA to a symmetric tridiagonal matrix T using orthogonal similarity transformations:

PAPT = T:

564

Page 182: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

II. Apply single-shift QR iteration to T with the Wilkinson-shift �:

Set T = T1

For k = 1; 2; : : : do until convergence occurs

Tk � �I = QkRk

Tk+1 = RkQk + �I .

Remark: It is possible to compute Tk+1 from Tk without explicitly forming the matrix Tk��kI .

This is known as Implicit Symmetric QR. For details, see Golub and Van Loan, pp. 278{281.

Also see exercise #28 in this chapter.

Convergence of the Symmetric QR Iteration

It can be shown (see Lawson and Hanson, SLP p. 109) that the convergence of t(k)n;n�1 to

zero is quadratic, that is, there exists e > 0 depending upon A such that for all k

jt(k+1)n;n�1j � ejt(k)n;n�1j2:

Remark: In practice, it has been seen that the convergence is almost always cubic; but the

quadratic convergence is all that has been proved (for a proof, see Lawson and Hanson SLP,

pp. 240{244).

Flop-Count: The symmetric QR algorithm requires only about2

3n3 ops. However if the

transforming orthogonal matrix Q is accumulated the ops count becomes 5n3.

Round-o� error property. As in the general nonsymmetric case, the symmetric QR with

implicit shift is stable. It can be shown that, given a symmetric matrix A, the symmetric QR

algorithm with implicit shift generates an orthogonal matrix Q and a diagonal matrix D such that

QTAQ = D +E;

where

kEkF � � �(n)kAkF

and �(n) is a slowly growing function of n.

565

Page 183: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Furthermore, each computed eigenvalue �i satis�es the in-

equality:

j�i � �i�1j � p(n)�kAk2:

Thus, the eigenvalues with modulus close to kAk2 are com-

puted accurately; the other ones may not be.

Note: If the starting matrix itself is a symmetric tridiagonal matrix, then the

eigenvalues and the eigenvectors can be computed much more accurately.

8.12 The Lanczos Algorithm For Symmetric Matrices

There are areas of applications such as power systems, space science, quantum physics and chem-

istry, nuclear studies, etc., where the eigenvalue problems for matrices of very large order are

commonly found.

Most large problems arising in applications are sparse. Research in this area is very active.

The symmetric problem is better understood than the nonsymmetric problem. There are now well-

established techniques to compute the spectrum, at least the extremal eigenvalues of very large and

sparse symmetric matrices. A method originally devised by Lanczos has received considerable at-

tention in this context. We will discuss this method and its applications to eigenvalue computations

in this section. The QR iteration method described in the last section is not practical

for large and sparse eigenvalue problem. The sparsity gets destroyed and the storage

becomes an issue.

The Symmetric Lanczos Algorithm

Given an n � n symmetric matrix A and a unit vector v1, the Lanczos algorithm constructs

simultaneously a symmetric tridiagonal matrix T and an orthonormal matrix V such that

T = VTAV: (8.12.1)

The algorithm can be deduced easily as follows:

� Cornelius Lanczos (1893-1974), a Hungarian mathematician and physicist, made signi�cant contributions to

problems in physics and mathematics that are considered to be of vital interest in current scienti�c computing. The

algorithm, which is now known as the symmetric Lanczos algorithm, is one of the �rst algorithms for large and sparse

eigenvalue problems. The symmetric Lanczos algorithm has served as a \seed" algorithm for further research in this

area. There was a conference at Northern Carolina State University honoring Lanczos 100th birthday in December,

1993.

566

Page 184: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Let

T =

0BBBBB@

�1 �1 � � � 0

�1 �2

. . ....

. . .. . . �n�1

0 �n�1 �n

1CCCCCA

and V = (v1; v2; : : : ; vn). Then the equation

VTAV = T

or

AV = V T

or

A(v1; v2; : : : ; vn) = (v1; v2; : : : ; vn)

0BBBBB@

�1 �1 � � � 0

�1

. . .. . .

.... . .

. . . �n�1

0 � � � �n�1 �n

1CCCCCA

gives

Avj = �jvj + �j�1vj�1 + �jvj+1; j = 1; 2; : : : ; n� 1 (8.12.2)

(where we assume that �0v0 = 0). Multiplying both sides of the above equation by vTj to the left,

and observing that the orthonormality condition gives

vTj vj = 1

vTj vk = 0; j 6= k;

we obtain

�j = vTj Avj ; j = 1; 2; : : : ; n: (8.12.3)

Also, if we write

rj = Avj � �jvj � �j�1vj�1; (8.12.4)

then from (8.12.2) and (8.12.4), we get

vj+1 = rj=�j;

provided that

�j 6= 0:

The nonvanishing of �j can be assured if we take �j = krjk2.The above discussion gives us the following basic Lanczos algorithm:

567

Page 185: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Algorithm 8.12.1 The Basic Symmetric Lanczos

Given an n � n symmetric matrix A and a unit vector v1, the following algorithm constructs

simultaneously the entries of a symmetric tridiagonal matrix T and an orthonormal matrix

V = (v1; : : : ; vn) such that:

VTAV = T:

Set vo = 0; �o = 1; ro = v1:

For j = 1; 2; : : : ; n do

vj = rj�1=�j�1

�j = vTj Avj

rj = (A� �jI)vj � �j�1vj�1

�j = k rj k2

Notes:

1. The vectors v1; v2; : : : ; vn are called Lanczos vectors.

2. Each Lanczos vector vj+1 is orthogonal to all the previous ones; provided �j 6= 0.

3. The whole algorithm can be implemented just by using a subroutine that can perform matrix-

vector multiplication, and thus the sparsity of the original matrix A can be maintained. In

fact, in contrast with Householder's method or Givens' method, the matrix A

is never altered during the whole procedure. Such a feature makes the Lanczos

algorithm so attractive for sparse computations.

4. The vectors fv1; : : : ; vjg from an orthonormal basis of the Krylov subspace fv1; Av1; : : : ; Aj�1v1g.

5. The Arnoldi method described in chapter 6 is the same as the symmetric Lanczos method

described above.

We now show the Lanczos algorithm can be reformulated using only three n{vectors. This is

important when n is large.

Algorithm 8.12.2 The Reformulated Lanczos

Set v0 = 0; �0 = 1; r0 = v1:

For j = 1; 2; : : : ; n do

568

Page 186: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

1. vj = rj�1=�j�1

2. uj � Avj

3. rj � uj � �j�1vj�1

4. �j = vTj uj

5. rj = rj � �jvj

6. �j = krjk:

Example 8.12.1

A =

0BB@1 2 3

2 3 4

3 4 5

1CCA ; r0 = v1 =

0BB@1

0

0

1CCA :

j=1:

�1 = 1; �1 = 3:6056; v1 =

0BB@1

0

0

1CCA :

j=2:

�2 = 8:0769; �2 = :6154; v2 =

0BB@

0

:5547

:8321

1CCA

T2 =

�1 �1

�1 �2

!=

1 3:6056

3:6056 8:0769

!

j=3:

�3 = 0:0769; �3 = 1:5466� 10�14; v3 =

0BB@

0

:8321

�0:5547

1CCA

T = T3 =

0BB@

1 3:6056 0

3:6056 :0769 :6154

0 :6154 �0:0769

1CCA

V =

0BB@1 0 0

� :5547 :8321

0 :8321 �0:5547

1CCA :

Note that V TAV = T:

569

Page 187: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Round-o� Properties of the Symmetric Lanczos Algorithm

It is clear from (8.12.2) that if the symmetric Lanczos algorithm is run from j = 1 to k(k < n),

then we have

AVj = VjTj + rjeTj ;

where Vj = (v1; : : : ; vj) and Tj is the j � j principal submatrix of T . If ~Vj, ~

Tj and ~rj denote the

respective computed quantities, then it can be shown (see Paige 1980) that

A~Vj = ~

Vj~Tj + ~rje

Tj +Ej

where kEjk2 = �kAk2; which shows that the Lanczos algorithm has very favorable numerical prop-

erties as far as the equation AVj = VjTj+rjeTj is concerned. However, the loss of orthogonality

among the Lanczos vectors is the real concern as explained in the following.

Loss of Orthogonality

The Lanczos algorithm clearly breaks down when any of the �j = 0. However, as we will see

later, computationally this is a blessing in disguise. We immediately obtain an invariant

subspace. This, however, seldom happens in practice. The real di�culty is that the computed ~�j

can be very small due to the cancellation that takes place during the computations of rj, and a

small ~�j can cause a severe loss of orthogonality among the computed vectors ~vj , as can be seen

from the following result (Golub and Van Loan, MC 1984 p. 333):

j~vTj+1~vjj �j~rTj vjj+ �kAk2

j~�jj:

Thus, if ~�j is small, then ~vj and ~vj+1 will be far from being orthogonal.

Since the Lanczos algorithm plays an important role in sparse matrix computations, a signi�cant

amount of research has been devoted to making the algorithm a practical one. There now exist

procedures such as Lanczos with complete orthogonalization which produce the Lanczos

vectors that are orthogonal to working precision, or Lanczos with selective orthogonalization

that is used to enforce orthogonality only in selective vectors, whenever needed. For details, we

refer the readers to the well-known books in the area by Parlett (SEP 1980), and by Cullum and

Willoughby (1985a), (1985b). Several papers of Paige (1970, 1971, 1972, etc.), whose pioneering

work in the early 1970's rejuvenated the interests of the researchers in this area, are also very

useful reading. Procedures for complete and selective orthogonalization have been described in

some detail in Golub and Van Loan MC, 1984 pp. 334{337.

570

Page 188: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Computing the Eigenvalues of A

The sole purpose of presenting the Lanczos algorithm here was to show that the Lanczos matrices

Tj can be used to compute certain eigenvalues of the matrix A.

We remarked earlier, when a �j is exactly equal to zero, we have an invariant subspace. This is

indeed good news. Unfortunately, this happens very rarely in practice. In practice, for large enough

values of j, the eigenvalues of Tj provide very good approximations to the extremal eigenvalues

of A. The question arises: Can we give posteriori bounds? To this end, we introduce the

following de�nitions.

De�nition 8.12.1 Let (�j; zj) be an eigenpair of Tj. Then the pair (�j ; yj); where yj is de�ned by

yj = VTj zj , is called the Ritz pair; the �j 's are known as the Ritz values and yj's are called the

Ritz vectors.

Now, returning to the question of how well a Ritz pair approximates an eigenpair of A, we state

the following result (for a proof, see Golub and Van Loan, MC 1984 p. 327).

Theorem 8.12.1 Let Ri = Ayi � yi�i; i = 1; : : : ; j. Then in each interval

[�i � kRik2; �i + kRik2], there is an eigenvalue of A.

Thus, it follows from the above theorem that kRik2 is a good measure of how accurate is the

Ritz pair (�i; yi).

How do we compute kRik2?

Fortunately, we can compute kRik from Tj without computing �i and yi at every step.

Let

STj TjSj = diag(�1; �2; : : : ; �j);

and

Yj = (y1; y2; : : : ; yj) = VjSj = Vj(s1; s2; : : : ; sj):

Then

kRik = kAyi � yi�ik = kAVjsi � Vjsi�ik

= k(AVj � VjTj)sik (because Tjsi = si�i)

= k(�jvj+1eTj )sik (Note that AVj � VjTj = �jvj+1eTj )

= j�jj keTj sik (since kvj+1k = 1):

= j�jj jsjij;

571

Page 189: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

where sij is the (j; i)th entry of Sj .

The above discussion can be summarized in the following theorem:

Theorem 8.12.2 (Residual Theorem for Ritz Pair) Let Tj denote the j � j

symmetric tridiagonal matrix obtained after j steps of the Lanczos algorithm. Let

STj TjSj denote the Real Schur Form (RSF) of Tj;

STj TjSj = diag(�1; : : : ; �j);

that is, �1; : : : ; �j are the eigenvalues of Tj. Let

Yj = (y1; y2; : : : ; yj) = VjSj:

Then for each i from 1 to j, we have

kRik = kAyi � �iyik = j�jj jsjij;

where

sji = eTj si; si is the ith column of Sj :

Example 8.12.2

A =

0BB@1 2 3

2 3 4

3 4 5

1CCA :

j=2: The eigenvalues of A are: 0, -.6235, 9.6235.

T2 =

1 3:6056

3:6056 8:0769

!; �2 = :6154

S2 =

:9221 :3870

�:3970 :9211

!

�1 = �:5133; �2 = 9:5903:

(Note that �2 = 9:5903 is a good approximation of the largest eigenvalue 9.6235 of A).

R1 = j�2j js21j = :6154� :3870 = :2382;

R2 = j�2j js22j = :5674:

572

Page 190: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

j=3:

T3 =

0BB@

1 3:6056 0

3:6056 8:0769 :6154

0 :6154 �0:0769

1CCA

S3 =

0BB@

:8277 �:4082 :3851

�:2727 :1132 :9210

:4196 :9058 :0584

1CCA

R1 = j�3j js31j = 6:487� 10�15

R2 = j�3j js32j = 1:4009� 10�14

R3 = j�3j js33j = 9:0367� 10�16:

(Note the smallness of R1; R2, and R3 in this case.)

8.13 Review and Summary

This chapter has been devoted to the study of the eigenvalue problem, the problem of computing

the eigenvalues and eigenvectors of a matrix: Ax = �x.

Here are the highlights of the chapter.

1. Applications of the Eigenvalues and Eigenvectors. The eigenvalue problem arises in a

wide variety of practical applications. Mathematical models of many of the problems arising

in engineering applications are systems of di�erential and di�erence equations, and the eigen-

value problem arises principally in the analysis of stability of these equations. Maintaining

the stability of a system is a real concern for engineers. For example, in the study of vibra-

tions of structures, the eigenvalues and eigenvectors are related to the natural frequencies

and amplitude of the masses, and if any of the natural frequencies becomes equal or close

to a frequency of the imposed periodic force on the structure, resonance occurs. This is a

situation engineers would like to avoid. In this chapter we have included examples on the Eu-

ropean arms race, buckling of a beam, simulating transient current of an electric

circuit, vibration of a building, and principal components analysis in statistics with

a reference to a stock market analysis. We have attempted just to show how important

the eigenvalue problem is in practical applications.

2. Localization of Eigenvalues. In several applications explicit knowledge of the eigenvalues

is not required; all that is needed is a knowledge of the distribution of the eigenvalues in a

region of the complex plane or estimates of some speci�c eigenvalues.

573

Page 191: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

� The Ger�sgorin disk theorems (Theorems 8.4.1 and 8.4.2) can be used to obtain a region

of the complex plane containing all the eigenvalues, or in some cases, a number of the

eigenvalues in a region. The estimates are, however, very crude.

� Also, j�j � kAk. (Theorem 8.4.3) This result says that the upper bound of any

eigenvalue of A can be found by computing its norm.

Recall that this result is important in convergence analysis of iterative methods for linear

systems.

3. The Power Method and The Inverse Iteration. There are applications such as analysis

of dynamical systems, vibration analysis of structures, buckling of a beam, principal com-

ponent analysis in statistics, etc., where only the largest and the smallest (in magnitudes)

eigenvalues or only the �rst or last few eigenvalues and their corresponding eigenvectors are

needed.

The power method and the inverse power method based on implicit construction of powers

of A can be used to compute these eigenvalues and the eigenvectors. The power method is

extremely simple to implement and is suitable for large and sparse matrices, but there are

certain numerical limitations.

In practice, the power method should be used with a suitable shift. The inverse

power method is simply the power method applied to (A� �I)�1; where � is a suitable shift.

It is widely used to compute an eigenvector when a reasonably good approximation to an

eigenvalue is known.

4. The Rayleigh Quotient Iteration. The quotient

Rq =xTAx

xTx

;

known as the Rayleigh quotient, gives an estimate of the eigenvalue � of a symmetric matrix

A for which x is the corresponding eigenvector.

This idea, when combined with the inverse iteration method, can be used to compute an

approximation to an eigenvalue and the corresponding eigenvector. The process is known as

the Rayleigh quotient iteration.

5. Sensitivity of Eigenvalues and Eigenvectors.

� The Bauer-Fike Theorem (Theorem 8.7.1) tells us that if A is a diagonalizable matrix,

then the condition number of the transforming matrix X , Cond(X) = kXk kX�1k, plays

574

Page 192: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

the role of the condition number of the eigenvalue problem. If this number is large, then

a small change in A can cause signi�cant changes in the eigenvalues.

Since a symmetric matrix A can be transformed to a diagonal matrix by orthogonal

similarity and the condition number of an orthogonal matrix (with respect to 2-norm)

is 1, it immediately follows from the Bauer-Fike Theorem that the eigenvalues of a

symmetric matrix are insensitive to small perturbations.

� If an eigenvalue problem is ill-conditioned, then it might happen that some eigenvalues

are more sensitive than the others. It is thus important to know the sensitivity of

the individual eigenvalues. Unfortunately, to measure the sensitivity of an individual

eigenvalue, one needs the knowledge of both left and right eigenvectors corresponding to

that eigenvalue.

The condition number of the eigenvalue �i is the reciprocal of the number jyTi xij, wherexi, and yi are, respectively, the normalized right and left eigenvectors corresponding

to �i.

� The sensitivity of an eigenvector xk corresponding to an eigenvalue �k depends upon (i)

the condition number of all the eigenvalues other than �k and (ii) the distance of �k

from the other eigenvalues (Theorem 8.8.1).

Thus, if the eigenvalues are well-separated and well-conditioned, then the

eigenvectors are well-conditioned. On the other hand, if there is a multiple eigen-

value or there is an eigenvalue close to another eigenvalue, then there are some ill-

conditioned eigenvectors. This is especially signi�cant for a symmetric matrix. The

eigenvalues of a symmetric matrix are well-conditioned, but the eigenvectors

can be quite ill-conditioned.

6. Eigenvalue Computation via the Characteristic Polynomial and the Jordan Canon-

ical Form. A similarity transformation preserves the eigenvalues and it is well known that

a matrix A can be transformed by similarity to the Jordan Canonical Form (JCF) and to

the Frobenius form (or a comparison form if A is nonderogatory). The eigenvalues of these

condensed forms are rather easily computed. The JCF displays the eigenvalues explicitly,

and with the companion or Frobenius form, the characteristic polynomial of A is trivially

computed and then a root-�nding method can be applied to the characteristic polynomial to

obtain the eigenvalues, which are the zeros of the characteristic polynomial.

However, computation of eigenvalues via the characteristic polynomial or the JCF is not rec-

ommended in practice. Obtaining these forms may require a very ill-conditioned transforming

575

Page 193: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

matrix, and the sensitivity of the eigenvalue problem depends upon the condition number of

this transforming matrix.

In general, ill-conditioned similarity transformation should be avoided in eigen-

value computation.

The use of well-conditioned transforming matrices, such as orthogonal matrices, is desirable.

7. The QR Iteration Algorithm. The most widely used algorithm for �nding the eigenvalues

of a matrix is the QR iteration algorithm.

For a real matrix A, the algorithm basically constructs iteratively the Real Schur Form (RSF)

of A by orthogonal similarity. Since the algorithm is based on repeated QR factorizations

and each QR factorization of an n�n matrix requires 0(n3) ops, the n steps of QR iteration

algorithm, if implemented naively (which we call the basic QR iteration), will require 0(n4)

ops, making the algorithm impractical.

� The matrix A is, therefore, initially reduced to a Hessenberg matrix H by orthogonal

similarly before the start of the QR iteration. The key observations here are: the

reduction of A to H has to be made once for all, and the Hessenberg form is

preserved at each iteration.

� The convergence of the Hessenberg-QR iteration algorithm, however, can be quite slow

in the presence of a near-multiple or a multiple eigenvalue. The convergence can be

accelerated by using suitable shifts.

In practice, double shifts are used. At each iteration, the shifts are the eigenvalues of

the 2 � 2 submatrix at the bottom right hand corner. Since the eigenvalues of a real

matrix can be complex, complex arithmetic is usually required. However, computations

can be arranged so that complex arithmetic can be avoided. Also, the eigenvalues of the

2 � 2 bottom right hand corner matrix at each iteration do not need to be computed

explicitly. The process is known as the double shift implicit QR iteration.

With double shifts, the eigenvalues are computed two at a time. Once two eigenvalues

are computed, the matrix is de ated, and the process is applied to the de ated matrix.

The double shift implicit QR iteration seems to be the most practical algo-

rithm for computing the eigenvalues of a dense matrix of modest size.

8. Ordering the Eigenvalues. The eigenvalues appearing in RSF obtained by the QR iteration

algorithm do not appear in the desired order, although there are some applications which need

576

Page 194: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

this. However, with a little extra work, the eigenvalues can be put in the desired order. There

is an excellent Fortran routine, designed by Stewart, which will accomplish this.

9. Computing the Eigenvectors. Once an approximation to an eigenvalue is obtained for

the QR iteration, inverse iteration can be invoked to compute the corresponding eigenvector.

Since the matrix A is initially reduced to a Hessenberg matrix for practical implementation of

the QR iteration algorithm, advantage can be taken of the structure of a Hessenberg matrix

in computing an eigenvector using inverse iteration.

Alternatively, one can compute the eigenvectors directly from the RSF of A.

10. The Symmetric Eigenvalue Problem.

� The QR iteration algorithm, of course, can be used to compute the eigenvalues of a sym-

metric matrix. A shift called the Wilkinson shift is normally used here. The convergence

of the symmetric QR iteration algorithm with the Wilkinson-shift has been proven to

be quadratic; however, in practice very often it is cubic.

� The eigenvalues and eigenvectors of a symmetric matrix A enjoy some remarkable special

properties, and there are methods for the symmetric problem that can exploit these

properties. One such method is the bisection method.

The given symmetric matrix A is �rst transformed to a symmetric tridiagonal matrix

T using orthogonal similarity and then the well-known bisection algorithm for the root-

�nding problem is applied to the characteristic polynomial of T , obtained by a simple

recursion (Section 8.10.1). This recursion not only gives the characteristic polynomial of

T , but also gives the characteristic polynomials of all the leading principal submatrices.

A remarkable fact is that these polynomials have the Sturm sequence property,

which is used in the implementation of the bisection method. The bisection method is

especially useful for �nding eigenvalues of a symmetric matrix in a given interval of the

real line.

� There are other methods, such as the divide and conquer method, the Jacobi

method, etc., for the symmetric eigenvalue problem. We have not discussed these

methods in this chapter. These methods are important primarily for parallel

computations.

11. Large and Sparse Eigenvalue Problem. The eigenvalue problem for large and sparse ma-

trices is an active area of research. The state-of-the-art techniques using Lanczos or Arnoldi

577

Page 195: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

type of methods with some sort of reorthogonalization and proper preconditioning can com-

pute only a few extremal eigenvalues.

The techniques for symmetric eigenvalue problems are more well-established and better-

understood than those for the nonsymmetric problem.

For the sake of completeness and to give the readers an idea of how the Lanczos-type methods

are used in eigenvalue computations, we have included only a very brief description of the

symmetric Lanczos method (Section 8.12).

8.14 Suggestions for Further Reading

Most books on vibration discuss eigenvalue problems arising in vibration of structures. However,

almost all eigenvalue problems here are generalized eigenvalue problems; as a matter of fact, they

are symmetric de�nite problems.

For references of the well-known books in vibration, see section 9.10 in the next chapter. The

books by Inman and by Thompson are, in particular, very useful and important books in this

area.

For learning more about how the eigenvalue problem arises in other areas of engineering, see

the books on numerical methods in engineering by Chapra and Canale, and by Peter O'Neil,

referenced in Chapter 6. There are other engineering books (too numerous to list here), especially

in the areas of electrical, mechanical, civil and chemical engineering, containing discussions on

eigenvalue problems in engineering. The Real Schur Form (RSF) of a matrix is an important tool

in numerically e�ective solutions of many important control problems, such as solutions of the Lya-

punov matrix equation (Bartels and Stewart (1972)), the Sylvester Matrix Equation (Golub,

Nash, and Van Loan (1979)), Algebraic Riccati equations (Laub (1979), Van Dooren (1982)),

Byers (1984), etc. For details, see the book Computational Methods for Linear Control

Systems, by Petkov, Christov and Konstantinov, Prentice-Hall, 1991, the IEEE Reprint, Vol-

ume by Patel et al. (1994), and the book Numerical Methods in Control Theory, by B. N.

Datta (in preparation).

Some references of how eigenvalue problems (especially large and sparse eigenvalue problems)

arise in other areas of sciences and engineering such as power systems, physics, chemistry, struc-

tural mechanics, oceanography, etc., are given in the book Lanczos Algorithms for Large

Symmetric Eigenvalue Computations, vol. 1, by Jane Cullum and Ralph Willoughby,

Birkh�auser, Boston, 1985.

For some generalizations of the Ger�sgorin disk theorems, see the recent paper by Brualdi

(1993). This paper contains results giving a region of the complex plane for each eigenvalue; for a

578

Page 196: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

full description of the Ger�sgorin disk theorems and applications, see Matrix Analysis by Roger

Horn and Charles Johnson, Cambridge University Press, Cambridge, 1985 (Chapter 6).

A nice description of stability theory in dynamic systems is given in Introduction to Dy-

namic Systems: Theory, Models, and Applications by David Luenberger, John Wiley &

Sons, New York, 1979.

For results on eigenvalue bounds, see the paper by Varah (1968).

For computation of Jordan Canonical Form, see the papers by Golub and Wilkinson (1976),

Kagstrom and Ruhe (1980a and 1980b), and Demmel (1983).

Descriptions of the usual techniques for eigenvalue and eigenvector computations|the power

method, the inverse power method, the Rayleigh-Quotient iteration method, and the QR iteration

method, etc.|can be found in all numerical linear algebra books: Golub and Van Loan (MC, 1983

and 1989), Stewart (IMC), Hager (ANLA), Watkins (FMC),Wilkinson (AEP).The Wilkinson

AEP is, of course, the most authoritative book in this area.

The papers by Varah (1968), (1970), etc. and Peters and Wilkinson (1979) are important

in the context of inverse iteration.

A Fortran program for ordering the eigenvalues of a real upper Hessenberg matrix appears in

Stewart (1976).

An important book in the area of symmetric eigenvalue problem is the book The Symmetric

Eigenvalue Problem by Beresford Parlett, Prentice-Hall, Englewood Cli�s, NJ, 1980.

For a proof of the global convergence of the symmetric QR iteration with Wilkinson-shifts, see

the book SLP by Lawson and Hanson, pp. 240{247.

For a description of the divide and conquer method, see Dongarra and Sorensen (1987)

and the original paper ofCuppen (1981). Watkins (FMC) contains a nice description of the Jacobi

method (Chapter 6).

Again, the book byGolub and Van Loan (MC 1984 and 1989) is a rich source of references.

A basic discussion on Lanczos methods with and without reorthogonalizations, and their appli-

cations to solutions of positive de�nite linear systems and eigenvalue computations, is contained in

the book by Golub and Van Loan (MC 1984, Chapter 9). Two authoritative books in this area

are: Lanczos Algorithms for Large Symmetric Eigenvalue Computations, volumes I

and II, by J. K. Cullum and R. A. Willoughby, Birkh�auser, 1985, and The Symmetric Eigen-

value Problem by B. N. Parlett, Prentice-Hall. Another recent book in this area is Eigenvalue

Problem for Large Matrices, by Y. Saad (1993). Since the pioneering work by Paige in the

1970's, many papers in this area have been published, and this is an active area of research. See

the list of references given in Golub and Van Loan (MC 1989, Chapter 9).

579

Page 197: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

The doctoral thesis of Chris Paige (1971) and several of his follow-up papers (Paige (1976),

Paige (1980), etc.) are also well worth reading. These are considered to be the \seed papers" for

further recent active research in this area.

580

Page 198: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Exercises on Chapter 8

(Use MATLAB whenever needed and appropriate)

PROBLEMS ON SECTION 8.3

1. Consider the following model for the vertical vibration of a motor car:

k2

k1

m2

m1

y1

y2

car body mass

d2 (tire)

d1 (suspension)

Road

(a) Formulate the equation of motion of the car, neglecting the damping constants d1 of the

shock absorber and d2 of the tire:

M �y +Ky = 0

where M = diag(m1; m2);

K =

k1 �k1�k1 k1 + k2

!

and

y =

y1

y2

!:

Determine the stability of motion when

m1 = m2 = 1200kg

k1 = k2 = 300N

cm:

581

Page 199: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

(b) Formulate the equation of motion when just the damping d2 of the tire is neglected:

M �y +D _y +Ky = 0;

M , and K are the same as in part (a), and

D =

d1 �d1�d1 d1

!:

Investigate the stability of motion in this case when

d1 = 4500Ns

m

:

Hints: Show that the system

M �y +D _y +Ky = 0

is equivalent to the �rst order system

_x(t) = Ax(t);

where

A =

0 I

�M�1K �M�1

D

!;

and

x(t) =

y(t)

_y(t)

!:

2. Write the solution of the equation M �y + Ky = 0 with M and K as given in #1(a), using

initial conditions y(0) = 0 and _y(0) = (1; 1; : : : ; 1)T .

3. Develop an eigenvalue problem for an LC network similar to the case study given in section

8.2.2, but with only three loops.

Show that in this case the natural frequencies are given by

w =

8>>><>>>:

:4451jpLC

1:2470jpLC

1:8019jpLC

Find the modes; and illustrate how the currents oscillate in these modes.

582

Page 200: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

PROBLEMS ON SECTION 8.4

4. Apply the Ger�sgorin disk theorems to obtain bounds of the eigenvalues for the following

matrices:

(a) A =

0BB@10 1 1

2 10 1

2 2 10

1CCA ;

(b)

0BB@1 0 0

2 5 0

1 1 6

1CCA ;

(c)

0BBBBB@

2 �1 0 0

�1 2 �1 0

0 �1 2 �10 0 �1 2

1CCCCCA ;

(d)

0BBBBB@

1 �1 0 0

�1 2 �1 0

0 �1 2 �10 0 �1 2

1CCCCCA ;

(e)

0BBBBBBBB@

1:000 :577 :509 :387 :462

:577 1:000 :599 :389 :322

:509 :599 1:000 :436 :426

:387 :389 :436 1:000 :523

:452 :322 :426 :523 1:000

1CCCCCCCCA;

(f)

0BB@1� i 0 1

1 1 1

0 1� i 1 + i

1CCA :

5. Using a Ger�sgorin disk theorem, prove that a diagonally dominant matrix is nonsingular.

6. Let x be an eigenvector corresponding to an isolated eigenvalue � in the Ger�sgorin disk Rk.

Prove that jxkj > jxij for i 6= k.

7. Let A = (aij be an n�n symmetric matrix. Then using a Ger�sgorin disk theorem prove that

each eigenvalue of A will lie in one of the intervals: [aij � ri; aij + ri].

Find an interval where all the eigenvalues of A must lie.

583

Page 201: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

PROBLEMS ON SECTION 8.5

8. Applying the power method and inverse power method �nd the dominant eigenvalue and the

corresponding eigenvector for each of the matrices in the exercise #4.

9. Prove that if �1; : : : ; �n are the eigenvalues of A and v1; : : : ; vn are the corresponding eigenvec-

tors, then �1��; : : : ; �n�� are the eigenvalues of A��I , and the corresponding eigenvectorsare v1; : : : ; vn.

10. Explain the slow rate of convergence of the power method with the following matrices:

(a) A =

0BB@3 2 3

0 2:9 1

0 0 1

1CCA ;

(b) A =

0BB@1 0 0

1 10 0

1 1 9:8

1CCA ;

Choose a suitable shift � and then apply the shifted power method to each of the matrices

and observe the improvement of the rates of convergence.

11. (Orthogonal Iteration) The following iterative procedure generalizes the power method

and is known as the orthogonal iteration process. The process can be used to compute

p(p > 1) largest eigenvalues and the corresponding eigenvectors.

Let Q1 be an n� p orthonormal matrix.

Then

For k = 2; 3; : : : do

1) Compute Bk = AQk�1

2) Factorize into QR: Bk = QkRk:

Apply the above method to compute the �rst two dominant eigenvalues and eigenvectors for

each of the matrices in Exercise #4.

12. (Inverse Orthogonal Iteration) The following iteration, called the Inverse Orthogonal

iteration, generalizes the inverse power method; and, can be used to compute the p smallest

eigenvalues.

Let Q1 be an n� p orthonormal matrix.

584

Page 202: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

For k = 2; 3; : : :

1) Solve for Bk : ABk = Qk�1.

2) Factorize into QR: Bk = QkRk:

Apply the Inverse Orthogonal Iteration to compute the 2 smallest (least dominant) eigenvalues

of each of the matrices in Exercise #4.

13. Let T be a symmetric tridiagonal matrix. Let the Rayleigh-Quotient Iteration be applied to

T with x0 = en, then prove that x1 = qn, where qn is the last column of Q in (T ��0I) = QR:

14. Compute the subdominant eigenvalue of each of the matrices in Exercise #4 using House-

holder de ation. Then compute the corresponding eigenvector without invoking the inverse

iteration.

15. Compute the smallest eigenvalue of each of the matrices A in Exercise #4 by applying the

power method to A�1, without explicitly computing A�1.

16. De ation Using Invariant Subspace. Suppose that we have an n � m matrix X with

independent columns and an m�m matrix M such that

AX = XM:

Consider the QR factorization of X :

QTX =

R

0

!:

Then show that

(a) QAQT =

A1 A2

0 A3

!;

(b) the eigenvalues of A are those of A1 and A3,

(c) the eigenvalues of A are those of M .

PROBLEMS ON SECTIONS 8.6{8.8

17. Construct a simple example to show that an arbitrary similarity transformation can worsen

the conditioning of the eigenvalues of the transformed matrix.

18. If B = U�AU , where U is unitary, and U

�(A+ �A)U = B + �B; then show that k�Bk2 =k�Ak2.

585

Page 203: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

19. (a) Prove that A is normal if there exists an unitary matrix U such that U�AU = D, where

D is diagonal.

(b) Prove that a matrix A has a set of n orthonormal eigenvectors i� A is normal.

(c) Prove that a normal matrix A is unitary i� its eigenvalues are on the unit circle, that

is, for each eigenvalue � of A, we have j�j = 1.

(d) How does the Real Schur Form of a normal matrix look?

(e) Using the eigenvector-sensitivity theorem (Theorem 8.8.1), show that if A is normal,

then the eigenvector xk corresponding to the eigenvalue �k is well-conditioned if �k is

well-separated from the other eigenvalues.

20. Show both theoretically and experimentally that the eigenvectors of the matrix

A = diag(1 + �; 1� �; 2);

where � is a very small positive number, are ill-conditioned. However, the eigenvalues are

well-conditioned.

21. Show that the unitary similarity transformation preserves the condition number of an eigen-

value.

22. Prove the Bauer-Fike Theorem using Ger�sgorin's �rst theorem.

23. (a) Given

A =

1 1

0 1 + �

!;

�nd the eigenvector-matrix X such that X�1AX is diagonal; hence show that the eigen-

values of A are ill-conditioned.

Verify the ill-conditioning of the eigenvalues of A computationally by constructing a

small perturbation to A and �nding the eigenvalues of the perturbed matrix.

(b) Consider

A =

0BBBBBBBBBBB@

12 11 10 � � � 2 1

11 11 10 � � � 2 1

0 10 10 � � � 2 1

� � � � � � � � � � � � 2 1

� � � � � � � � � � � � � � � � � �0 0 0 0 11 1

1CCCCCCCCCCCA:

Show that the largest eigenvalues of A are well-conditioned while the smallest ones very

ill-conditioned, by computing the eigenvalues using MATLAB.

586

Page 204: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

PROBLEMS ON SECTIONS 8.9 AND 8.10

24. Prove that if R is upper triangular and Q is upper Hessenberg, then RQ is upper Hessenberg.

25. Construct an example to show that for an arbitrary upper Hessenberg matrixH , the Q-matrix

in

H = QR

need not be an upper Hessenberg.

However, if R has nonzero diagonal entries, then Q in H = QR, is always upper Hessenberg.

26. Prove that

(a) the QR factorization of an n� n Hessenberg matrix requires 0(n2) ops,

(b) the QR factorization of a symmetric tridiagonal matrix requires only 0(n) ops.

27. Apply 3 iterations of the single-shift QR iteration to each of the following matrices and observe

the convergence or nonconvergence of the subdiagonal entries.

(a)

A =

0BB@1 2 0

2 3 4

0 4 1

1CCA

(b)

A =

0BB@4 5 6

1 0 1

0 �2 2

1CCA

28. Perform one step of the single-shift QR iteration the matrix

H =

0BB@1 1 1

2 10 6

0 :1 1

1CCA

and observe the quadratic convergence.

29. Implicit single-shift QR. Consider one step of the single-shift QR iteration:

Hk � h(k)nnI = QkRk; Hk+1 = RkQk + h

(k)nnI

or (simply)

H � �I = QR; H = RQ+ �I; � is real:

587

Page 205: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

(a) Prove that the �rst column of Q is a multiple of the �rst column of H��I , and thereforecontains only two nonzero entries.

(b) Denote the �rst column of H � �I by h1 = (h11 � �; h21; 0; : : : ; 0)T: Find a Givens

rotation P0 such that P0h1 is a multiple of e1. Show that the �rst column of P0 is the

same as the �rst column of Q, except possibly for the sign.

(c) Form H0 = P

T0 HP0. Find Givens rotations J32; J43; : : : ; Jn;n�1 such that

H0

1 = (J32J43; : : : ; Jn;n�1)TH0(J32; : : : ; Jn;n�1)

is upper Hessenberg. Show that the matrix

~Q = P0J32; : : : ; Jn;n�1

has the same �rst column as P0 and hence the same �rst column as Q. Conclude �nally

from the Implicit Q Theorem that the Hessenberg matrix H 0

1 is essentially the same as

H0:

The steps (a) to (c) constitute one step of the implicit single-shift QR iteration.

Apply one step of the implicit single-shift QR iteration to the symmetric tridiagonal matrix0BBBBB@

2 �1 � � � 0

�1 . .. � � �...

. . .. . . �1

0 � � � �1 2

1CCCCCA :

30. Construct one step of the explicit double-shift QR iteration (real arithmetic) and one step of

the implicit double-shift QR iteration for the matrix

A =

0BBBBB@

1 2 3 4

3 4 5 6

0 1 0 1

0 0 �2 2

1CCCCCA

and show that the �nal Hessenberg matrices are (essentially) the same.

31. LR Iteration. In analogy with QR iteration algorithm, develop a LR iteration algorithm,

based on LU decomposition of A, making the necessary assumptions.

Set A = A1

2) Compute Ak = LkRk; Ak+1 = RkLk; k = 1; 2; : : :

Why is this algorithm not to be preferred over the QR iteration algorithm?

588

Page 206: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

32. Considering the structures of the matrices Pi; i = 0; 1; : : : ; n� 2 in the implicit double-shift

QR iteration step (Exercise #29), show that it requires only 4n2 ops to implement this step.

33. Show that the matrices Hs and Hs+2 in the double-shift QR iteration have the same eigen-

values.

34. Prove the following:

Let H = H0. Generate the sequence fHkg:

Hk � �kkI = QkRk; Hk+l = RkQk + �kI:

Then

�ni=1(H � �iI) = (Q1; : : : ; Qn)(Rn; : : : ; R1):

PROBLEMS ON SECTIONS 8.11 AND 8.12

35. (a) Let

A =

0BBBBB@

1 �1 0 0

�1 2 �1 0

0 �1 2 �10 0 �1 2

1CCCCCA :

Without computing the eigenvalues show that j�j < 4 for each eigenvalue � of A. Show

that there are exactly two eigenvalues greater than 2 and two less than 2. Apply Sturm

Sequence -Bisection Algorithm (Algorithm 8.11.1). to compute the eigenvalue close to

2.

(b) Apply the inverse Hessenberg iteration algorithm to A to compute the eigenvector asso-

ciated with the eigenvalue close to 2.

(c) Compute the eigenvalues ofA by applying the symmetric QR iteration with theWilkinson-

shift.

36. (a) Prove that the eigenvalues of an unreduced real symmetric tridiagonal matrix are real

and distinct.

(b) Prove that if � is an eigenvalue of multiplicity k of an unreduced symmetric tridiagonal

matrix T , then at least (k� 1) subdiagonal entries of T must be zero.

37. (a) Develop a QR-type algorithm to compute the eigenvalues of a symmetric positive de�nite

matrix A, based upon the Cholesky decomposition. (Section 6.4.6).

589

Page 207: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

(b) Test your algorithm with the matrix A of problem #35.

38. Let

A =

� �

!:

Prove that the eigenvalue � of A closest to � is given by

� = � sign (�)�2

j�j+p�2 + �

2;

where � = ��

2.

39. Let A = A1 + iA2 be a Hermitian matrix. Then prove that B =

A1 �A2

A2 A1

!is symmetric.

How are the eigenvalues and eigenvectors of A related to those of B?

40. Take the 50� 50 symmetric tridiagonal matrix T with 2 along the diagonal and -1 along the

sub diagonal and super diagonal. Apply Algorithm 8.12.3 to T with j = 1; 2; : : : ; 20. Find

pproximations to a few extreme eigenvalues of T using Theorems 8.12.1 and 8.12.2.

590

Page 208: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

MATLAB PROGRAMS AND PROBLEMS ON CHAPTER 8

1. Write a MATLAB program to compute the dominant eigenvalue of a matrix using the power

method.

[lambda1] = power(A,x0,epsilon,n)

(a) Modify the program power to incorporate a shift sigma

[lambda1] = powershift(A,x0,sigma,epsilon,n)

(b) Apply power and powershift to the following matrices and compare the speed of

convergence

Test Data:

A =

0BB@3 2 3

0 0:99 1

0 0 2:9

1CCA ;

A = A randomly generated matrix of order 5.

A = The Wilkinson bidiagonal matrix of order 20.

2. (a) Using linsyspp from Chapter 6 or the MATLAB command `n', write a MATLAB pro-

gram called invitr to implement the inverse iteration algorithm

x = invitr(A,x0,sigma,epsilon,n)

(b) Using linsyspp from Chapter 6 or the MATLAB command `n', write a MATLAB pro-

gram called powersmall to compute the smallest eigenvalue (in magnitude) of a matrix

A

lambdan = powersmall(A,x0,epsilon,n)

Test Data and Experiment:

(a) Take the 20 � 20 symmetric tridiagonal matrix appearing in the buckling problem of

section 8.3.2. Apply power to compute the dominant eigenvalue lambda1 by choosing

x0 arbitrarily.

(b) Now compute the smallest eigenvalue in magnitude, lambdan, by using

(i) powershift with sigma = lambda1

(ii) powersmall with the same x0 as used to implement power.

591

Page 209: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

(c) Compare the speed of (i) and (ii) in (b).

(d) Find the smallest critical load that will buckle the beam

(e) Taking sigma = lambdan, �nd the eigenvector corresponding to the smallest eigenvalue

�n using invitr.

3. Using power, invitr, housmat (from Chapter 5) and housmul (from Chapter 4), write

a MATLAB program to implement the Householder de ation algorithm that computes the

subdominant eigenvalue of a matrix:

lambda2 = housde t(a)

Test data:

A single sex, chohort population model can be represented by the following system of di�erence

equations :

p0(k + 1) = �0p0(k) + �1p1(k) + :::�npn(k)

pi+1(k + 1) = �ipi(k); i = 0; 1; :::; n� 1;

or in matrix form

pk+1 = Apk:

Here �i is the birth rate of the ith age group and �i is the rate of survival of that group (see

Luenberger (1979), p 170).

Taking �0 = 0; �1 = �2 = ::: = �n = 1, and �i = 1; i = 0; 1; :::; n� 1, determine by using

power, invitr, housde t, if there is a long term growth in the population; if this is so, what

is the �nal population distribution; and how fast is the original distribution approaching the

�nal distribution.

Consult the example on population study in Section 8.4.2.

4. (The purpose of this exercise is to study how are the eigenvalues of a matrix A

are a�ected by conditioning of the transforming matrix.)

(a) For each of the following matrices construct a matrix X of appropriate order which is

upper triangular with all the entries equal to 1 except for a few very small diagonal

592

Page 210: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

entries. Then compute the eigenvalues of A and those of (X)�1AX using MATLAB

commands eig and inv :

A =

0BBBBB@

1 1 0 0

0 1 0 0

0 0 0:9 1

0 0 0 1

1CCCCCA ; A =

0BB@0 0 2

1 0 �50 1 4

1CCA ;

A = The Wilkinson bidiagonal matrix of order 20.

(b) Repeat part (a) by taking X as a Householder matrix of appropriate order.

(c) Compare the results of (a) and (b).

5. (a) Compute the eigenvalues of the following matrices using:

1) MATLAB commands poly and roots.

2) MATLAB command eig.

A =

0BB@0 0 2

1 0 �50 1 4

1CCA ; A =

0BB@1 1 1

0 :19 1

0 0 0:9999

1CCA ;

A = The Wilkinson bidiagonal matrix of order 20.

(b) Compare your results of (1) and (2) for each matrix.

6. (The purpose of this exercise is to study the sensitivities of the eigenvalues of

some well-known matrices with ill conditioned eigenvalues).

Perform the following on each of the matrices in the test-data:

(a) Using the MATLAB command [V;D] = eig(A), �nd the eigenvalues and the matrix of

right eigenvectors. Then �nd the matrix of left eigenvectors W as follows W = (inv(V))'

/norm(inv(V)')

(b) Compute si = wTi vi; i = 1; :::; n: where Wi and Vi are the ith columns of W and V .

(c) Compute ci = the condition number of the ith eigenvalue = 1=si, i = 1; 2; :::; n.

(d) Perturb the (n,1)th entry of A by � = 10�10. Then compute the eigenvalues �i; i = 1:::; n

of the perturbed matrix using the MATLAB command eig.

(e) Make the following table for each matrix.

593

Page 211: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

�i �i j�i � �ij Cond (V) ci

(f) Write your conclusions.

Test-Data:

(1) A = The Wilkinson bidiagonal matrix of order 20

(2) A = The transpose of the Wilkinson Bidiagonal matrix of order 20.

(3)

A =

0BBBBBBBBBBB@

12 11 10 � � 3 2 1

11 11 10 � � 3 2 1

� � � � � � � �� � � � � � � �� � � � � 2 2 1

0 0 0 � � � 1 1

1CCCCCCCCCCCA

7. Study the sensitivites of the eigenvectors of the following matrices by actually computing

the the eigenvectors of the original and perturbed matrices using the MATLAB command

[V;D] = eig(A), [V;D] = eig(A), where A is the matrix obtained from A by perturbing

(n; 1)th entry by � = 10�5.

594

Page 212: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

A =

0BBBBB@

1 0 0 0

0 :999 0 0

0 0 0 2

0 0 0 0:0005

1CCCCCA

1) A = diag(1; :9999; 1; :9999; 1)

2) A randomly generated matrix of order 5.

8. Write a MATLAB program called qritrb to implement the basic QR iteration using givqr

from Chapter 5 :

(a) [A] = qritrb(A; num); num is the maximum number of iterations.

(b) Modify the program now to implement the Hessenberg QR iteration [A] = qritrh(A; num)

num is the number of iterations

(c) Compare the speed of the programs by actually computing the op-count and elapsed

time .

9. (a) Write a MATLAB program to compute one step of the explicit double shift QR iteration:

[A] = qritrdse(A)

(b) Write a MATLAB program to compute one step of the implicit QR iteration with double

shift: [A] = qritrdsi(A).

(c) Compare your results of (a) and (b) and conclude that they are essentially the same.

10. Write a MATLAB program to de ate the last k rows and k columns of a Hessenberg matrix.

hprime = de at(H; k).

Test your program with a randomly generated matrix with di�erent values of k. Note that

for k = 1, hprime will be of order n� 1, for k = 2 hprime will be of order n� 2, and so on.

11. Using Qritrdsi and de at, write a MATLAB program to determine the Real Schur form of

a Hessenberg matrix A;

[h] = rsf(h; eps);

where eps is the tolerance.

Test: Generate randomly a 20 � 20 Hessenberg matrix and make the following table using

rsf.

595

Page 213: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

TABLE

Iteration h21 h32 h43 h54 h20;1

12. (a) Write a MATLAB program, called polysymtri to compute the characteristic polynomial

pn(�) of an unreduced symmetric tridiagonal matrix T , based on the recursion in Section

8.11.1

[valpoly] = polysymtri(A; lambda):

(b) Using polysymtri, write a MATLAB program called signagree that �nds the number

of eigenvalues of T greater than a given real number �, based on Theorem 8.11.1:

[number] = signagree (T;meu).

(c) Using polysmtri and signagree, implement the Bisection algorithm of Section

8.11.1:

[lambda] = bisection (T;m; n).

Compute �n�m+1 for m = 1; 2; 3; ::: , using bisection, and then compare your results

with those obtained by using eig(T).

Test Data:

A = The dymmetric tridiagonal matrix arising in Buckling Problem in Section 8.3.2, with

n = 20.

13. Write a MATLAB program, called lanczossym, to implement the reformulated symmetric

Lanczos algorithm of Section 8.11.3.

Using lanczossym �nd the �rst ten eigenvalues of a randomly generated symmetric matrix

of order 50. (To generate a symmetric matrix B, generate A �rst, then take B = A+ AT ).

(Note : The programs power, invitr, qritrb, qritrh, qritrdsi, etc. are in MATCOM. But it is

a good idea to write your own codes).

596

Page 214: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

9. THE GENERALIZED EIGENVALUE PROBLEM

9.1 Introduction : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 597

9.2 Generalized Schur Decomposition : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 599

9.3 The QZ algorithm : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 601

9.3.1 Reduction to Hessenberg-Triangular Form : : : : : : : : : : : : : : : : : : : : 602

9.3.2 Reduction to the Generalized Schur Form : : : : : : : : : : : : : : : : : : : : 604

9.4 Computations of the Generalized Eigenvectors : : : : : : : : : : : : : : : : : : : : : 611

9.5 The Symmetric-De�nite Generalized Eigenvalue Problem : : : : : : : : : : : : : : : 612

9.5.1 The QZ Method for the Symmetric-De�nite Pencil : : : : : : : : : : : : : : : 614

9.5.2 The Cholesky-QR Algorithm : : : : : : : : : : : : : : : : : : : : : : : : : : : 614

9.5.3 Diagonalization of the Symmetric-De�nite Pencil : : : : : : : : : : : : : : : : 616

9.6 Symmetric-De�nite Generalized Eigenvalue Problems Arising in Vibrations of Struc-

tures : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 619

9.6.1 A Case Study on the Vibration of a Spring-Mass System : : : : : : : : : : : : 619

9.6.2 A Case Study on the Vibration of a Building : : : : : : : : : : : : : : : : : : 622

9.6.3 Forced Harmonic Vibration : : : : : : : : : : : : : : : : : : : : : : : : : : : : 625

9.7 Applications to Decoupling and Model Reduction : : : : : : : : : : : : : : : : : : : : 629

9.7.1 Decoupling of a Second-Order System : : : : : : : : : : : : : : : : : : : : : : 630

9.7.2 The Reduction of a Large Model : : : : : : : : : : : : : : : : : : : : : : : : : 637

9.7.3 A Case Study on the Potential Damage of a Building Due to an Earthquake : 639

9.8 The Quadratic Eigenvalue Problem : : : : : : : : : : : : : : : : : : : : : : : : : : : : 643

9.9 The Generalized Symmetric Eigenvalue Problems for Large and Structured Matrices 646

9.9.1 The Sturm Sequence Method for Tridiagonal A and B : : : : : : : : : : : : : 646

9.9.2 The Lanczos Algorithm for the Pencil A � �B : : : : : : : : : : : : : : : : : 647

9.9.3 Estimating the Generalized Eigenvalues : : : : : : : : : : : : : : : : : : : : : 649

9.10 The Lanczos Method for Generalized Eigenvalues in an Interval : : : : : : : : : : : : 651

9.11 Review and Summary : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 652

9.12 Suggestions for Further Reading : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 655

Page 215: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

CHAPTER 9

THE GENERALIZED EIGENVALUE PROBLEM

Page 216: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

9. THE GENERALIZED EIGENVALUE PROBLEM

Objectives

The objectives of this chapter is to study engineering applications and numerical methods for

the generalized eigenvalue problem: Ax = �Bx. Some of the highlights of this chapter are:

� The QZ algorithm for generalized Schur form (Section 9.3).

� The Cholesky-QR algorithm and simultaneous diagonalization techniques for a symmetric

de�nite pencil (Section 9.5).

� Engineering vibration problems giving rise to generalized symmetric de�nite eigenvalue

problems (Section 9.6).

� Applications of simultaneous diagonalization techniques to decoupling and model

reduction (Section 9.7).

� The Lanczos algorithm for large and sparse symmetric de�nite problems (Section

9.9).

� The Lanczos algorithm for generalized eigenvalues in an interval (Section 9.10).

Background Material Needed for this Chapter

We need the following major tools developed earlier to understand the material in this chapter.

1. The Householder and Givens methods to create zeros in a vector and the corresponding QR

factorization algorithms (Sections 5.4, 5.4.1, 5.4.2, 5.5, 5.5.1).

2. The Cholesky algorithm for solving a symmetric positive de�nite system (Section 6.4.7).

3. The Inverse iteration algorithm (Chapter 8, Section 8.5).

4. The Rayleigh quotient iteration algorithm (Chapter 8, Section 8.5).

9.1 Introduction

In this chapter we consider the following eigenvalue problems known as the generalized eigen-

value problem.

597

Page 217: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Statement of the Generalized Eigenvalue Problem

Given n�n matrices A and B, �nd scalars � and nonzero vectors x such

that

Ax = �Bx:

Note that the standard eigenvalue problem for the matrix A is a special case of this problem

(take B = I).

De�nition 9.1.1 In the problem AX = �BX , � is called a generalized eigenvalue and the

vector x is a generalized eigenvector associated with �.

It is easy to see that � is a root of the characteristic equation

det(A� �B) = 0:

De�nition 9.1.2 The matrix A � �B is called a matrix pencil. If B is nonsingular, then the

pencil is called a regular pencil.

A Note on the Use of the Word `Pencil'

\The rather strange use of the word \pencil" comes from optics and geometry. An

aggregate of (light) rays converging to a point does suggest the sharp end of a pencil

and, by a natural extension, the term came to be used for any one parameter

family of curves, spaces, matrices, or other mathematical objects." (Parlett, The

Symmetric Eigenvalue Problem (1980), p. 302).

Note that when B is nonsingular, a generalized eigenvalue � is also an eigenvalue of B�1A. If

B is singular, then zero is an eigenvalue of B, in that case the corresponding generalized eigenvalue

is 1.

Many engineering applications give rise to generalized eigenvalue problems. In fact, the ma-

jority of eigenvalue problems arising from real physical systems are generalized eigen-

value problems. For example, the eigenproblems for vibrations of structures such as buildings

598

Page 218: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

and bridges are the so-called symmetric de�nite generalized eigenvalue problems for the mass and

sti�ness matrices: Kx = �Mx, where M is the mass matrix and K is the sti�ness matrix. M and

K are usually real symmetric, and furthermore, M is symmetric positive de�nite.

De�nition 9.1.3 If A and B are real symmetric matrices and furthermore, if B is positive de�nite,

then the generalized eigenvalue problem

Ax = �Bx

is called the symmetric de�nite generalized eigenvalue problem.

This chapter is devoted to the study of the generalized eigenvalue problem with particular

attention to the symmetric de�nite problem. The chapter is organized in the following manner.

In Section 9.2 we present a result that shows how the generalized eigenvalues, and eigenvectors,

can be extracted once the matrices A and B are reduced to triangular forms.

In Section 9.3 we describe the QZ algorithm for the generalized eigenvalue problem. It is a

natural generalization of the QR iteration algorithm described in Chapter 8.

In Section 9.4 we show how to compute a generalized eigenvector when a reasonable approxi-

mation of a generalized eigenvalue is known using the inverse iteration.

Sections 9.5, 9.6, and 9.7 are dedicated to the study of the symmetric de�nite generalized

eigenvalue problems. Several case studies on the problems arising in vibration of structures are

presented. A popular algorithm widely used in engineering practice|namely, the simultaneous

diagonalization algorithm is presented and several engineering applications of this technique are

discussed.

Finally, in Section 9.8, we present the Sturm sequence and the Lanczos methods for large and

sparse generalized eigenvalue problems.

9.2 Generalized Schur Decomposition

As a generalization of the procedure for the standard eigenvalue problem, it is natural to think of

solving the generalized eigenvalue problem by simultaneously reducing the matrices A and B to

some convenient forms from which generalized eigenvalues can be easily extracted. Theorem 9.3.1

shows the existence of such convenient forms, while Theorem 9.2.1, illustrates the extraction of the

generalized eigenvalues once the matrices A and B have been reduced to such forms.

599

Page 219: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Theorem 9.2.1 Let A and B be n�n matrices and B be nonsingular. Let U1 and

U2 be unitary matrices such that

U1AU2 = T1 =

0BBBBB@

t11

0.. . �

.... . .

0 tnn

1CCCCCA

U1BU2 = T2 =

0BBBBB@

t0

11

0.. . �

.... . .

0 t0

nn

1CCCCCA :

Then the generalized eigenvalues �i; i = 1; : : : ; n of the regular pencil det(A� �B)

are given by

�i = tii=t0

ii:

Proof. From Ax = �Bx, we have

U1AU2U�

2x = �U1BU2U�

2x:

De�ne y = U�

2x. Then from above we have

U1AU2y = �U1BU2y;

that is, T1y = �T2y. Since B is nonsingular, so is T2. Thus, we have

T�12 T1y = �y;

which shows that � is an eigenvalue of

T�12 T1:

Since T1 and T�12 are both upper triangular matrices, so is their product T�12 T1. Thus, the eigen-

values of T�12 T1 are tii=t0

ii; i = 1; : : : ; n.

Remarks:

1. Note that U�

2x = y is an eigenvector associated with �.

2. If A and B are real matrices, then U1 can be chosen such that U1AU2 = T1 is in Real Schur

Form.

600

Page 220: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

9.3 The QZ algorithm

We will describe an analog of the QR iteration, known as the QZ iteration algorithm for comput-

ing the generalized eigenvalues, developed by Cleve Moler and G. W. Stewart.Assume that B is

nonsingular. Then the basic idea is to apply the QR iteration algorithm to the matrix C = B�1A

(or to AB�1), without explicitly forming the matrix C, because if B is nearly singular, then it is

not desirable to form B�1. In this case the elements of C will be much larger than those of A and

B, and the eigenvalues of C will be computed inaccurately. Note that the eigenvalues of B�1A are

the same as those of AB�1, because AB�1 = B(B�1A)B�1. Thus, they are similar.

If AB�1 or B�1A is not to be computed explicitly, then the next best alternative, of course, is

to transform A and B to some reduced forms and then extract the generalized eigenvalues �i from

these reduced forms. The simultaneous reduction of A and B to triangular forms by equivalence is

guaranteed by the following theorem:

Theorem 9.3.1 (The Generalized Real Schur Decomposition) Given two

n � n real matrices A and B, there exist orthogonal matrices Q and Z such that

QTAZ is an upper Real Schur matrix and Q

TBZ is upper triangular:

A0 = Q

TAZ : A

0 = an upper Real Schur matrix.

B0 = Q

TBZ : B

0 = an upper triangular matrix.

The pair (A0; B0) is said to be in generalized Real Schur Form.

We shall now give a constructive proof of this theorem.

The reduction to the generalized Real Schur Form is achieved in two stages.

Stage I. A and B are reduced to an upper Hessenberg and an upper triangular matrix, respec-

tively, by simultaneous orthogonal equivalence:

A � QTAZ : an upper Hessenberg matrix

B � QTBZ : an upper triangular matrix

Dr. Cleve Moler is the developer of the popular software package MATLAB. He was a professor and head of the

Computer Science Department at the University of New Mexico. He is currently with MathWorks, Inc. He was also

one of the developers of another popular mathematical software \LINPACK".

601

Page 221: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Stage II. The Hessenberg-Triangular pair (A;B) is reduced further to the generalized Real

Schur Form by applying implicit QR iteration to AB�1.

This process is known as the QZ Algorithm.

We will now brie y sketch these two stages in the sequel.

9.3.1 Reduction to Hessenberg-Triangular Form

Let A and B be two n� n matrices. Then

1. Find an orthogonal matrix U such that

B � UTB : upper triangular:

Form

A � UTA

(in general, A will be full).

2. Reduce A to Hessenberg form while preserving the triangular structure of B.

This step is achieved as follows:

To start with, we have

A � UTA =

0BBBBBBBB@

� � � � � �

� � � � � �

...

� � � � � �

� � � � � �

1CCCCCCCCA;

B � UTB =

0BBBBBBBB@

� � � � � � � � �

0 � � � � � � � �

0 0. .. � � � �

.... . .

...

0 0 0 � � �0 �

1CCCCCCCCA:

First, the (n; 1)th entry of A is made zero by applying a rotation Qn�1;n in the (n� 1; n) plane:

A � Qn�1;nA =

0BBBBBBBB@

� � � � � �

� � � � � �

...

� � � � � �

0 � � � � �

1CCCCCCCCA:

602

Page 222: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

This transformation, when applied to B to the left, will give a �ll-in in the (n; n� 1) position:

B � Qn�1;nB =

0BBBBBBBB@

� � � � � � � � �

0 � � � � � � � �

0 0 � � � � �

.... . .

...

0 0 0 � �

1CCCCCCCCA:

The rotation Zn�1;n = J(n � 1; n; �) is now applied to the right of B to make the (n; n� 1) entry

of B zero. Fortunately, this rotation, when applied to the right of A, does not destroy the zero

produced earlier. Schematically, we have

B � B Zn�1;n =

0BBBBBBBB@

� � � � � � �

0 � � � � � �

0 0 � � � � �

.... . .

. . .

0 0 � � � 0 �

1CCCCCCCCA

A � AZn�1;n =

0BBBBBBBBBBB@

� � � � � � �

� � � � � � �

� � � � � � �

......

......

0 � � � � � �

0 � � � � � �

1CCCCCCCCCCCA:

The entries (n� 1; 1); (n� 2; 1); : : : ; (3; 1) of A are now successively made zero, each time applying

an appropriate rotation to the left of A, followed by another appropriate rotation to the right of B

to recover the undesirable �ll-in in B. At the end of the �rst step, the matrix A is Hessenberg in

its �rst column, while B remains upper triangular:

A =

0BBBBBBBB@

� � � � � �

� � � � � �

0 � � � � �

......

. . ....

0 � � � � �

1CCCCCCCCA; B =

0BBBBBBBB@

� � � � � � � � �

� � � � � � � � �

0. . .

. . ....

.... . .

. . .. . . �

0 � � � 0 � �

1CCCCCCCCA:

The zeros are now produced on the second column of A in the appropriate places while retaining

the triangular structure of B in the analogous manner.

The process is continued until the matrix A is an upper Hessenberg matrix and B is upper

triangular.

603

Page 223: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Example 9.3.1

A =

0BB@1 2 3

1 3 4

1 3 3

1CCA ; B =

0BB@1 1 1

0 1 2

0 0 2

1CCA :

1. Form Q23 to make a31 zero:

Q23 =

0BB@1 0 0

0 :7071 :7071

0 �:7071 :7071

1CCA

A � A(1) = Q23A =

0BB@

1 2 3

1:4142 4:2426 4:9497

0 0 �0:7071

1CCA :

2. Update B:

B � B(1) = Q23B =

0BB@1 1 1

0 0:7071 2:8284

0 �0:7071 0

1CCA

3. Form Z23 to make b32 zero:

Z23 =

0BB@1 0 0

0 0 �1

0 1 0

1CCA

B � B(1)Z23 = Q23BZ23 =

0BB@1 1 �1

0 2:8284 �0:7071

0 0 0:7071

1CCA :

4. Update A:

A � A(1)Z23 = Q23AZ23 =

0BB@

1 3 �2

1:4142 4:9497 �4:2426

0 �0:7071 0

1CCA :

A is in upper Hessenberg and B is in upper triangular form.

9.3.2 Reduction to the Generalized Schur Form

At the beginning of this process, we have A and B as an upper Hessenberg and an upper triangular

matrix, respectively, obtained from stage 1. We can assume without loss of generality that the

matrix A is an unreduced upper Hessenberg matrix. The basic idea now is to apply an

implicit QR step to AB�1 without ever completely forming this matrix explicitly.

Thus a QZ step, analogous to an implicit QR step, will be as follows:

604

Page 224: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

� Compute the �rst column of N = (C � �1I)(C � �2I), where C = AB�1, and �1 and �2 are

suitably chosen shifts.

� Find a Householder matrix Q1, such that Q1Ne1 is a multiple of e1.

� Form Q1A and Q1B.

� Transform simultaneously Q1A to an upper Hessenberg matrix A1, and Q1B to an upper

triangular matrix B1.

A1 � Q0(Q1A)Z: an upper Hessenberg;

B1 � Q0(Q1B)Z: an upper triangular.

Using the implicit Q theorem we can show (Exercise) that the matrix A1B�11 is essentiatlly

the same as that we would have obtained by applying an implicit QR step directly to AB�1.

Application of a few QZ steps sequentially will then yield a quasi-triangular matrix R = QTAZ

and an upper triangular T = QTBZ, from which the generalized eigenvalues can be easily computed.

The above four steps constitute one single step of the QZ algorithm. We now show how to

implement these steps.

Computation of the �rst column of (C � �1I)(C � �2I)

The real bottleneck in implementing the whole algorithm is in computing the �rst column of

(C � �1I)(C � �2I), without forming C = AB�1 explicitly. Fortunately, this can be done. First,

note that because A is upper Hessenberg and B is upper triangular, this �rst column contains at

most three nonzero entries in the �rst three places:

n1 = Ne1 = (C � �1I)(C � �2I)e1 =

0BBBBBBBBBBB@

x

y

z

0...

0

1CCCCCCCCCCCA:

To compute x; y; z; all we need to know is the �rst two columns of C, which can be obtained just

by inverting the 2� 2 leading principal submatrix of B�1; the whole B�1 does not need to be

computed. Thus, if c1 and c2 are the �rst two columns of C = AB�1, then

(c1; c2) = (a1; a2)

b11 b12

0 b22

!�1

;

605

Page 225: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

where ai; i = 1; 2 are the �rst two columns of A. Note that c1 has at most two nonzero entries and

c2 has at most three.

Let

c1 =

0BBBBBBBB@

c11

c21

0...

0

1CCCCCCCCA

and c2 =

0BBBBBBBBBBB@

c12

c22

c32

0...

0

1CCCCCCCCCCCA:

Then it is easy to see that 0BB@x

y

z

1CCA =

0BB@(c11 � �1)(c11� �2) + c12c21

c21(c11� �2) + c21(c22� �1)

c21c32

1CCA :

Example 9.3.2

Let

A =

0BBBBB@

1 1 1 1

2 1 4 1

0 1 1 1

0 0 1 1

1CCCCCA ; B =

0BBBBB@

1 2 3 4

0 1 1 1

0 0 1 2

0 0 0 3

1CCCCCA :

The 2� 2 leading principal submatrix of B =

1 2

0 1

!:

c1 =

0BBBBB@

1

2

0

0

1CCCCCA ; c2 =

0BBBBB@

�1

�3

1

0

1CCCCCA :

Choose �1 = 1; �2 = 1;

then x = �2; y = �8; z = 2:

Computation of A1 and B1

Since the �rst column n1 of N = (C � �1I)(C � �2I) has at most three nonzero entries, the

Householder matrix Q1 that transforms n1 to a multiple of e1 has the form

Q1 =

Q1 0

0 In�3

!

606

Page 226: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

where Q1 is a 3� 3 Householder matrix. Therefore

A � Q1A =

0BBBBBBBBBBBBBB@

� � � � � � �

� � � � � � �

� � � � � �

0 0 � � � � �

......

......

...

0 0 0 � �

1CCCCCCCCCCCCCCA

B � Q1B =

0BBBBBBBBBBBBBBBBBB@

� � � � � � �

� � � � � �

� � � � �

0 0 0 � � � �

......

. . .. . .

...

......

. . .. . .

...

0 0 � � � 0 �

1CCCCCCCCCCCCCCCCCCA

:

That is, both the Hessenberg form A and the triangular form of B are now lost, in that there

are now an unwanted nonzero in the (3,1) position of Q1A and the unwanted nonzeros in the (2,1),

(3,1) and (3,2) position of Q1B. The job now will be to cleverly chase the unwanted nonzero entries

and make them zero using orthogonal transformations.

To do this, Householder matrices Z1 and Z2 are �rst constructed to make B triangular, that is,

to make the nonzero entries b31; b32 and b21 zero. We then have

B � B Z1Z2 =

0BBBBBBBBBBBBBBBBB@

� � � � � � � � � � � �

0 � � � � � � � � �

0 0 � � � � � � � �

...

...

...

...

0 0 0 � � � � � � 0 �

1CCCCCCCCCCCCCCCCCA

;

607

Page 227: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

A � A Z1Z2 =

0BBBBBBBBBBBBBBBBB@

� � �� � � � � � � � � � �

� � �� � � � � � � � � � �

� � � � � � � � � � � �

� � � � � � � � � � �

0 0 � � � � � � � � � � �

0 0 0 � � � � � � � � � �

...

0 0 0 � � � � � � � �

1CCCCCCCCCCCCCCCCCA

:

(Note that we now have unwanted zeros in the (3,1), (4,1) and (4,2) positions of A.)

Next, a Householder matrix Q2 is created to introduce zeros in the (3,1) and (4,1) positions of

A; B is then updated. We now have

A � Q2 A =

0BBBBBBBBBBBBBBBBB@

� � � � � � � � � � � � �

� � �. . . � � � � � � �

0 � �. . .

. . .. . . �

0 � �. . .

. . .. . . �

0 0 0.. .

. . .. . . �

.... . .

. . .. . .

. . .. . .

...

0 0 0 0 0 � �

1CCCCCCCCCCCCCCCCCA

=

0BBBBBBBBBBBBBBBB@

� � � � � �

0

0 A0

...

...

0

1CCCCCCCCCCCCCCCCA

;

B � Q2 B =

0BBBBBBBBBBBBBBBB@

� � � � � � � � � �

0 � � � � � � � � � � �

0 � � � � � � � � � � �

0 0 �. . . � �

0 0. ..

. . . � �

......

. . .. . .

...

0 0 0 � � � 0 �

1CCCCCCCCCCCCCCCCA

=

0BBBBBBBBBBBBBBBB@

� � � � � �

0

0

0

0

... B0

0

1CCCCCCCCCCCCCCCCA

;

The process is now repeated on the submatrices A0 and B0 which have the same structures of A

and B to start with. The continuation of this process will �nally yield A1, and B1 in the desired

forms.

In view of the above discussion, let's now summarize one step of the QZ iteration.

Algorithm 9.3.1 One step of the QZ Algorithm

Given A, an unreduced upper Hessenberg matrix, and B, an upper triangular matrix, the

608

Page 228: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

following steps constitute one step of the QZ iteration; that is, these steps construct orthogonal

matrices Q and Z such that QAZ is an upper Hessenberg and QBZ is upper triangular.

1. Choose the shifts �1 and �2.

2. Compute the �rst column of N = (C � �1I)(C � �2I), where C = AB�1, without explicitly

forming B�1: Let (c1; c2) be the �rst two columns of C. Then (c1; c2) = (a1; a2)

b11 b12

0 b22

!�1

.

The three nonzero entries of the �rst column of N are given by:

x = (c11 � �1)(c11� �2) + c12c21

y = c21(c11� �2) + c21(c22� �1)

z = c21c32.

The �rst column of N = n1 =

0BBBBBBBBBBB@

x

y

z

0...

0

1CCCCCCCCCCCA.

3. Find a Householder matrix Q1 such that Q1n1 =

0BBBBB@

0...

0

1CCCCCA :

4. Form Q1A and Q1B.

5. Transform Q1A and Q1B, respectively, to an upper Hessenberg matrix A1 and a triangular

matrix B1 by orthogonal equivalence in the way shown above, by taking advantage of the

special structures of the matrices, creating orthogonal matrices Q2 through Qn�2 and Z1

through Zn�2.

Obtaining the Transforming Matrices

The transforming matrices Q and Z are obtained as follows:

The matrix Q:

Q = Q1Q2Q3 � � �Qn�2;

The matrix Z:

Z = Z1Z2 � � �Zn�2:

Note that Q has the same �rst row as Q1 .

609

Page 229: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Flop Count: One QZ step requires 13n2 op. If Q and Z are to be accumulated, then an

additional 5n2 and 8n2 ops, respectively, will be required.

Choosing the Shifts

The double shifts �1 and �2 at a QZ step can be taken as the eigenvalues of the lower 2 � 2

submatrix of C = AB�1: The 2 � 2 lower submatrix of C can be computed without

explicitly forming B�1.

Algorithm 9.3.2 The QZ Algorithm

Given A and B are n� n real matrices.

I. Transform (A;B) to a Hessenberg-Triangular pair by orthogonal equivalence:

A � QTAZ: an upper Hessenberg,

B � QTBZ: an upper Triangular.

II. Apply a sequence of the QZ steps to the Hessenberg-Triangular pair (A;B) to produce fAkg

and fBkg, with properly chosen shifts.

III. Watch the convergence of the sequences fAkg and fBkg:

fAkg �! R, Quasi-Triangular

fBkg �! T , Triangular.

Flop Count: The implementation of I to III requires about 15n3 ops. The formation of Q

and Z, if required, needs, respectively, another 8n3 and 10n3 ops (from experience it is known

that about two QZ steps per eigenvalue are adequate).

Round-o� Properties: The QZ iteration algorithm is as stable as the QR iteration algo-

rithm. It can be shown that the computed R and S satisfy

QT

0 (A+E)Z0 = R

QT

0 (B + F )Z0 = S,

where Q0 and Z0 are orthogonal and

kEk �= �kAk

and kFk �= �kBk;

� is the machine precision.

610

Page 230: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

9.4 Computations of the Generalized Eigenvectors

Once an approximate generalized eigenvalue � is computed, the corresponding generalized eigen-

vector v can be computed using the inverse iteration as before.

Algorithm 9.4.1 Computations of the Generalized Eigenvectors

1. Choose an initial eigenvector v0.

2. For k = 1; 2; : : : do

Solve (A� �B)vk = Bvk�1;

vk = vk=kvkk1.

3. Stop ifkvk � vk�1k

kvkk

� �, for a prescribed small �.

A Remark on Solving (A� �B)vk = Bvk�1.

In solving (A� �B)vk = Bvk�1, substantial savings can be made by exploiting the Hessenberg-

Triangular structure to which the pair (A;B) is reduced as a part of the QZ algorithm. Note that

for a given �, the matrix A��B is a Hessenberg matrix. Thus, at each iteration only a Hessenberg

system needs to be solved.

611

Page 231: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Example 9.4.1

A = 109

0BB@

3 �1:5 0

�1:5 3 �1:5

0 �1:5 1:5

1CCA ;

B = 103

0BB@2 0 0

0 3 0

0 0 4

1CCA :

�1 = a generalized eigenvalue of(A� �B)

= 1950800:

v0 =

0BB@1

1

1

1CCA :

k=1: Solve for v1:

Solve: (A� �1B)v1 = Bv0

v1 =

0BB@

:0170

�0:0102

0:0024

1CCA

v1 = v1=kv1k =

0BB@

:8507

�:5114

0:1217

1CCA :

9.5 The Symmetric-De�nite Generalized Eigenvalue Problem

In this section, we study the symmetric de�nite eigenvalue problem:

Ax = �Bx;

Here A and B are symmetric and B is positive de�nite.

As said before, the symmetric de�nite generalized eigenvalue problem arises in a wide variety

of engineering applications.

It is routinely solved in vibration analysis of structures.

612

Page 232: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Frequencies, Modes, and Mode Shapes

The eigenvalues are related to the natural frequencies, and \the size and sign of

each element of an eigenvector determines the shape of the vibration at any instant

of time". The eigenvectors are therefore referred to as mode shapes or simply as

modes.

\The language of modes, mode shapes, and natural frequencies form the basis for

discussing vibration phenomena of complex systems. An entire industry has been

formed around the concept of modes" (Inman (1994)).

We start with an important (but not surprising) property of the symmetric de�nite pencil.

Theorem 9.5.1 The symmetric-de�nite pencil (A� �B) has real eigenvalues and

linearly independent eigenvectors.

Proof. Since B is symmetric positive de�nite, it admits the Cholesky decomposition:

B = LLT:

So, from

Ax = �Bx

we have

Ax = �LLTx

whence

L�1A(LT )�1LT

x = �LTx;

or

Cy = �y; where y = LTx.

The matrix C = L�1A(LT )�1 is symmetric; therefore � is real. The assertion about the eigenvec-

tors is obvious, since a symmetric matrix has a set of n independent eigenvectors.

613

Page 233: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

An Interval Containing the Eigenvalues of a Symmetric De�nite Pencil

The eigenvalues of the symmetric de�nite pencil A � �B lie in the interal

[�kB�1Ak; kB

�1Ak]. (Exercise #26.)

Computational Algorithms

9.5.1 The QZ Method for the Symmetric-De�nite Pencil

The QZ algorithm described in the previous section for the regular pencil A � �B can, of course,

be applied to a symmetric-de�nite pencil. However, the drawback here is that both the symmetry

and de�niteness of the problem will be lost in general. We describe now a specialized algorithm for

a symmetric-de�nite pencil.

9.5.2 The Cholesky-QR Algorithm

The proof of Theorem 9.5.1 immediately reveals a computational method for �nding the generalized

eigenvalues of a symmetric-de�nite pencil:

614

Page 234: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Algorithm 9.5.1 The Cholesky-QR Algorithm For the Symmetric-De�nite Pencil

1. Find the Cholesky factorization of B:

B = LLT:

2. Form C = L�1A(LT )�1, by taking advantage of the symmetry of A.

3. Compute the eigenvalues and the eigenvectors yi; i = 1; : : : ; n, of the symmetric matrix C,

using the symmetric QR iteration.

4. Compute the generalized eigenvectors xi by solving: LTxi = yi, i = 1; : : : ; n.

Stability of the Algorithm

When B is well-conditioned, there is nothing objectionable in the algorithm. However, if B

is ill-conditioned or nearly singular, so will be L�1 and then the matrix C cannot be computed

accurately. Therefore, in this case, the eigenvalues and the eigenvectors will be inaccurate.

Speci�cally, it can be shown (Golub and Van Loan MC 1984, p. 310) that a computed eigenvalue

~� obtained by the algorithm is the exact eigenvalue of the matrix (L�1A(LT )�1+E), where kEk2 �

�kAk2kB�1k2. Thus, ill-conditioning of B will severely a�ect the computed eigenvalues,

even if they are themselves well-conditioned.

As we will see in the next section, in many practical applications only a few of the smallest

generalized eigenvalues are of interest. These eigenvalues sometimes can be computed reasonably

accurately, even when B is ill-conditioned, by using the ordered RSF of B in place of the Cholesky

decomposition, as follows:

Algorithm 9.5.2 Computing the Smallest Eigenvalues with Accuracy

1. Compute the Real Schur Form of B and order the eigenvalues of B from smallest to largest:

UTBU = D = diag(d1; : : : ; dn):

2. Form

L = UD�

1

2 = U diag(pd1; : : : ;

pdn)

�1:

3. Form

C = L�1AT (LT )�1

4. Compute the eigenvalues of C.

615

Page 235: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Example 9.5.1

A =

0BB@1 2 3

2 3 4

3 4 5

1CCA ; B =

0BB@1 0 0

0 :00001 0

0 0 1

1CCA :

Cond(B) = 105:

1.

UTBU = D =

0BB@:00001 0 0

0 1 0

0 0 1

1CCA ; U =

0BB@0 1 0

1 0 0

0 0 1

1CCA :

2.

L = UD�

1

2 =

0BB@

0 1 0

316:2278 0 0

0 0 1

1CCA :

3.

C = L�1AT (LT )�1 =

0BB@0:0003 0:0063 0:0126

0:0063 1 3

0:0126 3 5

1CCA :

4. The eigenvalues of C are: 0;�0:6055; 6:6055.

5. The two smallest generalized eigenvalues are: 0;�0:6665.

Remark: Two smallest generalized eigenvalues have been computed by the procedure rather

accurately. However, the largest one is completely wrong.

This example shows how ill-conditioning of B can impair the occuracy of the computed eigen-

values.

9.5.3 Diagonalization of the Symmetric-De�nite Pencil

Simultaneous Diagonalization of A and B

The Cholesky-QR iteration algorithm of the symmetric-de�nite pencil gives us a method to �nd

a nonsingular matrix P that transforms A and B simultaneously to diagonal forms by congruence.

This can be seen as follows:

Let Q be an orthogonal matrix such that

QTCQ = diag(c1; : : : ; cn):

616

Page 236: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Set P = (L�1)TQ. Then

PTAP = Q

TL�1A(L�1)TQ = Q

TCQ = diag(c1; c2; : : : ; cn);

and

PTBP = Q

TL�1B(L�1)TQ = Q

TL�1LL

T (L�1)TQ = I:

Algorithm 9.5.3 Simultaneous Diagonalization of a Symmetric De�nite Pencil

Given a symmetric matrix A and a symmetric positive de�nite matrix B, the following algorithm

computes a nonsingular matrix P such that PTBP is the identity matrix and P

TAP is a diagonal

matrix.

1. Compute the Cholesky factorization of B:

B = LLT:

2. Form C = L�1A(LT )�1, by taking advantage of the symmetry of A (C is symmetric).

3. Applying the symmetric QR iteration algorithm to C, �nd an orthogonal matrix Q such that

QTCQ is a diagonal matrix.

4. Form P = (L�1)TQ.

Flop Count: The algorithm for simultaneous diagonalization requires 7n3 ops.

Example 9.5.2

Consider

B =

0BB@10 1 1

1 10 1

1 1 10

1CCA ; A =

0BB@1 2 3

2 3 4

3 4 5

1CCA

A is symmetric and B is symmetric positive de�nite.

1. The Cholesky decomposition of B = LLT :

L =

0BB@3:1623 0 0

:3162 3:1464 0

:3162 :2860 3:1334

1CCA

617

Page 237: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

2. Form C = L�1A(L�1)T

C =

0BB@0:1000 0:1910 :2752

0:1910 0:2636 0:3320

0:2752 0:3320 0:3864

1CCA

3. Find an orthogonal Q such that

QTCQ = diag(c1; : : : ; cn)

Q =

0BB@

:4220 �0:8197 �0:3873

:5684 �0:0936 0:8174

0:7063 0:5651 �0:4262

1CCA

4. Form

P = (L�1)TQ =

0BB@:09409 �0:2726 �0:1361

:1601 �0:0462 0:2722

0:2254 0:1803 �0:1361

1CCA

5. Verify:

PTAP = diag(:8179;�0:0679; 0):

PTBP = Identity = diag(1; 1; 1):

Modal Matrix

In vibration problems involving the mass and sti�ness matrices, that is, when K is the sti�ness

matrix and M is the mass matrix in the symmetric-de�nite generalized eigenvalue problem:

Kx = �Mx

the matrix P that simultaneously diagonalize M and K, respectively, to the identity and a diagonal

matrix, is called the modal matrix, and the columns of the matrix P are called the normal

modes.

Orthogonality of the Eigenvectors

Note that if p1; : : : ; pn are the columns of P , then it is easy to see that

pT

iBpi = 1; i = 1; : : : ; n

pT

iBpj = 0; i 6= j:

and

pT

iApi = ci; i = 1; : : : ; n

pT

iApj = 0; i 6= j:

618

Page 238: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Generalized Rayleigh-Quotient

The Rayleigh-Quotient de�ned for a symmetric matrix A in Chapter 8 can easily be generalized

for the pair (A;B).

De�nition 9.5.1 The number

� =xTAx

xTBx

(kxk2 = 1);

is called the generalized Rayleigh quotient.

It can be used to compute approximations to generalized eigenvalues �k and eigenvectors xk for

the symmetric de�nite generalized eigenvalue problem, as shown in the following algorithm.

Algorithm 9.5.4 Generalized Rayleigh Quotient Iteration

Choose x0 such that kx0k = 1:

For k = 0; 1; : : : do until convergence occurs

1. Compute �k =xT

kAxk

xT

kBxk

:

2. Solve for xk+1:

(A� �kB)xk+1 = Bxk

3. Normalize xk+1 :

xk+1 =xk+1

kxk+1k2

:

9.6 Symmetric-De�nite Generalized Eigenvalue Problems Arising in Vibrations

of Structures

As we stated earlier, almost all eigenvalue problems arising in vibrations of structures are the

symmetric-de�nite generalized eigenvalue problems. We will now give some speci�c examples.

9.6.1 A Case Study on the Vibration of a Spring-Mass System

Consider the system of three spring masses shown in Figure 9.1 with spring constants k1; k2 and

k3. We would like to study the con�guration of the system corresponding to the di�erent modes of

vibration.

619

Page 239: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

3

2

1

3

2

1

3

2

1

y

y

y

k

k

k

m

m

m

Figure 9.1 3 Degrees of Freedom

1. Formulate the problem as a Symmetric De�nite

Generalized Eigenvalue Problem

Let the displacements of the masses from static equilibrium positions be de�ned by the general-

ized coordinates y1; y2; and y3, respectively. The sti�ness matrices are very often determined using

physical characteristics of the systems. The generalized eigenvalues and eigenvectors are then used

to study the behavior of the system.

The equations of motion for the system can be written as:

m1�y1 + (k1 + k2)y1 � k2y2 = 0

620

Page 240: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

m2�y2 � k2y1 + (k1 + k2)y2 � k3y3 = 0

m3�y3 � k3y2 + k3y3 = 0

or, in matrix form,0BB@m1 0 0

0 m2 0

0 0 m3

1CCA0BB@�y1

�y2

�y3

1CCA +

0BB@k1 + k2 �k2 0

�k2 k2 + k3 �k3

0 �k3 k3

1CCA0BB@y1

y2

y3

1CCA =

0BB@0

0

0

1CCA ;

that is,

M �y +Ky = 0;

where M = diag(m1; m2; m3); and

K =

0BB@k1 + k2 �k2 0

�k2 k2 + k3 �k3

0 �k3 k3

1CCA :

Assuming harmonic motion, we can write

y1 = x1 ei!t

y2 = x2 ei!t

y3 = x3 ei!t

where x1; x2 and x3 are, respectively, the amplitudes of the masses, m1, m2 and m3, and !

denotes the natural angular frequency. Substituting these expressions for y1; y2 and y3 into the

equations of motion, and noting that

�yk = �!2xke

i!t; k = 1; 2; 3;

we have

�m1x1!2 + (k1 + k2)x1 � k2x2 = 0

�m2x2!2� k2x1 + (k1 + k2)x2 � k3x3 = 0

�m3x3!2� k3x2 + k3x3 = 0

which can be written in matrix form as:0BB@k1 + k2 �k2 0

�k2 k1 + k2 �k3

0 �k3 k3

1CCA0BB@x1

x2

x3

1CCA = !

2

0BB@m1 0 0

0 m2 0

0 0 m3

1CCA0BB@x1

x2

x3

1CCA

621

Page 241: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

or

Kx = �Mx

where � = !2. The eigenvalues �i = !

2i; i = 1; 2; 3 are the squares of the natural frequencies

of the �rst, second, and third modes of vibration, respectively.

2. Solve the Generalized Eigenvalue Problem

Using the Cholesky-QR Algorithm

Let's take m1 = 20000; m2 = 30000; m3 = 40000; k1 = k2 = k3 = 109 � 1:5. Then

M = diag(20000; 30000; 40000)

K = 109

0BB@

3 �1:5 0

�1:5 3 �1:5

0 �1:5 1:5

1CCA

L =

0BB@141:4214 0 0

0 173:2051 0

0 0 200:000

1CCA

C = 105

0BB@

1:5 �:6124 0

�:6124 1 �:4330

0 �:4330 :3750

1CCA

The generalized eigenvalues = the eigenvalues of C are: 105(1:9508; :8382; :0860).

The natural frequencies are: 102(4:4168; 2:8951; 0:9273).

The generalized eigenvectors are:0BB@

0:0056 �0:0040 0:0017

�0:0034 �0:0035 0:0031

0:0008 0:0028 0:0040

1CCA :

These eigenvectors can be used to determine di�erent con�gurations of the system for

di�erent modes. That is, they can be used to see how the structures vibrates under

di�erent modes.

9.6.2 A Case Study on the Vibration of a Building

Consider a four-story reinforced concrete building as shown in the �gure below. The oors and

roofs, which are fairly rigid are represented by lumped masses m1 tom4 having a horizontal motion

caused by shear deformation of columns, and k1 to k4 are equivalent spring constants of columns

that act as springs in parallel.

622

Page 242: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Figure 9.2 Schematic of 4-story building

1

2

3

4

1

2

4

3

k

k

k

k

m

m

m

m

y

y

y

y4

3

2

1

We would like to study the con�guration when the building is vibrating in its �rst two modes

(corresponding to two smallest eigenvalues).

1. Formulate the problem as a symmetric-de�nite generalized eigenvalue problem in

terms of mass and sti�ness matrices:

Kx = �Mx:

As in the previous example, M is diagonal and K is tridiagonal:

M = diag(m1; m2; m3; m4)

K =

0BBBBB@

k1 + k2 �k2 0 0

�k2 k2 + k3 �k3 0

0 �k3 k3 + k4 �k4

0 0 �k4 k4

1CCCCCA :

Taking m1 = 5 � 107; m2 = 4 � 107; m3 = 3� 107; m4 = 2 � 107, and k1 = 10 � 1014; k2 =

623

Page 243: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

8� 1014, k3 = 6� 1014; k4 = 4� 1014, we have

K = 1014

0BBBBB@

18 �8 0 0

�8 14 �6 0

0 �6 10 �4

0 0 �4 4

1CCCCCA

and

M = 107diag(5; 4; 3; 2):

2. Find the generalized eigenvalues and eigenvectors using the Cholesky-QR algorithm.

L = 103

0BBBBB@

7:0711 0 0 0

0 6:3246 0 0

0 0 5:4772 0

0 0 0 4:4721

1CCCCCA

C = 107

0BBBBB@

3:6 �1:7889 0 0

�1:7889 3:5000 �1:7321 0

0 �1:7321 3:3333 �1:6330

0 0 �1:6330 2:000

1CCCCCA :

The eigenvalues of C which are the generalized eigenvalues, are:

107

0BBBBB@

6:1432

1:8516

0:3435

4:0950

1CCCCCA :

The corresponding generalized eigenvectors are:

10�3

0BBBBB@

:0666

�0:1058

0:0977

�0:0472

1CCCCCA ; 10�3

0BBBBB@

�0:0785

�0:0858

0:0104

0:1403

1CCCCCA ; 10�3

0BBBBB@

0:0370

0:0753

0:1091

0:1318

1CCCCCA ; 10�3

0BBBBB@

0:0896

�0:02777

�0:1085

0:1036

1CCCCCA :

The eigenvectors corresponding to the two smallest eigenvalues 107(:3435)and 107(1:8516) are:

10�3

0BBBBB@

0:0370

0:0753

0:1091

0:1318

1CCCCCA ; 10�3

0BBBBB@

�0:0785

�0:0858

0:0104

0:1403

1CCCCCA :

The �rst two modes of vibration are shown in Figures 9.3 and 9.4, respectively.

624

Page 244: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

1

1

12

2 23

3 34

44

k

k

k

k

m

m

m

mx

x

x

x

Figure 9.3 First Mode of Vibrationof 4-Story Building

x

x

x

4x

1

2

3

k3

4k

1

12

2

3

4

k

km

m

m

m

of 4-Story BuildingFigure 9.4 Second Mode of Vibration

9.6.3 Forced Harmonic Vibration

In the previous two examples, we considered vibration of systems without any external force.

Consider now a system with two degrees of freedom excited by a harmonic force F1 sin!t, as shown

in Figure 9.5.

625

Page 245: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

t

a 2 degree of freedom system

ωsin1

F

2

1

2

1

y

y

k

k

k

m

m

Figure 9.5 Forced vibration of

Then the di�erential equations of motion for the system become

m1�y1 = �k(y1 � y2)� ky1 + F1 sin!t

m2�y2 = k(y1 � y2)� ky2

or "m1 0

0 m2

#(�y1

�y2

)+

"2k �k

�k 2k

#(y1

y2

)=

(F1

0

)sin!t: (9.6.1)

Assuming the solution to be y1

y2

!=

x1

x2

!sin!t

and substituting into the equations we get

(2k�m1!2)x1 � kx2 = F1

�kx1 + (2k �m2!2)x2 = 0:

In matrix form, "(2k �m1!

2) �k

�k (2k �m2!2)

#(x1

x2

)=

(F1

0

):

These equations can be easily solved to obtain explicit expressions for the amplitudes x1 and x2:

x1 =(2k�m2!

2)F1

m1m2(!21 � !

2)(!22 � !

2)(9.6.2)

x2 =kF1

m1m2(!21 � !

2)(!22 � !

2)(9.6.3)

626

Page 246: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

where !1 and !2 are the modal frequencies. For the special case when m1 = m2 = m, !1 and !2

are given by

!1 =

sk

m

and !2 =

s3k

m

and x1 and x2 are given by

x1 =(2k�m!

2)F1

m2(!2

1 � !2)(!2

2 � !2);

x2 =kF1

m2(!2

1 � !2)(!2

2 � !2):

(9.6.4)

From above, it follows immediately that whenever ! is equal to or close to !1 or !2, the amplitude

becomes arbitrarily large, signaling the occurrence of resonance. Note that in this case, the

denominator is zero or close to it. This situation is very alarming to an engineer.

In other words, if the frequency of the imposed periodic force is equal or nearly

equal to one of the natural frequencies of a system, resonance results, a situation which

is quite alarming.

Example 9.6.1

To demonstrate the consequences of excitation at or near resonance, let us consider an airplane

landing on a rough runway. The fuselage and engine are assumed to have a combined mass m1.

The wings are modeled by lumped masses m2 and m3, and sti�ness k2 and k3; k1 represents the

combined sti�ness of the landing gear and tires. The masses of the wheels and landing gear are

assumed negligible compared to the mass of the fuselage and the wings. The system is modeled in

Figure 9.6.

627

Page 247: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

y

y

Figure 9.6 Airplane landing on a runway

v

0

l = 20 m

The runway is modeled by a sinusoidal curve as shown in the Figure 9.6. Let the contour be

described by y = y0 sin!t, and let the airplane be subjected to a forcing input of f1 sin!t, where

f1 = k1y0. The equations of motion for the 3 degree of freedom system so described are given by:2664m1 0 0

0 m2 0

0 0 m3

37758>><>>:�y1

�y2

�y3

9>>=>>;+

2664k1 + k2 + k3 �k2 �k3

�k2 k2 0

�k3 0 k3

37758>><>>:y1

y2

y3

9>>=>>; =

8>><>>:f1 sin!t

0

0

9>>=>>; :

The airplane is shown schematically in Figure 9.7, where m1 represents the mass of the fuselage,

m2 and m3 represent the lumped masses of the wings. The combined sti�ness of the landing gear

and tires is denoted by k1, and k2 and k3 are the sti�nesses of the wings. Finally, y1, y2, and y3

represent motion relative to the ground.

628

Page 248: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Figure 9.7 Model of the airplane

y

1

22

1

3

3

k

kky

y

y

23 1m mm

Let

k1 = 1:7� 105N/m

k3 = k2 = 6� 105N/m

m1 = 1300kg

m2 = m3 = 300kg:

The natural frequencies obtained by solving the generalized eigenvalue problem: Kx = �Mx =

!2Mx are given by:

!1 = 9:39 rad/sec

!2 = 44:72 rad/sec

!3 = 54:46 rad/sec:

The forcing frequency ! is related to the landing velocity v by v = !`=2�. So if ! = !1,

v =!1`

2�=

9:39� 20m/sec

2�= 29:8m/sec = 107km/hr:

Thus, if the landing velocity is 107 km/hr, or close to it, there is danger of excitation at or near

the resonance.

9.7 Applications to Decoupling and Model Reduction

We have already seen how generalized eigenvalue problems arise in applications. In this section

we will mention a few more engineering applications. These include decoupling of a second-order

system of di�erential equations, and model reduction.

629

Page 249: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

9.7.1 Decoupling of a Second-Order System

Case 1. The Undamped System

As we have seen before, vibration problems in structural analysis give rise to a homogeneous system

of di�erential equations of second order of the form:

M �y +Ky = 0; (9.7.1)

where

�y =d2y

dt2

and

y =

0BBBBB@

y1

y2

...

yn

1CCCCCA

is an n-vector. The matrices M and K are, as usual, the mass and sti�ness matrices. Assuming

that these matrices are symmetric and M is positive de�nite, we will now show how the simulta-

neous diagonalization technique described earlier can be pro�tably employed to solve this system

of second-order equations.

The idea is to decouple the system into n uncoupled equations so that each of these uncoupled

equations can be solved using a standard technique. Let P be the modal matrix such that:

PTMP = I; (9.7.2)

PTKP = � = diag(!2

1; : : : ; !2n): (9.7.3)

Let y = Pz, so the homogeneous system

M �y +Ky = 0

becomes

MP �z +KPz = 0:

Next premultiplying by PT ,

PTMP �z + P

TKPz = 0

or

�z +�z = 0:

The homogeneous system therefore decouples:

�zi + !2izi = 0; i = 1; 2; : : : ; n:

630

Page 250: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

or

�z1 + !21z1 = 0

�z2 + !22z2 = 0

...

�zn + !2nzn = 0

; (9.7.4)

where

z =

0BBBBB@

z1

z2

...

zn

1CCCCCA ; � = diag(!2

1 ; !22; : : : ; !

2n):

The solution of the original system now can be obtained by solving these n decoupled equations

using standard techniques and then recovering the original solution y from

y = Pz:

Thus, if the solutions of the transformed system (9.7.4) are given by

zi = Ai cos!it +Bi sin !it; i = 1; 2; � � � ; n;

then the solutions of the original system (9.7.1) are given by

0BBBBB@

y1

y2

...

yn

1CCCCCA = P

26666664

A1 cos!1t +B1 sin!1t

A2 cos!2t +B2 sin!2t...

An cos!nt +Bn sin!nt

37777775: (9.7.5)

The constants Ai and Bi are to be determined from the initial conditions such as:

yijt=0 = displacement at time t = 0

_yijt=0 = initial velocity.

Example 9.7.1

Consider the system with three masses in the example of the Section 9.6.1. Suppose that the

system, when released from rest at t = 0, is subjected to the displacement as given below:

We would like to �nd the undamped time response of the system. The initial conditions are:

y1 = 1

y2 = 2

y3 = 3

37775

_y1 = 0

_y2 = 0

_y3 = 0

:

631

Page 251: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Since the initial velocities are zeros, we obtain

_y1 = PB1!1 = 0

_y2 = PB2!2 = 0

_y3 = PB3!3 = 0:

These give B1 = B2 = B3 = 0.

Again, at t = 0, we have 0BB@y1

y2

y3

1CCA = P

0BB@A1

A2

A3

1CCA =

0BB@1

2

3

1CCA :

Recall that for this problem

P =

0BB@

0:0056 �0:0040 0:0017

�0:0034 �0:0035 0:0031

0:0008 0:0028 0:0040

1CCA :

Then the solution of the linear system

P

0BB@A1

A2

A3

1CCA =

0BB@1

2

3

1CCA

is

A1 = 2:5154

A2 = 55:5358

A3 = 710:6218:

Substituting these values of A1; A2; A3 and the values of !1; !2; and !3 obtained earlier in

y = Pz

or 0BB@y1

y2

y3

1CCA = P

0BB@z1

z2

z3

1CCA = P

0BB@A1 cos!1t

A2 cos!2t

A3 cos!3t

1CCA ;

we obtain the values of y1; y2; and y3 that give the undamped time response of the systems subject

to the given initial conditions.

632

Page 252: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Case 2. The Damped System Space

Some damping, such as that due to air resistance, uid and solid friction, etc., is present in all real

systems. Let us now consider damped homogeneous systems.

Let D be the damping matrix. Then the equations of motion of the damped system becomes

M �y +D _y +Ky = 0: (9.7.6)

Assume that D is a linear combination of M and K; that is

D = �M + �K; (9.7.7)

where � and � are constants. Damping of this type is called proportional orRayleigh damping.

Let P be the modal matrix. Then we have

PTDP = �P

TMP + �P

TKP

= �I + ��:

Let z = PTy. Then the above homogeneous damped equations are transformed to n decoupled

equations:

�zi + (�+ �!2i) _zi + !

2izi = 0; i = 1; 2; : : : ; n: (9.7.8)

In engineering practice it is customary to assume modal damping. In modal damping, the

damping is proportional to mass or sti�ness or a combination of them in a certain special manner.

Let � and � be chosen so that

� + �!2i= 2�i!i:

�i is called the modal damping ratio of the ith mode. �i is usually taken as a small number

between 0 and 1. The most common values are 0 � � � 0:05. (See Inman (1994), pp. 196.)

However, in some applications, such as in the design of exible structures, f�ig are taken to be as

low as 0.005. On the other hand, for an automatic shock absorber, a value as high as � = 0:5 is

possible.

Assuming modal damping, the decoupled equations (9.7.8) become:

�zi + 2�i!i _zi + !2izi = 0; i = 1; 2; : : : ; n:

The solutions of these equations are then given by

zi = e��i!it

�Ai cos!i

q1� �

2it+ Bi sin!i

q1� �

2it

�; i = 1; 2; : : : ; n;

where the constants Ai and Bi are to be determined from the given initial equations.

The original system can now be solved by solving these n uncoupled equations separately, and

then recovering the original solution y from y = Pz.

633

Page 253: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Example 9.7.2 Usefulness of Proportional Damping

Consider the following system with two degrees of freedom (DOF). We will show here why

proportional damping is useful.

2mm

2k

321

kk

d d d

y y1 2

The equations of motion of the system are developed by considering a free body diagram for

each mass.

For mass m:

�ky1

�d1 _y1

m -k(y2 � y1)

-d2( _y2 � _y1)

) -m�y1

The equation of motion for this mass is:

�d1 _y1 + d2( _y2 � _y1)� ky1 + k(y2 � y1) = m�y1

or

m�y1 + (d1 + d2) _y1 � d2 _y2 + 2ky1 � ky2 = 0:

634

Page 254: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

For mass 2m:

�k(y2 � y1)

�d2( _y2 � _y1)

2m � 2ky2

�d3 _y2

) - 2m�y2

The equation of motion for this mass is:

�d2( _y2 � _y1)� d3 _y2 � k(y2 � y1)� 2ky2 = 2m�y2

or

2m�y2 � d2 _y1 + (d2 + d3) _y2 � ky1 + 3ky2 = 0:

Thus, for the whole system we have"m 0

0 2m

#(�y1

�y2

)+

"d1 + d2 �d2

�d2 d2 + d3

#(_y1

_y2

)+

"2k �k

�k 3k

#(y1

y2

)=

(0

0

):

Let k = 2 and m = 5, and assume that D = �M + �K: Consider now two cases. For this 2

DOF system, the mass matrix

M =

"m 0

0 2m

#=

"5 0

0 10

#;

the sti�ness matrix

K =

"2k �k

�k 3k

#=

"4 �2

�2 6

#;

and the damping matrix

D =

"d1 + d2 �d2

�d2 d2 + d3

#:

Case 1: d1 = 1; d2 = 1; d3 = 2"2 �1

�1 3

#= �

"5 0

0 10

#+ �

"4 �2

�2 6

#:

2 = 5�+ 4� (9.7.9)

�1 = �2� (9.7.10)

3 = 10�+ 6� (9.7.11)

Equations (9.7.9), (9.7.10) and (9.7.11) are uniquely satis�ed with � =1

2and � = 0. So, this is a

case of proportional damping.

635

Page 255: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Case 2: d1 = 2; d2 = 4; d3 = 1"6 �4

�4 5

#= �

"5 0

0 10

#+ �

"4 �2

�2 6

#

6 = 5�+ 4� (9.7.12)

�4 = �2� (9.7.13)

5 = 10�+ 6�: (9.7.14)

Now equations (9.7.12), (9.7.13) and (9.7.14) cannot all be satis�ed with any set of values of � and

�. This is a case of nonproportional damping.

In the �rst case, the equations of motion can be decoupled using y = Pz, obtaining

real mode shapes and real natural frequencies. However, in the second case, such de-

coupling is not possible. This type of damping will lead to complex natural frequencies

and mode shapes.

Damped Systems Under Force Excitation

When a damped system is subject to an external force F , the equations of motion are given by

M �y +D _y +Ky = F (t) =

8>>>>><>>>>>:

F1(t)

F2(t)...

Fn(t)

9>>>>>=>>>>>;: (9.7.15)

Assuming that M is symmetric positive de�nite, K is symmetric, and damping is proportional,

it is easy to see from our previous discussion that the above equations can be decoupled using

simultaneous diagonalization.

Let P = (pij) be the modal matrix. Then

PTF =

0BBBBBBBBBBB@

p11 p21 � � � pn1

p12 p22 � � � pn2

...... � � �

...

p1i p2i � � � pni

...... � � �

...

p1n p2n � � � pnn

1CCCCCCCCCCCA

0BBBBBBBBBBB@

F1

F2

...

Fi

...

Fn

1CCCCCCCCCCCA:

The decoupled equations will then be given by

�zi + 2�i!i _zi + !2izi = p1iF1 + p2iF2 + � � �+ pniFn;

636

Page 256: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

or

�zi + 2�i!i _zi + !2izi = Ei(t); (9.7.16)

where Ei(t) =

nXj=1

pjiFj; i = 1; 2; : : : ; n:

The function Ei(t) is called the exciting or forcing function of the ith mode. If each force Fi

is written as

Fi = fis(t);

then

Ei(t) = s(t)

nXj=i

pjifj :

De�nition 9.7.1 The expressionnX

j=1

pjifi

is called the mode participation factor for the ith mode.

Once the decoupled equations are solved for zi we can recover the solutions of the original

equations from:

y = Pz

or 0BBBBB@

y1

y2

...

yn

1CCCCCA = P

0BBBBB@

z1

z2

...

zn

1CCCCCA :

The solutions of the decoupled equations

�zi + 2�i!i _zi + !2izi = Ei(t)

depend upon the nature of the force F (t). For example, when the force is a shock type force, such

as an earthquake, etc., one is normally interested in maximum responses, and the maximum values

of z1; z2; : : : ; zn can be obtained from the responses of a single equation of one degree of freedom

(see the example below).

9.7.2 The Reduction of a Large Model

Many applications give rise to a very large system of second order di�erential equations:

M �y +D _y +Ky = F (y; t): (9.7.17)

637

Page 257: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

For example, the large space structure (LSS) is a distributed parameter system. It is therefore

in�nite dimensional in theory, but of very large dimension in practice. A �nite element generated

reduced order model can be a large second order system. The dimension of the problem in such

an application can be several thousand. Naturally, the solution of a large system will lead to

a solution of a very large generalized eigenvalue problem. Unfortunately, e�ective numerical

techniques for computing a large number of generalized eigenvalues and eigenvectors

are virtually nonexistent and not very well developed (see the section on the Generalized

Symmetric Eigenvalue Problem for Large and Structure Matrices). It is therefore natural to think

of solving the problem by constructing a reduced-order model with the help of a few eigenvalues

and eigenvectors which are feasible to compute. Such a thought is based on an assumption that in

many instances the response of the structure depends mainly on a �rst couple of eigenvalues (low

frequencies); usually the higher modes do not get excited.

We will now show how the computations can be simpli�ed by using only the knowledge of a few

eigenvalues and eigenvectors.

Suppose that, under the usual assumption that M and K are symmetric and of order n and M

is positive de�nite, we were able to compute only the �rst few normal modes, perhaps m of them

where m� n. Let the matrix of these normal modes be Pn�m: Then

PTMP = Im�m

PTKP = �m�m = diag(!2

1; : : : ; !2m):

Setting y = Pz and assuming that the damping is proportional to mass or sti�ness, the system of

n di�erential equations (9.7.17) then reduces to m equations:

�zi + 2�i!i _zi + !2izi = Ei(t); i = 1; 2; : : : ; m;

where Ei is the ith coordinate of the vector PT

F . Once this small number of equations is solved,

the displacement of any masses under the external force can be computed from:

yi = Pzi; i = 1; : : : ; n:

Sometimes only the maximum value of the displacement is of interest.

Several vibration groups in industry and the military use the following approximation to obtain

the maximum value of yi (see Thompson (1988)):

jyijmax = jp1z1(max)j+

vuut mXj=2

jpjzj(max)j2;

where pi is the ith column of P evaluated at zi.

638

Page 258: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

9.7.3 A Case Study on the Potential Damage of a Building Due to an Earthquake

Suppose we are interested in �nding the absolute maximum responses of the four-story building

considered in the example of section 9.6.2, when the building will be subjected to a strong earth-

quake, using the known response of the building due to a previous earthquake. We will use only

the �rst two modes (the modes corresponding to the two lowest frequencies) in our

calculations.

In the �gure, the yi; i = 1; : : : ; 4 denote the displacement of each oor relative to the moving

support, whose motion is denoted by y0.

an earthquakeFigure 9.8 Building subject to

4

4k

y

1k

1

2k

2

3k

3y

y

y

y0

The decoupled normal mode equations in modal form in this case can be written as:

�zi + 2�i!i _zi + !2izi = �Ei�y0; i = 1; 2;

where

�y0 = absolute acceleration of the moving support,

Ei =4X

j=1

pjimj = mode participation factor of the chosen mode pi due to support existence.

639

Page 259: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

pji are the coordinates of the participating mode Pi, that is,

P = (p1; p2) =

2666664

0BBBBB@

p11

p21

p31

p41

1CCCCCA ;

0BBBBB@

p12

p22

p32

p42

1CCCCCA

3777775 ;

where p1 and p2 are the two chosen participating modes.

Let R1 and R2 denote the maximum relative responses of z1(max) and z2(max) obtained from

previous experience. Then we can take

z1(max) = E1R1

z2(max) = E2R2:

This observation immediately gives:

0BBBBBB@

y1

y2

y3

y4

1CCCCCCA

max

= E1R1

0BBBBBB@

p11

p21

p31

p41

1CCCCCCA+E2R2

0BBBBBB@

p12

p22

p32

p42

1CCCCCCA:

Using now the data of the example in section 9.6.2, we have

m1 = 107(5); m2 = 107(4); m3 = 107(3); m4 = 107(2):

p1 = the eigenvector corresponding to the smallest eigenvalue

= 10�3

0BBBBB@

0:0370

0:0753

0:1091

0:1318

1CCCCCA

p2 = the eigenvector corresponding to the second smallest eigenvalue

= 10�3

0BBBBB@

�0:0785

0:0858

0:0104

0:1403

1CCCCCA

E1 = m1p11 +m2p21 +m3p31 +m4p41 = 104(1:0772)

E2 = m1p12 +m2p22 +m3p32 +m4p42 = 103(�4:2417)

640

Page 260: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Assume that R1 = 1:5 inches, R2 = :25 inches. We obtain0BBBBB@

y1

y2

y3

y4

1CCCCCA

max

= 10�3:104(1:0772)(1:5)

0BBBBB@

0:0370

0:0753

0:1091

0:1318

1CCCCCA

+ 10�3:103(�4:2417)(:25)

0BBBBB@

�0:0785

0:0858

0:0104

0:1403

1CCCCCA

=

0BBBBB@

0:5979

1:2169

1:7636

2:1293

1CCCCCA +

0BBBBB@

0:0833

0:0910

�0:0110

�0:1488

1CCCCCA

=

0BBBBB@

0:6812 in.

1:3079 in.

1:7526 in.

1:9805 in.:

1CCCCCA

Thus, the absolute maximum displacement (relative to the moving support) of the �rst oor is

0.6812 in., that of the second oor is 1.3079 in., etc.

The absolute maximum relative displacements are obtained by adding the terms using their

absolute values: 0BBBBB@

y1

y2

y3

y4

1CCCCCA

(abs. max.)

=

0BBBBB@

0:6812 in.

1:3079 in.

1:7747 in.

2:2781 in.

1CCCCCA

641

Page 261: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

y

y

y

y

1

1

12

2 2 3

3 34

44

k

k

k

k

m

m

m

m

Figure 9.9 Absolute maximum displacement

Note: The contribution to the second participating mode to responses is small in comparison

with the contribution of the �rst mode.

Average Maximum Relative Displacement of the Masses

The absolute maximum relative displacement of the masses provides us with an upper bound

for the largest relative displacements the masses can have, and thus help us to choose design

parameters. Another practice for such a measure in engineering literature has been to use the root

sum square of the same terms, giving the \average" maximum relative displacement values:

(yi)average max =q(E1R1pi1)2 + (E2R2pi2)2 + � � �+ (EkRkPik)2

For the above example, k = 2 and the average maximum relative displacements are given by

(y1)average max =q(E1R1p11)2 + (E2R2p12)2 = :9975 inches;

(y2)average max =q(E1R1p21)2 + (E2R2p22)2 = 1:5610 inches;

and so on.

642

Page 262: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

9.8 The Quadratic Eigenvalue Problem

So far we have considered the second-order system:

M �y +D _y +Ky = 0 (9.8.1)

under the assumption of proportional or modal damping. This assumption let us use the simulta-

neous diagonalization on M; K; and D (see Section 9.7.1, Case 2), which, of course, as we have

seen in Section 9.5, amounts to solving a generalized eigenvalue problem.

In case of general damping, we will, however, have the quadratic eigenvalue problem:

(�2M + �D +K)x = 0:

This problem has 2n eigenvalues and there are 2n eigenvectors corresponding to them. We de-

scribe two existing approaches to solve this quadratic eigenvalue problem and show how to extract

frequencies and from these eigenvalues and eigenvectors. We assume, as before, M is symmetric

positive de�nite.

Approach 1: Reduction to a standard Eigenvalue Problem.

Multiplying both sides of the equation (9.8.1). by M�1 we have

�y +M�1D _y +M

�1Ky = 0: (9.8.2)

Write

_y = _z1 = z2 (9.8.3)

Then

�y = _z2 = �M�1D _y �M

�1Ky (from 9.8.2)

= �M�1Dz2 �M

�1Kz1 (from 9.8.3)

(9.8.4)

The equations (9.8.3) and (9.8.4) can now be combined into the single matrix equation: _z1

_z2

!=

0 I

�M�1K �M

�1D

! z1

z2

!(9.8.5)

That is

_z = Az (9.8.6)

where

z =

z1

z2

!; and A =

0 I

�M�1K �M

�1D

!: (9.8.7)

Assuming a solution of the equation (9.8.6) of the form z = xe�t, we have the standard eigenvalue

problem:

Ax = �x; (9.8.8)

643

Page 263: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

where A is 2n�2n as given by 9.8.7. There are 2n eigenvalues �i; i = 1; :::; 2n of the above problem

and 2n corresponding eigenvectors.

If the second-order system is the model of a vibrating structure, then the natural frequencies

and the modal damping ratios can be computed from the eigenvalues and eigenvectors as follows.

Computing Frequencies and Damping Ratios

Let �k = �k + i�k, that is, �k and �k are, respectively, the real and imaginary part

of the complex eigenvalue �k. Then the natural frequencies !k are given

!k =q�2k+ �

2k; k = 1; 2; :::; n: (9.8.9)

(See Inman (1994), pp. 462). Note that the eigenvalues �k occur in complex-

conjugate pairs.

The modal damping ratios are given by:

�k =��kp�2k+ �

2k

: (9.8.10)

Approach 2: Reduction to a Symmetric Generalized Eigenvalue Problem

Let's substitute z1 = y and z2 = _y into

M �y +D _y +Ky = 0;

then

M _z2 = �Dz2 �Kz1: (9.8.11)

Again, since

_z1 = _y = z2

we can write

�K _z1 = �Kz2 (9.8.12)

Combining (9.8.11) and (9.8.12) we get

�K 0

0 M

! _z1

_z2

!=

0 �K

�K �D

! z1

z2

!(9.8.13)

644

Page 264: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

That is

B _z = Az (9.8.14)

where

A =

0 �K

�K �D

!; B =

�K 0

0 M

!z =

z1

z2

!(9.8.15)

Assuming again a solution of (9.8.14) of the form z = xe�t, the equation (9.8.14) yields the gener-

alized eigenvalue problem:

Ax = �Bx; (9.8.16)

where A and B are both symmetric and are given by (9.8.15).

Since A and B are both 2n � 2n, the solution of (9.8.16) will give 2n eigenvalues and eigen-

vectors. The natural frequencies and modal damping ratios can be extracted from the

eigenvalue as in Approach 1.

Summary: The quadratic eigenvalue problem

(�2M + �D+K)x = 0

can be either reduced to the standard nonsymmetric eigenvalue problem:

Ax = �x

where

A =

0 I

�M�1K �M

�1D

!

or to the generalized symmetric eigenvalue problem:

Ax = �Bx

where

A =

0 �K

�K �D

!; B =

�K 0

0 M

!:

Once the eigenvalues and eigenvectors are computed, the natural frequencies and the modal damp-

ing ratios of a vibrating structure whose mathematical model is the second-order system (9.8.1)

can be computed using (9.8.9) and (9.8.10), respectively.

A Word of Caution About Using Approach 1

If M is ill-conditioned, the explicit formation of the matrix A given by (9.8.7) by actually

computing M�1 will be computationally disastrous. A will be computed inaccurately and so will

be the eigenvalues and eigenvectors. Also note that A is nonsymmetric.

645

Page 265: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

9.9 The Generalized Symmetric Eigenvalue Problems for Large and Structured

Matrices

As we have seen in several previous case studies, in many practical situations the matrices A and

B are structured: tridiagonal and banded cases are quite common. Unfortunately, the

Cholesky algorithm when applied to such structured problems, will very often destroy the sparsity.

Even though A and B are banded, the matrix C = L�1A(LT )�1 will in general be full. Thus,

simultaneous diagonalization techniques is not practical for large and sparse matrices.

9.9.1 The Sturm Sequence Method for Tridiagonal A and B

We now present a method when A and B are both symmetric tridiagonal and B is positive de�nite.

The method is a generalization of the Sturm-sequence algorithm for the symmetric eigenvalue

problem described earlier in Chapter 8, and takes advantage of the tridiagonal forms of A and B.

Let

A =

0BBBBB@

�1 �1 � � � 0

�1

. . .. . . 0

.... . .

. . . �n�1

0 � � � �n�1 �n

1CCCCCA ; B =

0BBBBB@

�0

1 �0

1 � � � 0

�0

1

. . .. . .

.... . .

. . . �0

n�1

0 � � � �0

n�1 �0

n

1CCCCCA :

De�ne the sequence of polynomials fp(�)g given by:

p0(�) = 1; (9.9.1)

p1(�) = �1 � ��0

1; (9.9.2)

pr(�) = (�r � �r�0

r)pr�1(�)� (�r � ��

0

r)2pr�2(�); (9.9.3)

r = 2; 3; : : : ; n:

Then it can be shown (exercise #22) that these polynomials form a Sturm sequence.

The generalized eigenvalues of the pencil (A � �B) are then given by the zeros of pn(�). The

zeros can be found by bisection or any other suitable root-�nding method for polynomials. For a

proof of the algorithm, see Wilkinson AEP, pp. 340-341.

Example 9.9.1

A =

0BB@1 0 0

0 2 0

0 0 3

1CCA ; B =

0BB@1 1 0

1 4 1

0 1 5

1CCA :

p0(�) = 1; p1(�) = 1� �

646

Page 266: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

p2(�) = (2� 4�)(1� 2)� (0� �)2 � 1

= 3�2� 6�+ 2

p3(�) = (3� 5�)(3�2� 6�+ 2)� (��)2(1� �)

= �14�3 + 38�2 � 28�+ 6:

The roots of p3(�) = 0 are: 1.6708, 0.6472, and 0.3964. It can be easily checked that these are

the generalized eigenvalues of the pencil (A� �B).

Computing a Generalized Eigenvector

Once a generalized eigenvalue is computed, the corresponding eigenvector can be computed

using the inverse iteration by taking full advantage of the tridiagonal forms of A and B as follows:

Let y0 be the initial approximation of an eigenvector corresponding to a computed eigenvalue

�. Then

For i = 0; 1; 2; : : : ; do until convergence occurs.

1. Solve for xi+1 : (A� �B)xi+1 = yi

2. Form yi+1 = Bxi+1:

Remarks:

1. About two iterations per eigenvector are adequate.

2. Note that the system (A��B)xi+1 = yi can be solved by taking advantage of the tridiagonal

forms of A and B.

9.9.2 The Lanczos Algorithm for the Pencil A� �B

In this section, we shall show how the symmetric Lanczos method described in Chapter 8 for a

matrix A can be extended to the symmetric de�nite generalized eigenvalue problem Ax = �Bx.

The Lanczos method to be described here is useful for estimating a few extremal

eigenvalues of a large and sparse symmetric de�nite generalized eigenvalue problem.

Let's repeat that large symmetric de�nite generalized eigenvalue problems are common in practice

and like most practical problems, they are sparse.

The Lanczos method, which relies on matrix-vector multiplications only, is suitable to preserve

sparsity.

Let B = LLT be the Cholesky factorization of B.

647

Page 267: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Algorithm 9.9.1 The Generalized Symmetric Lanczos Algorithm

Given a symmetric matrix A and a symmetric positive de�nite matrix B, the following gener-

alized Lanczos algorithm constructs a symmetric tridiagonal matrix

Tj =

0BBBBB@

�1 �1

�1

. . .. . .

......

... �j�1

�j�1 �j

1CCCCCA

and an orthonormal matrix Vj = fv1; v2; : : : ; vjg such that

VT

jAVj = Tj;

VT

jBVj = Ij�j:

1. Choose v1 such that vT1Bv1 = 1.

2. Set �0 = 1; r0 = v1; v0 = 0:

3.

For i = 1; 2; : : : ; j do

Solve: Bvi = ri�1=�i�1

�i = vT

i(Avi � Bvi�1)

ri = Avi � �iBvi � �i�1Bvi�1

�i = kL�1rik2:

NOTES:

1. The Lanczos vectors in this case are B-orthonormal:

vT

iBvi = 1

vT

iBvj = 0; i 6= j:

2. For j = n:

VTBV = In�n

VTAV = Tn�n; a symmetric tridiagonal matrix.

3. If (�; s) is an eigenpair of Tj, then (�; Vjs) is the corresponding Ritz pair for the pencil (A;B).

648

Page 268: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Computational Remarks

Note that L�1ri can be computed by solving the lower triangular system:

Lyi = ri:

Also,

Bvi = ri�1=�i�1

is equivalent to

LTvi = L

�1(ri�1=�i�1); since B = LLT .

Thus, to implement the scheme, we need (i) a Cholesky-factorization routine for a

sparse matrix, (ii) routines for sparse triangular systems, and (iii) a routine for matrix-

vector multiplication.

9.9.3 Estimating the Generalized Eigenvalues

Fact: For large enough j the extreme eigenvalues of the tridiagonal matrices

Tj =

0BBBBB@

�1 �2

�2

. . .. . .

.... . .

. . . �j

�j �j

1CCCCCA

will approximate the generalized eigenvalues of the pencil (A� �B).

Example 9.9.2

A =

0BB@1 2 3

2 3 4

3 4 5

1CCA

B = diag(1; 2; 3)

L = diag(1; 1:4142; 1:7321)

�0 = 1; v1 = (1; 0; 0)T; r0 = v1:

(Note that vT1 Bv1 = 1).

649

Page 269: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

i=1:

�1 = vT

1 (Av1 � Bv0) = 1

r1 =

0BB@0

2

3

1CCA

�1 = 2:2361:

i=2:

v2 =

0BB@

0

0:4472

0:4472

1CCA

�2 = vT

2 (Av2 � Bv1) = 3:2000

T2 =

�1 �1

�1 �2

!=

1 2:2361

2:2361 3:2000

!:

The eigenvalues of T2 are �0:3920; 4:5919. The generalized eigenvalues of (A;B) are: 4.6013,

�0:4347, 0. (Note that the largest eigenvalue of T2, 4.5919, is a reasonable approx-

imation of the largest generalized eigenvalue 4.6013 of the pencil (A� �B).)

i=3:

v3 =

0BB@

0

�:5477

= 0:3651

1CCA

�3 = vT

3 (Av3 � Bv2) = �0:0333:

Thus,

T3 = T =

0BB@�1 �1 0

�1 �2 �2

0 �2 �3

1CCA =

0BB@

1 2:2361 0

2:2361 3:2000 0:2449

0 0:2449 �0:0333

1CCA :

The eigenvalues of T are: �0:4347; 0; 4:6013. The eigenpairs of T2 are: �0:3920;

0:8489

�0:5285

!!and

4:5919;

0:5285

0:8489

!!:

The Ritz pairs are:0BB@�0:3920;

0BB@

0:8489

�0:2363

�0:2363

1CCA1CCA ;

0BB@4:5919;

0BB@0:5285

0:3796

0:3796

1CCA1CCA :

650

Page 270: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

9.10 The Lanczos Method for Generalized Eigenvalues in an Interval

In several important applications, such as in vibration and structural analysis, one is frequently

interested in computing a speci�ed number of eigenvalues in certain parts of the spectrum. We give

a brief outline of a Lanczos algorithm for the generalized symmetric eigenvalue problem to do this.

The algorithm was devised by Ericsson and Ruhe (1980).

Algorithm 9.10.1 The Lanczos Method for Generalized Eigenvalues in an Interval

Given (A;B), A symmetric and B symmetric positive de�nite, the following algorithm computes

the generalized eigenvalues �k of the pencil (A� �B) in a speci�ed interval [�; �].

Denote

S(�; �) = the set of eigenvalues in (�; �);

C(�; �) = the set of converged eigenvalues in (�; �):

Set

�1 = �; C = � (null set).

For i = 1; 2; : : : do until jC(�; �)j = jS(�; �)j

1. Factorize (A� �iB) :

A� �iB = LDLT:

Count the number of negative diagonal entries of D. Set that count equal to jS(�; �i)j.

2. Choose a random unit vector v1.

3. Apply the symmetric Lanczos algorithm to the matrix

WT (A� �iB)

�1W;

where

B = WWT;

with v1 as the starting Lanczos vector.

4. Let �1; �2; : : : ; �r be the converged eigenvalues from Step 3. Then add �i +1

�s

to C; s =

1; : : : ; r.

5. Determine a new shift �i+1.

651

Page 271: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Remarks: Note that in applying the symmetric Lanczos to

WT (A� �iB)

�1W;

we need a matrix-vector multiply of the form

y = WT (A� �iB)

�1Wx

which can be obtained as follows:

1. Compute z = Wx

2. Solve for p:

(A� �iB)p = z

which can be done by making use of the factorization in Step 1 of the algorithm.

3. Compute y = WTp.

For details of this algorithm, its implementation and proof, see the paper by Ericsson and Ruhe

(1980).

9.11 Review and Summary

This chapter has been devoted to the study of the most commonly arising eigenvalue problem in

engineering, namely, the generalized eigenvalue problem involving two matrices:

Ax = �Bx:

We now review and summarize the most important results:

1. Existence Results. There exist Schur and Real Schur analogs of the ordinary eigenvalue

problem for the generalized eigenvalue problem (Theorems 9.2.1 and 9.3.1).

2. The QZ Algorithm. The most widely used algorithm for the generalized eigenvalue problem

is the QZ algorithm, which constructs the generalized Real Schur Form of (A;B). The

algorithm comes in two stages. In stage I, the pair (A;B) is reduced to a Hessenberg-triangular

pair. In stage II, the Hessenberg-triangular pair is further reduced to the generalized Real

Schur Form using implicit QR iteration to AB�1. B�1 is never formed explicitly.

The algorithm requires about 15n3 ops and is backward stable.

652

Page 272: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

3. The Generalized Symmetric Eigenvalue Problem. Almost all eigenvalue problems

arising in structural and vibration engineering are of the form

Mx = �Kx;

where M is symmetric positive de�nite, and K is symmetric positive semide�nite. This is

called the symmetric-de�nite generalized eigenvalue problem. Because of the impor-

tance of this problem, it has been studied in some depth here.

Several case studies from vibration engineering have been presented in section 9.6 to show

how this problem arises in important practical applications. These include:

(i) vibration of a free spring-mass system,

(ii) vibration of a building,

(iii) and forced harmonic vibration of a spring-mass system.

The natural frequencies and amplitudes of a vibrating system are related, respectively, to

the generalized eigenvalues and eigenvectors. If the frequency of the imposed periodic

force becomes equal or nearly equal to one of the natural frequencies of the

system, then resonance occurs, and the situation is quite alarming.

The fall of Tacoma Bridge in the state of Washington, in the USA, and of Boughton Bridge

in England are related to such a phenomenon. (See Chapter 8.)

� The QZ method can, of course, be used to solve a symmetric de�nite generalized eigen-

value problem. However, both symmetry and de�niteness will be lost in general.

� A symmetry-preserving method is the Cholesky-QR algorithm. This has been de-

scribed in section 9.5.1. The accuracy obtained by this algorithm can be severely im-

paired if the matrix B in

Ax = �Bx

is ill-conditioned.

A variation of this method due to Wilkinson that computes the smallest eigenvalues

with reasonable accuracy has been described in this section. The method constructs an

ordered real Schur form of B rather than the Cholesky factorization.

4. Simultaneous Diagonalization and Applications. The Cholesky-QR algorithm for the

symmetric de�nite problem

Ax = �Bx

653

Page 273: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

basically constructs a nonsingular matrix P that transforms A and B simultaneously to

diagonal forms by congruence:

PTAP = a diagonal matrix

PTBP = I:

This is called simultaneous diagonalization ofA andB. In vibration and other engineering

applications, this decomposition is called modal decomposition and the matrix P is called

a modal matrix.

The technique of simultaneous diagonalization is a very useful technique in engineering prac-

tice. Its applications include

(i) decoupling of a second order system of di�erential equations

M �y +D _y + ky = 0

to n independent equations

�zi + (�+ �!2i) _zi + !

2izi = 0; i = 1; 2; : : : ; n;

where D = �M + �K, and

(ii) making of a reduced order model from a very large system of second-order systems.

Decoupling and model reduction are certainly very useful approaches for handling a large

second-order system of di�erential equations. Unfortunately, however, the simultaneous

diagonalization technique is not practical for large and sparse problems. On the

other hand, many practical problems, such as the design of large space structures, etc., give

rise to very large and sparse symmetric de�nite eigenvalue problems.

The simultaneous diagonalization technique preserves symmetry, but destroys the other ex-

ploitable properties o�ered by the data of the problem, such as sparsity. (Note that most

practical large problems are sparse and maintaining sparsity is a major concern

to the algorithm developers to economize the storage requirements.)

5. The Quadratic Eigenvalue Problem: The eigenvalue problem (�2M + �D +K)x = 0 is

discussed in Section 9.8. It is shown that the problem can be reduced either to a standard

2n � 2n nonsymmetric problem (9.8.8) or to a 2n � 2n symmetric generalized eigenvalue

problem (9.8.16). It is also shown how to extract the frequencies and modal damping ratios

of a vibrating system governed by a second-order system once the eigenvalues are obtained

(Equations 9.8.9 and 9.8.10).

654

Page 274: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

6. The Sturm-sequence and Lanczos Methods. We have given an outline of the Sturm-

sequence method for the generalized eigenvalue problem with tridiagonal matrices A and

B. The symmetric de�nite tridiagonal problems arise in several applications.

We have also given a very brief description of the symmetric Lanczos method for a generalized

eigenvalue problem.

The chapter concludes with a Lanczos-algorithm due to Ericsson and Ruhe for �nding a speci�ed

number of generalized eigenvalues in an interval of a symmetric de�nite generalized eigenvalue

problem (section 9.9).

9.12 Suggestions for Further Reading

Almost all books in vibration and structural engineering discuss implicitly or explicitly how the

generalized eigenvalue problems arise in these applications. Some of the well-known books in the

literature of vibration are:

1. Vibration with Control, Measurement, and Stability, by Daniel J. Inman, Prentice

Hall, Englewood Cli�s, NJ 07632.

2. Theory of Vibrations with Applications, (Third Edition) by W. T. Thomson, Prentice

Hall, Englewood Cli�s, NJ 1988.

3. An Introduction to Mechanical Vibrations, (Second Edition), by Robert F. Steidel,

Jr., John Wiley & Sons, New York, 1979.

4. Linear Vibrations, by P. C. M�uller and W. O. Schiehlen, Martinus Nijho� Publications,

Dordrecht, 1985.

5. Vibration of Mechanical and Structural Systems, by M. L. James, G. W. Smith,

J. C. Wolford, and P. W. Whaley. Harper & Row, New York, 1989.

6. Engineering Vibration, by Daniel J. Inman, Prentice Hall, New York, 1994.

The QZ iteration algorithm has been discussed in detail in the books by Golub and Van Loan

(MC 1984 Chapter 7), Stewart (IMC), and Watkins (FMC Chapter 5). (The original paper of

Moler and Stewart (1973) is worth reading in this context.) For further reading on simultaneous

diagonalization technique, see Golub and Van Loan (MC 1984 Chapter 8) and the references therein.

For results on perturbation analysis of the generalized eigenvalue problem, see Stewart (1978).

655

Page 275: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

For applications of the symmetric de�nite generalized eigenvalue problem to earthquake en-

gineering, see the book Introduction to Earthquake Engineering, (Second Edition), by

S. Okamoto, University of Tokyo Press, 1984.

A technique more e�cient than the Cholesky-QR iteration method for computing the general-

ized eigenvalues of a symmetric de�nite pencil for banded matrices has been proposed by Crawford

(1973). See also the recent work of Wang and Zhao (1991) and Kaufman (1993). For a look-ahead

Lanczos algorithm for the quadratic eigenvalue problem see Parlett and Chen (1991).

Laub and Williams (1992) have considered the simultaneous triangularizations of matrices

M; D; and K of the second-order system M �y +D _y +Ky = 0.

Chapter 15 of Parlett's book \The Symmetric Eigenvalue Problem" (1980) is a rich source

of knowledge in this area.

656

Page 276: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Exercises on Chapter 9

PROBLEMS ON SECTION 9.2

1. Show that when A and B have a common null vector, then the generalized characteristic

equation is identically zero:

det(A� �B) = 0:

2. (a) Prove that if A and B are n � n matrices, then det(A � �B) is a polynomial of degree

at most n.

(b) The degree of det(A� �B) is equal to n i� A is nonsingular.

PROBLEMS ON SECTIONS 9.3 AND 9.4

3. Show that the matrix Q1 in the initial QZ step can be computed just by inverting the 2 � 2

leading principal submatrix of the triangular matrix B.

4. Show that the shifts �1 and �2 in a QZ step, which are the eigenvalues of the lower 2 � 2

principal submatrix of C = AB�1, can be computed without forming the complete B�1 (Hint:

Computation depends only on the lower right 3� 3 submatrix of B�1).

5. Using the Implicit Q Theorem, show that the matrix Q in the QZ step has the same �rst row

as Q1.

6. Give op-count for

(a) Hessenberg-Triangular reduction with and without accumulations of the transforming

matrices.

(b) One step of the QZ iteration.

(c) Reduction of (A;B) to the generalized Schur form.

7. Work out an algorithm based on Gaussian elimination with partial pivoting for the Hessenberg-

triangular reduction. What is the op-count?

8. How are the generalized eigenvectors of the pair (A;B) related to the orthogonally equivalent

pair ( ~A; ~B), where

~A = UAV

~B = UBV:

657

Page 277: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

PROBLEMS ON SECTION 9.5

9. Rework the Cholesky-QR algorithm (Algorithm 9.5.1) of the symmetric de�nite pencil by

using the Schur decomposition of B:

VTBV = D:

10. Consider the Hessenberg-triangular reduction of (A;B) with B singular. Show that in this

case, if the dimension of the null space AB is k, then the Hessenberg-Triangular structure

takes the form:

A =

A11 A12

0 A22

!; B =

0 B12

0 B22

!;

where A11 is a k � k upper triangular matrix, A22 is upper Hessenberg, and B22 is (n� k)�

(n� k) upper triangular and nonsingular. How does this help in the reduction process of the

generalized-Schur form?

11. Work out the op-count for the Cholesky-QR algorithm of the symmetric de�nite pencil.

12. Let A and B be positive de�nite. Show that the algorithm for simultaneous diagonalization

requires about 7n3 ops.

13. Generalized Orthogonal Iteration. Consider the following iterative algorithm known as

the generalized orthogonal iteration:

(a) Choose an n�m orthonormal matrix Q0 such that QT

0Q0 = Im�m.

(b) For k = 1; 2; : : : do

i. Solve for Zk : BZk = AQk�1.

ii. Find QR factorization of Zk : Zk = QkRk.

Apply the above algorithm to

A =

0BBBBB@

1 1 1

1 2 3 4

1 3 4 5

1 4 5 6

1CCCCCA ; B =

0BBBBB@

10 1 1 1

1 10 1 1

1 1 10 1

1 1 1 10

1CCCCCA :

14. Given

(a) A =

0BB@1 1 1

1 1 1

1 1 1

1CCA ; B =

0BB@10 1 0

1 10 1

0 1 10

1CCA :

658

Page 278: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

(b) A =

0BB@10 1 1

1 10 1

1 1 1

1CCA ; B =

0BB@1 1

2

1

3

12

13

14

13

14

15

1CCA :

Find the generalized eigenvalues and eigenvectors for each of the above pair using

i. the QZ iteration followed by inverse iteration,

ii. the generalized Rayleigh-Quotient iteration,

iii. techniques of simultaneous diagonalization.

PROBLEMS ON SECTIONS 9.6 AND 9.7

15. Suppose that a bridge trestle has a natural frequency of 5 Hz (known from an earlier test).

Suppose that it de ects about 2mm at midspan under a vehicle of 90000 kg. What are the

natural frequencies of the bridge and the vehicle?

16. For the equation of motion under the force F (t) = F1ei!t:

m�y + ky = F1ei!t;

�nd the amplitude and determine the situation which can give rise to resonance.

17. Consider the following spring-mass problem:

659

Page 279: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

3

2

1

y

y

y

3k

2m

m

2m

k

k

3k

(a) Determine the equations of motion.

(b) Set up the generalized eigenvalue problem in the form

Kx = �Mx;

and then determine the natural frequencies and modes of vibration.

(c) Find the con�guration of the system in each mode.

660

Page 280: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

18. Consider the four story building as depicted by the following diagram:

1

2

3

4

m

m

m

m

Given

m1 = 1:0� 105kg

m2 = 0:8� 105kg

m3 = 0:5� 105kg

m4 = 0:6� 105kg

k1 = 15� 108N/m; k2 = 12� 108N/m;

k3 = 15� 108N/m; k4 = 10� 108N/m:

Find the maximum amplitude of each oor for a horizontal displacement of 3 mm with a

period of .25 second.

661

Page 281: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

19. Consider the following diagram of a motor car suspension with vibration absorber (taken

from the book Linear Vibrations by P. C. Muller and W. O. Schiehlen, p. 226).

k3

m3

d3

absorber

with vibration absorberMotor car suspension

guide way

suspension

axle & wheel

car body

tire

(t)

(t)

(t)

(t)

e

2

11

2

1

3

2

1 y

y

y

y

dk

k

m

m

Given

m1 = 1200kg;

m2 = 80kg;

m3 = 20kg;

k1 = 300N

cm;

k2 = 3200N

cm;

k3 = 600N

cm:

Find the various amplitude frequency responses with di�erent damping values of the ab-

sorber d3 = 0; 300; 600; 1000 Ns/m. (The response of a system is measured by the amplitude

ratios.)

662

Page 282: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

PROBLEMS ON SECTIONS 9.8 AND 9.9

20. Find the eigenvalues of the quadratic pencil: (M�2 +K�+D)x = 0 using both approach 1

and approach 2 of Section 9.8, and compare the results.

M = I3�3; K =

0BB@

2 �1 0

�1 2 �1

0 �1 2

1CCA ; D =

0BB@1 1 1

1 1 1

1 1 1

1CCA :

21. Deduce the equations (9.8.9) and (9.8.10) for frequencies and the mode shapes.

22. Show that the polynomials de�ned by (9.9.1){(9.9.3) form a Sturm sequence.

23. Find the generalized eigenvalues for the pair (A;B), where

A =

0BB@1 1 0

1 1 1

0 1 1

1CCA ; B =

0BB@10 1 0

1 10 1

0 1 10

1CCA

using the Sturm sequence method described in section 9.9.1.

24. Estimate the generalized eigenvalues of the pair (A;B) of problem #14 using the generalized

symmetric Lanczos algorithm.

25. Find the generalized eigenvalues of the pair (A;B) of problem #23 in the interval (0; 0:3).

26. Prove that the eigenvalues of the symmetric de�nite pencil A��B lie in the interval [�kB�1Ak; kB

�1Ak].

in exercise #23.

663

Page 283: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

MATLAB PROGRAMS AND PROBLEMS ON CHAPTER 9

You will need backsub from MATCOM.

1. Write a MATLAB program, called hesstri, to reduce a pair of matrices (A;B) to a (Hessenberg-

triangular) pair:

[H; T ] = hesstri(A;B):

Test your program by randomly generating A and B, each of order 15.

2. (a) Write a MATLAB program, called qzitri, to implement one step of QZ iteration algo-

rithm:

[A1; B1] = qzitri (A;B):

(b) Now apply one step of qritrdsi. (Double-shift implicit QR iteration from Chapter 8) to

C = AB�1:

[C] = qritrdsi (C):

(c) Compute D = A1 �B1�1, where (A1; B1) is the Hessenberg-triangular pair obtained in

step (a).

(d) Compare C and D to verify that they are essentially the same.

Test-Data:

A = A 15� 15 randomly generated unreduced upper Hessenberg matrix.

B = A 15� 15, upper triangular matrix with all entries equal to 1, except two diagonal

entries each equal to 10�5.

3. Using lynsyspp from Chapter 6 or the MATLAB Command `n' and hesstri, write a MAT-

LAB program, called eigenvecgen to compute a generalized eigenvector u corresponding to

a given approximation to a generalized eigenvalue �:

[u] = eigvecgen(A;B; �):

Test your program using randomly generated matrices A and B, each of order 15, and then

compare the result with that obtained by running the MATLAB command :

[U;D] = eig(A;B):

4. (The purpose of this exercise is to compare the accuracy of di�erent ways to

�nd the generalized eigenvalues and eigenvectors of a symmetric de�nite pencil

(K � �M)).

664

Page 284: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

(a) Using the MATLAB commands chol, inv, eig, and `n' (or bascksub from Chapter 3),

write a MATLAB program, called geneigsymdf, to implement the Cholesky algorithm

for the symmetric-de�nite pencil (K � �M) (Algorithm 9.5.1).

[V 1; D1] = geneigsymdf (K;M);

where V 1 is a matrix containing the generalized eigenvectors as its columns and D1 is a

diagonal matrix containing the generalized eigenvalues of the symmetric-de�nite pencil

K � �M .

(b) Run eig(K;M) from MATLAB to compute (V 2; D2):

[V 2; D2] = eig(K;M):

(c) Run eig(inv(M) �K) from MATLAB to compute (V 3; D3) :

[V 3; D3] = eig (inv(M) �K):

(d) Compare the results of (a), (b), and (c).

Test-data:

M = diag(m;m; � � � ; m)25�25

K =

0BBBBBBBBBB@

k �k 0 0 � � � 0

�k 2k �k 0 � � � 0...

. . .. . .

. . ....

.... . .

. . .. . .

. . . �k

0 � � � 0 �k 2k

1CCCCCCCCCCA25�25

m = 100;

k = 108 :

5. Using chol, inv, eig from MATLAB, write a MATLAB program, called

diagsimul, to simultaneously diagonalize a pair of matrices (M;K), where M is symmetric

positive de�nite and K is symmetric (Algorithm 9.5.2):

(I;D) = diagsimul (M;K):

Test-data:

Use M and K from the case-study on the vibration of a building in Section 9.6.2.

665

Page 285: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

6. Using diagsimul, solve example 9.7.1 from the book completely.

7. (The purpose of this exercise is to compare di�erent approaches for solving the

quadratic eigenvalue problem: (�2M + �D +K)x = 0.)

(i) Approach 1 of Section 9.8. Form the matrix A =

0@ 0 I

�M�1K �M

�1D

1A by

using MATLAB commands inv, eig, and zeros. Then compute the eigenvalues and

eigenvectors of A using MATLAB command: [V1; D1] = eig(A):

(ii) (Approach 2 of Section 9.8): Use the program geneigsymdf to compute the

eigenvalues:

[V 2; D2] = geneigsymdf (A;B);

where A =

0@ 0 �K

�K D

1A; B =

0@ �K 0

0 M

1A:

(iii) Use the MATLAB command [V 3; D3] = eig (A;B), where the matrices A and B are

given as in part (ii).

Compare the results of the above three approaches with respect to accuracy, op-count,

and elapsed time. (The eigenvalues and the eigenvectors obtained by (iii) can be taken

as the accurate ones).

Test-Data:

Use the same M and K as in problem 4 and D = 10�5 �M .

8. Find the natural frequencies and modal ratios using the results (9.8.9) and (9.8.10) of the

book with the same M;K; and D as in problem #7.

9. Write a MATLAB program called lansymgen to transform the symmetric de�nite pair (A;B)

to (TJ; IJ), where TJ is a j � j symmetric tridiagonal matrix and IJ is the j � j identity

matrix, j � n.

(alpha; beta) = langsymgen (A;B);

where alpha is a vector containing the diagonal entries of TJ and beta is a vector containing

the o�-diagonal entries of TJ .

Test-data and the experiment: Take B = M; A = K; where M and K are the same as

given in exercise #7. Run lansymgen using j = 10, 20, 30, 40, and 50.

Tell how the extreme eigenvalues of TJ for each value of j approximate the generalized

eigenvalues of the pencil (A � �B). Find the generalized eigenvalues using the MATLAB

666

Page 286: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

command

[U;D] = eig(A;B)].

667

Page 287: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

10.THE SINGULAR VALUE DECOMPOSITION (SVD)

10.1 Introduction : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 669

10.2 The Singular Value Decomposition Theorem : : : : : : : : : : : : : : : : : : : : : : : 670

10.3 A Relationship between the Singular Values and the Eigenvalues : : : : : : : : : : : 673

10.4 Applications of the SVD : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 675

10.5 Sensitivity of the Singular Values : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 678

10.6 The Singular Value Decomposition and the Structure of a Matrix : : : : : : : : : : : 679

10.6.1 The Norms and the Condition Number : : : : : : : : : : : : : : : : : : : : : 680

10.6.2 Orthonormal Bases for the Null Space and the Range of a Matrix : : : : : : : 681

10.6.3 The Rank and the Rank-De�ciency of a Matrix : : : : : : : : : : : : : : : : : 682

10.6.4 An Outer Product Expansion of A and Its Consequences : : : : : : : : : : : 686

10.6.5 Numerical Rank : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 687

10.7 Computing the Variance-Covariance Matrix : : : : : : : : : : : : : : : : : : : : : : : 688

10.8 The Singular Value Decomposition, the Least Squares Problem, and the Pseudo-Inverse689

10.8.1 The SVD and Least Squares Problem : : : : : : : : : : : : : : : : : : : : : : 689

10.8.2 Solving the Linear System Using the Singular Value Decomposition : : : : : 692

10.8.3 The SVD and the Pseudoinverse : : : : : : : : : : : : : : : : : : : : : : : : : 692

10.9 Computing the Singular Value Decomposition : : : : : : : : : : : : : : : : : : : : : : 695

10.9.1 Computing the SVD from the Eigenvalue Decomposition of ATA : : : : : : : 695

10.9.2 The Golub-Kahan-Reinsch Algorithm : : : : : : : : : : : : : : : : : : : : : : 696

10.9.3 The Chan SVD : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 703

10.9.4 Computing the Singular Values with High Accuracy: The Demmel-Kahan

Algorithm : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 705

10.9.5 The Di�erential QD Algorithm : : : : : : : : : : : : : : : : : : : : : : : : : : 709

10.9.6 The Bisection Method : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 709

10.10Generalized SVD : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 710

10.11Review and Summary : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 711

10.12Some Suggestions for Further Reading : : : : : : : : : : : : : : : : : : : : : : : : : : 712

Page 288: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

CHAPTER 10

THE SINGULAR VALUE DECOMPOSITION (SVD)

Page 289: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

10. THE SINGULAR VALUE DECOMPOSITION (SVD)

Objectives

The major objectives of this chapter are to study theory, methods, and applications of the

Singular Value Decomposition (SVD).Here are the highlights of the Chapter.

� The SVD existence theorem (Section 10.2)

� A relationship between singular values and the eigenvalues(Section 10.3)

� An application of the SVD to the fetal ECG (Section 10.4)

� Sensitivity of singular values (Section 10.5)

� Applications of the SVD to rank-related problems, computing orthonormal bases, matrix

approximations, etc. (Section 10.6)

� Use of the SVD in least squares and the pseudoinverse problems (Section 10.8)

� The Golub-Kahan-Reinsch algorithm (Section 10.9)

� The Demmel-Kahan algorithm (Section 10.9)

Background Material Needed for this Chapter

The following background material will be needed for smooth reading of this chapter:

1. Norm concepts and related results (Section 1.7)

2. Rank concept (Section 1.3)

3. Orthonormal bases (Sections 1.3 and 5.6)

4. Creating zeros with Householder and Givens matrices (Sections 5.4 and 5.5)

5. QR factorization of a nonsquare matrix (Section 5.4.2)

6. Statements and methods for least-squares problems and the pseudoinverse (Chapter 7)

7. The Bauer-Fike Theorem (Theorem 8.7.1)

668

Page 290: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

10.1 Introduction

So far we have studied two important decompositions of a matrix A, namely, the LU and the QR

decompositions. In this chapter we will study another very important decomposition of a complex

matrix A: the singular value decomposition or in short, the SVD de�ned by

A = U�V �

where U and V are unitary and � is a diagonal matrix. If A is real, U and V are real orthogonal.

We will assume that A is real throughout this chapter.

The SVD has a long and fascinating history. The names of at least �ve classical and celebrated

mathematicians|E. Beltrami (1835-1899), C. Jordan (1838-1921), J. Sylvester (1814-1897), E.

Schmidt (1876-1959), and H. Weyl (1885-1955)|can be associated with the development of the

theory of the SVD. Some details of the contributions of these mathematicians to the SVD can be

found in an interesting recent paper by G. W. Stewart (1993). Also the book by Horn and Johnson

(1991) contains a nice history of the SVD.

In recent years the SVD has become a computationally viable tool for solving a wide variety of

problems arising in many practical applications. However, this has only been possible due to the

pioneering work of some contemporary numerical analysts such as: G. H. Golub, W. Kahan, etc.,

who showed us how to compute the SVD in a numerically e�cient and stable way.

In this chapter we will discuss the important properties, some applications, and the existing

computational methods for the SVD. The organization of this chapter is as follows.

In section 10.2 we prove the existence theorem on the SVD. There are several proofs available

in the literature: Golub and Van Loan (MC, 1984, p. 17) Horn and Johnson (1991), Pan and

Sigmon (1992), etc. We will, however, give a more traditional and constructive proof that relies

on the relationship between the singular values and singular vectors of A with the eigenvalues and

eigenvectors of ATA: The later aspect is treated fully in Section 10.3.

In section 10.4 we give a real-life application of the SVD on separating out the Electro-

Cardiogram (ECG) of a fetus from that of the mother, taken from the work of Callaerts, De

Moor, Van Dewalle and Sansen (1991).

In section 10.5 we discuss the sensitivity of the singular values. The singular values are

insensitive to perturbations, and this is remarkable.

In section 10.6 we outline several important applications of the SVD relating to the structure

of a matrix: �nding the numerical rank, orthonormal bases for the range and null space

of A, approximation of A by another matrix of lower rank, etc. The ability of the SVD

to perform the above computations in a numerically reliable way makes the use of the SVD so

669

Page 291: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

attractive in practical applications.

In section 10.8 we discuss the use of the SVD in least squares solutions and computation

of the pseudoinverse. The SVD is the most numerically reliable approach to handle

these problems.

Finally, section 10.9 is devoted to computing the SVD. Here, besides describing the widely-used

Golub-Reinsch method, we brie y outline the recent improvements to the method by Demmel and

Kahan (1990). A brief mention of the very recent method of Fernando and Parlett (1992) will be

mentioned too.

10.2 The Singular Value Decomposition Theorem

Theorem 10.2.1 Let A be a real m � n matrix. Then there exist orthogonal

matrices U and V such that

A = Um�m�m�nVTn�n; (10.2.1)

where � is anm�n \diagonal" matrix. The diagonal entries of � are all nonnegative

and can be arranged in nonincreasing order. The number of nonzero diagonal entries

equals the algebraic rank of A.

Remark: Notice that when m � n, � has the form

� =

0BBBBBB@

�1

. . .

�n

0(m�n)�n

1CCCCCCA:

Proof. Consider the matrix ATA. It is an n� n symmetric positive semide�nite matrix; therefore

its eigenvalues are nonnegative. Denote the eigenvalues of ATA by �1 = �

21 , �2 = �

22; : : : ; �n = �

2n.

Assume that these have been ordered such that �1 � �2 � � � � � �r > 0; and

�r+1 = �r+2 = � � � = �n = 0:

We have seen before that a symmetric matrix has a set of orthonormal eigenvectors. Denote the

set of orthonormal eigenvectors of ATA corresponding to �1 through �n by v1; : : : ; vn; that is, v1

through vn are orthonormal and satisfy:

ATAvi = �

2i vi; i = 1; : : : ; n:

670

Page 292: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Then,

vTi A

TAvi = �

2i ; (10.2.2)

and

vTi A

TAvj = 0; if i 6= j. (10.2.3)

Write

V1 = (v1; : : : ; vr);

V2 = (vr+1; : : : ; vn);

where v1 through vr are the eigenvectors associated with the nonzero eigenvalues �1 through �r,

and vr+1; : : : ; vn correspond to the zero eigenvalues. De�ne now a set of vectors fuig by

ui =1

�i

Avi; i = 1; : : : ; r: (10.2.4)

The ui's, i = 1; : : : ; r; form an orthonormal set, because

uTi uj =

1

�i

(Avi)T 1

�j

(Avj)

=1

�i�j

(vTi ATAvj) (10.2.5)

=

8<: 0 when i 6= j

1 when i = j

(by (10.2.2) and (10.2.3)).

De�ne U1 = (u1; : : : ; ur), and choose U2 = (ur+1; : : : ; um) such that uTj A = 0; j = r+ 1; : : : ; m.

The set fu1; : : : ; ur; ur+1;:::;umg forms an orthonormal basis of the m-space Cm.

De�ne now V = (V1; V2); and U = (U1; U2). Then U and V are orthonormal, and

UTAV =

0BBBBB@

uT1

uT2...

uTm

1CCCCCAA(v1; : : : ; vn) =

0BBBBBBBBBBBBBBB@

1

�1vT1 A

T

1

�2vT2 A

T

...

1�rvTr A

T

uTr+1

...

uTm

1CCCCCCCCCCCCCCCA

A(v1; : : : ; vn) (Using 10.2.4) (10.2.6)

(10.2.7)

671

Page 293: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

=

0BBBBBBBBBBBB@

1

�1� �21 0 0 � � � 0 0

0 1

�2� �22 0 � � � 0 0

.... . .

. . . � � �...

0 � � � 1

�r� �2r 0 � � � 0

0 � � � � � � 0. . . 0

0 � � � � � � � � � � � � 0

1CCCCCCCCCCCCA= �

The statement about the rank follows immediately from the fact that the rank is invariant under

unitary matrix multiplications:

rank (A) = rank (U�V T ) = rank (�);

and that the rank of a diagonal matrix is equal to the number of nonzero diagonal entires.

The decomposition (10.2.6) is known as the Singular Value Decomposition (SVD) of A.

De�nition 10.2.1 The scalars �1; �2; : : : ; �r are called the nonzero-Singular Values of A.

Note that the other (n� r) singular values are zero singular values.

De�nition 10.2.2 The columns of U are called the left singular vectors and those of V are

called the right singular vectors.

A Convention

For the remainder of this chapter we will assume, without any loss of gener-

ality, that m � n, because if m < n, we consider the SVD of AT and if the

SVD of AT is U�V T , then the SVD of A is V�UT .

We will follow the convention that the singular values are ordered as above. Thus

�1 = �max is the largest singular value and �n = �min the smallest singular

value. Also, by �(A), we will denote the set of singular values of A. This is also

referred to as the singular spectrum.

Notes:

1. When m � n, we have n singular values.

2. The singular values of A are uniquely determined while the matrices U and V are not unique

(Why?)

672

Page 294: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Example 10.2.1

A =

0BB@1 2

2 3

3 4

1CCA � =

0BB@6:5468 0

0 0:3742

0 0

1CCA

3�2

U =

0BB@0:3381 0:8480 0:4082

0:5506 0:1735 �0:81650:7632 �0:5009 0:4082

1CCA

3�3

V =

0:5696 �0:82190:8299 0:5696

!2�2

There are two singular values; they are 6.5458, 0.3742.

10.3 A Relationship between the Singular Values and the Eigenvalues

In the proof of Theorem 10.2.1 we have used the fact that the singular values of A are the nonneg-

ative square roots of the eigenvalues of ATA (in fact, that's how they have been de�ned). We put

this important fact in the form of a theorem and give an independent proof.

Theorem 10.3.1 The singular values of an m � n matrix A are the nonnegative

square roots of the eigenvalues of ATA.

Proof.

ATA = (V �T

UT )(U�V T )

= V �T�V T (10.3.1)

= V �0V T;

where �0 is an n�n diagonal matrix with �21; : : : ; �2n as its diagonal entries. Thus, V

TATAV = �0 =

diag(�21; �22; : : : ; �

2n): Since the singular values are nonnegative numbers, the theorem is proven.

Corollary 10.3.1 Let A be a symmetric matrix with its eigenvalues �1; : : : ; �n.

Then the singular values of A are j�ij; i = 1; : : : ; n.

Proof. Since

A = AT; (10.3.2)

ATA = A

2: (10.3.3)

673

Page 295: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Therefore, from Theorem 10.3.1 above we have that the n singular values of A are the square roots

of the n eigenvalues of A2. Since the eigenvalues of A2 are �21; : : : ; �2n, we have the result.

Corollary 10.3.2 An n � n matrix A is nonsingular i� all its singular values are

di�erent from zero.

Proof. We know that det(ATA) = (det(A))2: Thus A is nonsingular if and only if AT

A is non-

singular. Since a matrix is nonsingular i� its eigenvalues are all di�erent from zero, proof is now

immediate from Theorem 10.3.1.

Theorem 10.3.2 The nonzero singular values of an m� n (m � n) matrix A are

positive eigenvalues of

C =

0m�m A

AT 0n�n

!

Proof. Let

A = U�V T:

Write

U =

U1 U2

m� n m� (m� n)

!

� =

�1(n�n)

0(m�n)�n

!:

De�ne

P =

~U1 � ~

U1 U2

~V

~V 0n�(m�n)

!;

where

~U1 =

1p2U1

and

~V =

1p2V:

Then it is easy to see that

PTCP =

0BB@�1 0 0

0 ��1 0

0 0 0

1CCA ;

674

Page 296: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

which shows that the nonzero eigenvalues of C are �1; : : : ; �k, ��1; : : : ;��k, where �1 through �k

are the nonzero singular values of A.

10.4 Applications of the SVD

The SVD has become an e�ective tool in handling various important problems arising in a wide

variety of applications areas, such as control theory, signal and image processing identi-

�cation and estimation, speech synthesis, pattern recognition, time series analysis,

electrical network, biomedial engineering, etc.

The aspects of control theory and identi�cation problems requiring use of the SVD include prob-

lems on controllability and observability, realization of state space models, the H-in�nity control,

balancing, robust feedback stablization, model reduction, etc.

In signal and speech processing the SVD can be regarded as a �lter that produces an estimate

of a signal from noisy data. For example, when a person speaks, speech is absent about 50% of the

time. Thus, if there are background noises coming from, say, a fan, a vibrating machine, etc., then

these disturbances dominate in the microphone signal, when speech is absent. In such a situation

the ratio of speech signal to the background noise has to be enhanced and the SVD can be used

e�ectively to do so.

In image processing applications the SVD is routinely used for image compression, to remove

noise in a picture, etc. For details see Jain (1989).

In biomedial engineering the SVD plays an important role in obtaining a meaningful fetal ECG

from that of the mother, see Van Dewalle and DeMoor (1988).

The crux of using the SVD in these applications is in the fact that these applications require:

determination of the \numerical" rank of a matrix, �nding an approximation of a matrix using

matrices of lower ranks, computations of the orthonormal bases for the row and column spaces of a

matrix as well as the bases for their orthogonal complements, etc. In most cases these computations

need to be done under the presence of impurities in the data (called \noises"), and as we will see

in later sections in this chapter, the SVD is very e�ective for these computations.

Furthermore, the SVD is the most e�ective tool in solving least squares and the generalized

least-square problems. (See Golub and Van Loan MC, 1984 and 1989.) We now present in this

section a real-life application of the SVD in biomedial engineering.

Fetal ECG (Taken from (Van Dewalle and DeMoor (1988).)

Consider the problem of taking the electrocardiogram of a fetus by placing the cutaneous elec-

trodes at the heart and the abdomen of the pregnant mother. The maternal ECG (MECG) clearly

675

Page 297: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

disturbs the observation of the fetal ECG (FECG), because the contributions of the material heart

signals are much stronger than those of the fetal heart. The objective then will be to detect the

FECG while simultaneously suppressing the MECG respective to noise.

Suppose there are p measurements signals m1(t); : : : ; mp(t). Let these measurements be ar-

ranged in a vector called the measurement vector m(t):

m(t) = (m1(t); m2(t); : : : ; mp(t))T: (10.4.1)

Let there be r source signals s1(t); s2(t); : : : ; sr(t) arranged in the source signal vector s(t):

s(t) = (s1(t); s2(t); : : : ; sr(t))T: (10.4.2)

Obviously, the measurement signals are corrupted by an additive noise signal, and there exists a

relationship between the measurement signals and the source signals. It can be assumed (see Van

Dewalle and de Moor (1988)) that this relationship is linear, and, indeed, each measurement signal

mi(t) can be written as a linear combination of r source signals si(t) and additive noise signal ni(t).

This leads to the following equations:

m1(t) = t11s1(t) + t12s2(t) + � � �+ t1rsr(t) + n1(t)

m2(t) = t21s1(t) + t22s2(t) + � � �+ t2rsr(t) + n2(t)

...

mp(t) = tp1s1(t) + tp2s2(t) + � � �+ tprsr(t) + nr(t):

(10.4.3)

or

m(t) = Ts(t) + n(t); (10.4.4)

where

T = (tij); and n(t) = (n1(t); n2(t); : : : ; nr(t))T: (10.4.5)

The matrix T is called the transfer matrix and depends upon the geometry of the body, the

positions of the electrodes and sources, and the conductivities of the body tissues.

The problem now is to get an estimate of the source signals s(t) knowing only m(t), and from

that estimate, separate out the estimate of fetal source signals.

Let each measurement consist of q samples. Then the measurements can be stored in a matrix

M of order p� q.

We now show that the SVD of M can be used to get estimates of the source signals. Let

M = U�V T (10.4.6)

be the SVD of M .

676

Page 298: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Then the p� q matrix S de�ned by

S = UTM (10.4.7)

will contain p estimates of the source signals. Next, we need to extract the estimates of the fetal

source signals from S; let this be called SF :

Partition the matrix of singular values � of M as follows:

� =

0BB@�m 0 0

0 �F 0

0 0 �0

1CCA ; (10.4.8)

where �M contains rm large singular values, associated with the maternal heart, �F contains rf

singular values, those smaller ones associated with the fetal heart, and �0 contains the remaining

singular values associated with noise, etc.

Let U = (UM ; UF ; U0) be a conformable partitioning of U . Then, obviously, we have

S = UTM =

0BB@U

TM

UTF

UT0

1CCAM

=

0BB@U

TMM

UTFM

UT0 M

1CCA =

0BB@SM

SF

S0

1CCA ;

(10.4.9)

Thus SF = UTFM .

Once SF is determined, we can also construct a matrix F containing only the contributions of

fetus in each measured signal, as follows:

F = UF SF =

rm+rfXi=rm+1

�iuivTi ;

where ui and vi are the ith column of U and V , and �i is the i

th singular value of M . The signals

in SF are called the principal fetal signals.

The above method has been automated and an on-line adaptive algorithm to compute the U -

matrix has been designed. For the details of the method and test results, see the paper by Callaerts,

DeMoor, Van Dewalle and Sansen (1990).

Note that if the SVD of M is given by

M = U�V T

= (U1; U2)

�1 0

0 �2

! V

T1

VT2

!;

then S can be estimated by S = UT1 M:

677

Page 299: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

10.5 Sensitivity of the Singular Values

Since the squares of the singular values of A are just the eigenvalues of the real symmetric matrix

ATA, and we have seen before that the eigenvalues of a symmetric matrix are insensitive to small

perturbations, the same thing should be expected of the singular values as well.

Indeed, the following important result holds. The result is analogous to a result on the sensitivity

of the eigenvalues of a symmetric matrix stated in Chapter 8. The result basically states that, like

the eigenvalues of a symmetric matrix, the singular values of a matrix are well-conditioned.

Theorem 10.5.1 (Perturbation Theorem for Singular Values). Let A and

B = A+E be twom�n matrices (m � n). Let �i; i = 1; : : : ; n and ~�i, i = 1; : : : ; n

be, respectively, the singular values of A and A + E, in decreasing order. Then

j~�i � �ij � kEk2; for each i.

Proof. The proof is based on the interesting relationship between the singular values of the matrix

A and the eigenvalues of the symmetric matrix

~A =

0 A

AT 0

!;

displayed in Theorem 10.3.2. It has been shown there that the nonzero eigenvalues of ~A are

�1; : : : ; �k;��1; : : : ;��k, where �1 through �k are the nonzero singular values of A. The remaining

eigenvalues of ~A are, of course, zero. De�ne now ~

B =

0 B

BT 0

!;

~E =

0 E

ET 0

!; we have

~B � ~

A = ~E.

The eigenvalues of ~B and ~

E are related respectively, to the singular values of B and E in the

same way the eigenvalues of ~A are related to the singular values of A. The result of Theorem ??

now follows immediately by applying the Bauer-Fike Theorem (Theorem 8.7.1) to ~B;

~A; and ~

E.

Example 10.5.1

A =

0BB@1 2 3

3 4 5

6 7 8

1CCA ; E =

0BB@0 0 0

0 0 0

0 0 :0002

1CCA : (10.5.1)

The singular values of A:

�1 = 14:5576

�2 = 1:0372 (10.5.2)

�3 = 0:0000

678

Page 300: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

The singular values of A+E:

~�1 = 14:5577

~�2 = 1:0372

~�3 = 0:0000

kEk2 = :0002 (10.5.3)

j~�1 � �1j = 1:1373� 10�4

j~�2 � �2j = 0

j~�3 � �3j = 0:

We now present a result (without proof) on perturbation of the singular values that uses Frobe-

nius norm instead of 2-norm. The result of Theorem 10.5.2 will be used later in deriving a result

on the closeness of A to a number of lower rank. (Theorem 10.6.2.)

Theorem 10.5.2 Let A; E; �i and ~�i, i = 1; :::; n be the same as in Theorem

10.5.1. Then vuut nXi=1

(~�i � �i)2 � kEkF :

10.6 The Singular Value Decomposition and the Structure of a Matrix

The SVD can be very e�ectively used to compute certain important properties relating to the

structure of a matrix, such as its rank (in fact, nearness to rank-de�ciency, which is an

important practical issue), Euclidean norm, condition number and orthonormal basis

for the null space and range, etc. We will discuss these applications in this section.

679

Page 301: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

10.6.1 The Norms and the Condition Number

Theorem 10.6.1 Let �1 � �2 � � � � � �n be the n singular values of an m � n

matrix A(m � n). Then

1. kAk2 = �1 = �max,

2. kAkF = (�21 + �22 + � � �+ �

2n)

1

2 ,

3. kA�1k2 =1

�n

, when A is n� n and nonsingular,

4. Cond2(A) = kAk2kA�1k2 =�1

�n

=�max

�min

.

Proof.

1. kAk2 = kU�V Tk2= k�k2 = max

i(�i)

= �1:

(Note that the 2-norm and F -norm are invariant under unitary matrix products.)

2. kAkF = kU�V TkF= k�kF= (�21 + �

22 + � � �+ �

2n)

1

2 :

3. To prove 3 we note that the largest singular value of A�1 is1

�n

. (Note that when A is

invertible, �n 6= 0). Then the result follows from 1.

4. Follows from the de�nition of Cond2(A) and 1 and 3.

Remark: When A is rank-de�cient, �min = 0, and we say that Cond(A) is in�nite.

Example 10.6.1

A =

0BB@1 2 3

3 4 5

6 7 8

1CCA

�1 = 14:5576; �2 = 1:0372; �3 = 0:0000

680

Page 302: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

1. kAk2 = �1 = 14:5576

2. kAkF =p�21 + �

22 + �

23 = 14:5945

10.6.2 Orthonormal Bases for the Null Space and the Range of a Matrix

In Chapter 5 we have shown how to construct orthonormal bases for the range and the null-space

of a matrix A using QR decomposition. In this section we show how the singular vectors can be

used to construct these bases.

Let r be the rank of A, that is,

�1 � �2 � � � � � �r > 0; (10.6.1)

�r+1 = � � � = �n = 0: (10.6.2)

Let uj and vj be the columns of U and V in the SVD of A. Then the set of columns vj

corresponding to the zero singular values of A form an orthonormal basis for the null-

space of A. This is because, when �j = 0; vj satis�es Avj = 0 and is therefore in the null-space of

A. Similarly, the set of columns uj corresponding to the nonzero singular values is an

orthonormal basis for the range of A.

Orthogonal Projections

Once the orthonormal bases for the range R(A) and the null-space N(A) of A are obtained, the

orthogonal projections can be easily computed. Thus if we partition U and V as

U = (U1; U2); V = (V1; V2);

where U1 and V1 consist of the �rst r columns of U and V , then

Computing Projections Using the SVD

1. Projection onto R(A) = U1UT1 .

2. Projection onto N(A) = V2VT2 .

3. Projection onto the orthogonal complement of R(A) = U2UT2 .

4. Projection onto the orthogonal complement of N(A) = V1VT1 .

681

Page 303: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Example 10.6.2

A =

0BB@1 2 3

3 4 5

6 7 8

1CCA

�1 = 14:5576; �2 = 1:0372 �3 = 0:

U =

0BB@0:2500 0:8371 0:4867

0:4852 0:3267 �0:81110:8378 �0:4379 0:3244

1CCA

V =

0BB@0:4625 �0:7870 0:4082

0:5706 �0:0882 �0:81650:6786 �0:6106 0:4082

1CCA

An orthonormal basis for the null-space of A =

0BB@

0:4082

�0:81650:4082

1CCA.

An orthonormal basis for the range of A =

0BB@0:2500 0:8371

0:4852 0:3267

0:8370 �0:4379

1CCA. (Compute now the four

orthogonal projections yourself.)

10.6.3 The Rank and the Rank-De�ciency of a Matrix

Finding the rank of an m�n matrix and, in particular, determining the nonsingularity of a square

matrix are very important and frequently arising tasks in linear algebra and many important

applications. The most obvious and the least expensive way of determining the rank of a matrix

is, of course, to triangularize the matrix using Gaussian elimination and then to �nd the rank

of the reduced upper triangular matrix. Theoretically, �nding the rank of a triangular matrix is

trivial; one can just read it o� from the diagonal. Unfortunately, however, this is not a very reliable

approach in oating point computations. In practice, it is more important, as we will see below, to

determine if the given matrix is near a matrix of a certain rank and in particular, to know if it is near

a rank-de�cient matrix. The Gaussian elimination method which uses elementary transformations,

may transform a rank-de�cient matrix rank into one having full rank, due to numerical round-o�

error.

Another approach, which is more reliable than Gaussian elimination, to determine the rank

and rank-de�ciency, is the QR factorization with column pivoting. As we have seen before in

682

Page 304: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Chapter 5 this method constructs a permutation matrix P , and orthogonal matrix Q such that

QTAP =

R1 R2

0 0

!; (10.6.3)

R1 is upper triangular and nonsingular, and the dimension r of R1 is the rank of A.

This result above, however, does not determine reliably the nearness of A to a rank-de�cient

matrix. For details, see again Golub and Van Loan (MC, 1984, pp. 166-167) and our discussions

on rank-revealing QR factorization in Chapter 5.

The most reliable way to determine the rank and nearness to rank-de�ciency is to

use the SVD.

Since the number of nonzero singular values determines the rank of a matrix, we can say that

a matrix A is arbitrarily near a matrix of full rank: just change each zero singular value

by a small number �. It is, therefore, more meaningful to know if a matrix is near a

matrix of a certain rank, rather than knowing what the rank is. The singular value

decomposition exactly answers this question.

Suppose that A has rank r, that is, �1 � �2 � � � � � �r > 0 and �r+1 = � � � = �n = 0. Then

the question is how far A is from a matrix of rank k < r. The following theorems can be

used to answer the question. Theorem 10.6.2 is generally known as the Eckart-Young Theorem (see

Eckart and Young (1939)).

Theorem 10.6.2 Let A = U�V T be the SVD of A, and let rank(A) be r > 0. Let

k � r. De�ne

Ak = U�kVT;

where

�k =

0BBBBBB@

�1 0

.. . 0

0 �k

0 0

1CCCCCCA:

Then (i) rank(Ak) = k, (ii) out of all the matrices of rank k, it is closest to A in

Frobenius norm.

Proof. The statement about the rank is obvious, because,

rank(Ak) = rank(U�kVT ) = rank(�k) = k:

683

Page 305: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

To prove the second part, we �rst prove that if A has (n � k) small singular values, then A is

close to Ak. Indeed, kAk � Ak2F = kU(�k � �)V Tk2F = k�k � �k2F = �2k+1 + � � �+ �

2n: Thus if the

(n�k) singular values �k+1; : : : ; �n are small, then it is close to Ak. Next, we show that if B is any

other matrix of rank k,

kB �Ak2F � kAk � Ak2F :

To see this, let's denote the singular values of B by �1 � �2 � � � � � �n. Then since B has rank k,

�k+1 = �k+2 = � � � = �n = 0. By Theorem 10.5.2, we then have

kB �Ak2F �nXi=1

j�i � �ij2 � �2k+1 + � � �+ �

2n = kAk � Ak2F :

We now present a similar result (without proof) using 2-norm.

Theorem 10.6.3 Out of all the matrices of rank k(k < r), the matrix B, closest

to A is given by

B = U�kVT;

where

�k =

0BBBBBB@

�1 0 0

.. .

0 �k

0 0

1CCCCCCA:

Furthermore, the distance of B from A : kB � Ak2 = �k+1:

Proof. See Watkins (FMC, pp. 413-414).

Corollary 10.6.1 If the distance of the matrix B from A is less than the smallest singular value

of A, then B must have rank at least r. That is, if B is such that kB �Ak2 < �r , then

rank(B) = k � r:

Corollary 10.6.2 The relative distance of a nonsingular matrix A to the nearest singular matrix

B is1

Cond2(A). That is,

kB �Ak2kAk2

=1

Cond2(A):

684

Page 306: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Implication of the above results

Distance of A Matrix From the Nearest Matrix of Lower

Rank

The above result states that the smallest nonzero singular value gives

the distance from A to the nearest matrix of lower rank. In particu-

lar, for a nonsingular n � n matrix A, �n gives the measures of the

distance of A to the nearest singular matrix.

Thus, in order to know if a matrix A of rank r is close enough to a

matrix of lower rank, look into the smallest nonzero singular value

�r. If this is very small, then the matrix is very close to a matrix

of rank r � 1, because there exists a perturbation of size small as

j�rj which will produce a matrix of rank r � 1. In fact, one such

perturbation is ur�rvTr .

Example 10.6.3

A =

0BB@1 0 0

0 2 0

0 0 0:0000004

1CCA

rank(A) = 3; �3 = 0:0000004

U =

0BB@0 1 0

1 0 0

0 0 1

1CCA ;

V =

0BB@0 1 0

1 0 0

0 0 1

1CCA

A0 = A � u3�3v

T3 =

0BB@1 0 0

0 2 0

0 0 0

1CCA :

rank(A0) = 2:

685

Page 307: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

The required perturbation u3�3vT3 to make A singular is very small:

10�6

0BB@0 0 0

0 0 0

0 0 :4

1CCA :

10.6.4 An Outer Product Expansion of A and Its Consequences

In many applications the matrix size is so large that the storage of A may require a major part of

total available memory space.

The knowledge of nonzero singular values and the associated left and right singular vectors can

help store the matrix with a substantial amount of savings in storage space.

Let A be m�n (m � n), and �1; : : : ; �r be the nonzero singular values of A. Let the associated

right and left singular vectors be v1; : : : ; vr, and u1; : : : ; ur, respectively. Then the following theorem

shows that A can be written as the sum of r matrices each of rank 1. Since a rank-one matrix of

order m � n can be stored using only (m+ n) storage locations rather than mn locations needed

to store an arbitrary matrix, this will result in a very substantial savings, if r is substantially less

than n.

Theorem 10.6.4

A =

rXj=1

�jujvTj :

Proof. The proof follows immediately from the relation

A = U�V T;

noting that �r+1 through �n are zero.

De�nition 10.6.1 The representation of A =

rXj=1

�jujvTj is called the dyadic or the outerproduct

expansion of A.

Example 10.6.4

A =

0BB@1 2 3

3 4 5

6 7 8

1CCA

686

Page 308: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

�1 = 14:5576

�2 = 1:0372

�3 = 0; r = 2:

u1 =

0BB@:2500

:4852

:8379

1CCA ; u2 =

0BB@

:8371

:3267

�0:4389

1CCA

v1 =

0BB@:4625

:5706

:6786

1CCA ; v2 =

0BB@�:7870�:08820:6106

1CCA

�1u1vT1 + �2u2v

T2 =

0BB@1 2 3

3 4 5

6 7 8

1CCA :

An Important Consequence

Theorem 10.6.4 has an important practical consequences. In practical applications, the matrix

A generally has a large number of small singular values. Suppose there are (n� k) small singular

values of A which can be neglected. Then the matrix Ak = �1u1vT1 + a2u2v

T2 + � � �+ �kukv

Tk is a

very good approximation of A, and such an approximation can be adequate in applications. For

example, in digital image processing, even when k is chosen much less than n, the digital image

corresponding to Ak can be very close to the original image. For details see Andrews and Hunt

(1977). If A is n� n, the storage of Ak will require 2nk locations compared to n2 locations needed

to store A, resulting in a large amount of savings.

10.6.5 Numerical Rank

As we have just seen in the last section in practical applications that need singular values we have

to know when to accept a computed singular value to be \zero". Of course, if it is of an order of

\round-o� zeros" (machine epsilon), we can declare it to be zero.

However, if the data shares large relative error, it should also be taken into consideration. A

practical criterion would be

Accept a computed singular value to be zero if it is less than or equal to

10�tkAk1; where the entries of A are correct to t digits.

Having de�ned a tolerance � = 10�tkAk1 for a zero singular value, we can have the

following convention (see Golub and Van Loan (MC (1989)), p. 247):

687

Page 309: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

A has \numerical rank" r if the computed singular values ~�1; ~�2; : : : ; ~�n

satisfy

~�1 � ~�2 � � � � � ~�r > � � ~�r+1 � � � � � ~�n (10.6.4)

Thus to determine the numerical rank of a matrix A, count the \large" singular

values only. If this number is r, then A has numerical rank r.

Remark: Note that �nding the numerical rank of a matrix will be \tricky" if there is no

suitable gap between a set of singular values.

10.7 Computing the Variance-Covariance Matrix

In Chapter 7 we have described a method to compute the variance-covariance matrix (ATA)�1

using the QR factorization of A. We note here this matrix can also be computed immediately once

the singular values and the left singular vectors of A have been computed.

Computing (ATA)�1 Using the SVD

Let

A = U�V T

be the SVD of A, then the entries of the matrix C = (ATA)�1 = (cij) are given by

cij =

nXk=1

vikvjk

�2k

, where n = rank(A). (Note that C = (ATA)�1 = V ��2V T

:)

Example 10.7.1

A =

0BB@1 2

2 3

3 4

1CCA :

c11 =v211

�21

+v212

�22

= 4:833;

c12 =v11v21

�21

+v212v22

�22

= �3:3333;

688

Page 310: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

c22 =v221

�21

+v222

�22

= 2:3333:

10.8 The Singular Value Decomposition, the Least Squares Problem, and the

Pseudo-Inverse

In Chapter 7 we have seen that the full-rank linear least squares problem can be e�ectively solved

using the QR decomposition, but pivoting will be needed to handle the rank-de�cient case.

We have just seen that the singular values of A are needed to determine the reliably nearness

to rank de�ciency. We will now see that the SVD is also an e�ective tool to solve the least squares

problem, both in the full rank and rank-de�cient cases.

10.8.1 The SVD and Least Squares Problem

We have brie y discussed how to solve a least-squares problem using the SVD in Chapter 7. Here

we give a full treatment.

Consider the least squares problem once more: Find x such that krk2 = kAx � bk2 is

minimum.

Let A = U�V T be the SVD of A. Then we have

krk2 = k(U�V Tx� b)k2

= kU(�V Tx� U

Tb)k2

= k�y � b0k2;

where V Tx = y and U

Tb = b

0. Thus, the use of the SVD of A reduces the least squares

problem for a full matrix A to one with a diagonal matrix �:

Find y such that

k�y � b0k2

is minimum.

The reduced problem is trivial to solve.

We have

k�y � b0k2 =

kXi=1

j�iyi � b0

ij2 +mX

i=k+1

jb0ij2;

689

Page 311: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

where k is the number of nonzero singular values of A. Thus the vector

y =

0BBBBB@

y1

y2

...

yn

1CCCCCA

that minimizes k�y � b0k2 is given by:

yi =b0

i

�i

; when �i 6= 0

yi = arbitrary; when �i = 0.

(Note that when k < n; yk+1 through ym do not appear in the above expression and therefore do

not have any e�ect on the residual.) Of course, once y is computed, the solution can be recovered

from x = V y:

Since corresponding to each \zero" singular value �i; yi can be set arbitrarily, in the rank-

de�cient case, we will have in�nitely many solutions to the least squares problem. There are in-

stances where this rank de�ciency is actually desirable because it provides a rich family of solutions

which might be used for optimizing some other aspect of the original problem. In the full rank case

the least squares solution is, of course, unique.

The above discussion can be summarized in the following algorithm.

Algorithm 10.8.1 Least Squares Solutions Using the SVD

1. Find the SVD of A:

A = U�V T:

2. Form b0 = U

Tb =

0BBBBB@

b0

1

b0

2...

b0

m

1CCCCCA.

3. Compute y =

0BB@y1

...

yn

1CCA choosing

yi =

8><>:

b0

i

�i

; when �i 6= 0

arbitrary, when �i = 0:

1CA :

4. Then the family of least squares solutions is

x = V y:

(Note that in the full-rank case, the family has just one number.)

690

Page 312: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Flop-count: Using the Golub-Kahan-Reinsch method to be described later, it takes about

2mn2 + 4n3 ops to solve the least squares problem, when A is m � n and m � n. (In deriving

this op-count, it is noted that the complete vector b does not need to be computed; then only the

columns of U that correspond to the nonzero singular values are needed in computation.)

An Expression for the Minimum Norm Least Squares Solution

It is clear from Step 3 above that in the rank-de�cient case, the minimum 2-norm least squares

solution is the one that is obtained by setting yi = 0, whenever �i = 0. Thus, from above, we have

the following expression for the minimum 2-norm solution:

Minimum Norm Least-Squares Solution Using the

SVD

x =rX

i=1

uTi b

0

i

�i

vi; (10.8.1)

where r = rank(A).

Example 10.8.1

A =

0BB@1 2 3

2 3 4

1 2 3

1CCA ; b =

0BB@6

9

6

1CCA :

1. �1 = 7:5358;

�2 = 0:4597;

�3 = 0:

A is rank-de�cient.

U =

0BB@

:4956 :5044 :7071

:7133 �:7008 0:0000

0:4956 0:5044 �0:7071

1CCA ; V =

0BB@

:3208 �0:8546 0:4082

0:5470 �0:1847 �0:81650:7732 0:4853 0:4082

1CCA :

2. b0 = UTb = (12:3667;�0:2547; 0)T:

3. y = (1:6411;�0:5541; 0):

4. The minimum 2-norm least-squares solution is V y = (1; 1; 1)T:

691

Page 313: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

10.8.2 Solving the Linear System Using the Singular Value Decomposition

Note that the idea of using the SVD in the solution of the least squares problem can be easily

applicable to determine if a linear system Ax = b has a solution, and, if so, how to compute it.

Thus if

A = U�V T;

then

Ax = b

is equivalent to

�y = b0

where y = VTx; and b

0 = UTb:

So, the system Ax = b is consistent i� the diagonal system �y = b0 is consistent

(which is trivial to check), and a solution of Ax = b can be computed by solving the diagonal

system �y = b0 �rst, and then recovering x from x = vy. However, this approach will be much

more expensive than the Gaussian elimination and QR methods. That is why the SVD is not

used in practice, in general, to solve a linear system.

10.8.3 The SVD and the Pseudoinverse

In Chapter 7 we have seen that when A is an m � n (m � n) matrix having full rank, the

pseudoinverse of A is given by:

Ay = (AT

A)�1AT:

A formal de�nition of the pseudoinverse of any matrix A (whether it has full rank or not) can be

given as follows:

692

Page 314: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Four Properties of the Pseudoinverse

The pseudoinverse of an m � n matrix A is an n � m matrix X

satisfying the following conditions:

1. AXA = X .

2. XAX = X:

3. (AX)T = AX:

4. (XA)T = XA:

The pseudoinverse of a matrix always exists and is unique. We now show that the SVD

provides a nice expression for the pseudoinverse.

Let A = U�V T be the SVD of A; then it is easy to verify that the matrix

V �yUT; where

�y = diag(1

�j

);

(if �j = 0, use1

�j

= 0);

(10.8.2)

satis�es all the four conditions, and therefore is the pseudoinverse of A. Note that this expression

for the pseudoinverse coincides with A�1 when A is nonsingular, because

A�1 = (AT

A)�1AT (10.8.3)

= (V�TU

TU�V T )�1V �T

UT

= V ��1(�T )�1V TV�T

UT

= V ��1UT

(Note that in this case, �y = ��1):

The process for computing the pseudoinverse Ay of A using the SVD of A can be summarized

as follows.

Algorithm 10.8.2 Computing the Pseudoinverse Using the SVD

1. Find the SVD of A:

A = U�V T:

693

Page 315: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

2. Compute

�y = diag

0BBBBBBBBB@

1�1

1�2

. . . 0

1�r

0 0

1CCCCCCCCCA;

where �1; : : : ; �r are the r nonzero singular values of A.

3. Compute Ay = V�yUT .

Example 10.8.2 Find the pseudoinverse of

A =

0BB@

0 0 �1�1 0 0

0 �1 0

1CCA0BB@1 0 0

0 2 0

0 0 0

1CCA0BB@

1

3�6

9�6

9

�6

9

1

3�6

9

�69

�69

13

1CCA

A = U�V T; A

y = V �yUT

�y =

0BB@1 0 0

0 12

0

0 0 0

1CCA

UT =

0BB@

0 �1 0

0 0 �1�1 0 0

1CCA

VT = V:

Thus

Ay =

0BB@

13

�69

�69

�6

9

1

3�6

9

�6

9�6

9

1

3

1CCA0BB@1 0 0

0 1

20

0 0 0

1CCA0BB@

0 �1 0

0 0 �1�1 0 0

1CCA =

0BB@0 �1

3�1

3

0 2

3�1

6

0 2

3

1

3

1CCA

The Pseudoinverse and the Least Squares Problem

>From (10.8.1) and (10.8.2), it follows that the minimum 2-norm solution of the

linear least squares problem obtained through the SVD in the previous section is

Ayb;

where Ay is the pseudoinverse of A.

694

Page 316: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Example 10.8.3

A =

0BB@1 2 3

2 3 3

1 2 3

1CCA ; b =

0BB@6

8

6

1CCA

Ay =

0BB@�0:9167 1:3333 �0:9167�0:1667 0:3333 �0:16670:5833 �0:6667 0:5833

1CCA

The minimum 2-norm least squares solution is

Ayb =

0BB@1

1

1

1CCA :

10.9 Computing the Singular Value Decomposition

As mentioned before, the ability of the singular values and the singular vectors to compute e�ectively

the numerical rank, the condition number, the orthonormal bases of the range and the null spaces,

the distance of a matrix A from a matrix of lower rank, etc., is what makes the singular value

decomposition so attractive in many practical applications. Therefore, it is important to know how

the SVD can be computed in a numerically e�ective way. In this section we will discuss this most

important aspect of the SVD.

10.9.1 Computing the SVD from the Eigenvalue Decomposition of ATA

We have seen (Theorem 10.3.1) that the singular values of a matrix A are just the nonnegative

square roots of the eigenvalues of the symmetric matrix ATA. It is thus natural to think of

computing the singular values by �nding the eigenvalues of the symmetric matrix ATA. However,

this is not a numerically e�ective approach because, as we have seen in Chapter 7, some vital

information may be lost due to round-o� error in the process of computing ATA.

The following simple example will illustrate the phenomenon:

Example 10.9.1

A =

1:0001 1:0000

1:0000 1:0001

!(10.9.1)

The singular values of A are 2.0010 and 0.0001.

Now

ATA =

2:0002 2:0002

2:0002 2:0002

!

695

Page 317: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

(to four signi�cant digits).

The eigenvalues of ATA are 0.0000 and 4.0004.

10.9.2 The Golub-Kahan-Reinsch Algorithm

The following algorithm is nowadays a standard computational algorithm for computing the singular

values and the singular vectors. The LINPACK SVD routine is based on this algorithm. The

ALGOL codes for this procedure has been described in a paper by Golub and Reinsch (1970). A

Fortran program implementing the algorithm appears in Businger and Golub (1969). The algorithm

comes in two stages:

Stage I: The m�n matrix A(m � n) is transformed to an upper bidiagonal matrix by orthogonal

equivalence:

UT0m�m

Am�n V0n�n =

B

0

!(10.9.2)

where B is an n � n bidiagonal matrix given by0BBBBB@

b11 b12 0

0.. .

. . ....

.... . .

. . . bn�1;n

0 0 0 bnn

1CCCCCA :

Stage II: The bidiagonal matrix B is further reduced by orthogonal equivalence to a diagonal

matrix �:

UT1 BV1 = � = diag(�1; : : : ; �n): (10.9.3)

Of course, � is the matrix of singular values. The singular vector matrices U and V are given

by

U = U0U1 (10.9.4)

V = V0V1 (10.9.5)

Remark: In the numerical linear algebra literature, Stage I is known as the Golub-Kahan

bidiagonal procedure, and Stage II is known as the Golub-Reinsch algorithm. We will call the

combined two-stage procedure by the Golub-Kahan-Reinsch method.

High relative accuracy of the singular values of bidiagonal matrices.

The following result due to Demmel and Kahan (1990) shows that the singular values of a

bidiagonal matrix can be computed with very high accuracy.

696

Page 318: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Theorem 10.9.1 Let B = (bij) be an n � n bidiagonal matrix. Let �B = (�bij).

Suppose that bii + �bii = �2i�1bii, and �bi;i+1 + bi;i+1 = �2ibi;i+1; �j 6= 0.

Let � = �2n�1i=1 max(j�ij; j��1i j): Let �1 � � � � � �n be the singular values of B and

let �01 � � � � � �0

n be the singular values of B + �B. Then

�i

� �0

i � ��i; i = 1; : : : ; n: (10.9.6)

Reduction to Bidiagonal Form

The matrices U0 and V0 in Stage I are constructed as the product of Householder matrices as

follows:

U0 = U01U02 � � �U0n (10.9.7)

and

V0 = V01V02 � � �V0;n�2: (10.9.8)

Let's illustrate the construction of U01; V01 and U02; V02, and their role in the bidiagonalization

process with m = 5 and n = 4:

First, a Householder matrix U01 is constructed such that

A(1) = U01A =

0BBBBBBBB@

� � � �0 � � �0 � � �0 � � �0 � � �

1CCCCCCCCA

Next, a Householder matrix V01 is constructed such that

A(2) = A

(1)V01 =

0BBBBBBBB@

� � 0 0

0 � � �0 � � �0 � � �0 � � �

1CCCCCCCCA=

0BBBBBBBBB@

� � 0 0

0

0 A0

0

0

1CCCCCCCCCA

The process is now repeated with A(2); that is,

697

Page 319: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Householder matrices U02 and V02 are constructed so that

U02A(2)V02 =

0BBBBBBBB@

� � 0 0

0 � � 0

0 0 � �0 0 � �0 0 � �

1CCCCCCCCA

Of course, in this step we will work with the 4 � 3 matrix A0 rather than the matrix A

(2). Thus,

the orthogonal matrices U 0

02 and V0

02 will be constructed �rst such that

U0

02A0

V0

02 =

0BBBBB@

� � 0

0 � �0 � �0 � �

1CCCCCA ;

then U02 and V02 will be constructed from U0

02 and V0

02 in the usual way, that is, by embedding them

in identity matrices of appropriate orders. The process is continued until the bidiagonal matrix B

is obtained.

Example 10.9.2

A =

0BB@1 2 3

3 4 5

6 7 8

1CCA :

Step 1.

U01 =

0BB@�0:1474 �0:4423 �0:8847�0:4423 0:8295 �0:3410�0:8847 �0:3410 0:3180

1CCA

A(1) = U01A =

0BB@�6:7823 �8:2567 �9:7312

0 0:0461 0:0923

0 �0:9077 �1:8154

1CCA

Step 2.

V01 =

0BB@1 0 0

0 �0:6470 0:7625

0 �0:5571 0:6470

1CCA

A(2) = A

(1)V01 =

0BB@�6:7823 12:7620 0

0 �1:0002 0:0245

0 1:9716 �0:4824

1CCA

698

Page 320: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Step 3.

U02 =

0BB@1 0 0

0 �0:0508 0:9987

0 0:9987 0:0508

1CCA

B = U02A(2) = U021A

(1)V01 = U02U01AV01 =

0BB@�6:7823 12:7620 0

0 �1:0081 �1:81780 0 0

1CCA

Note that from the above expression of B, it immediately follows that zero is a singular value

of A.

Finding the SVD of the Bidiagonal Matrix

The process is a variant of the QR iteration. Starting from the n � n bidiagonal matrix B

obtained in Stage 1, it successively constructs a sequence of bidiagonal matrices fBkg such that eachBi has possibly smaller o�-diagonal entries than the previous one. The ith iteration is equivalent to

applying the implicit symmetric QR, described in Chapter 8, with Wilkinson shift to the symmetric

tridiagonal matrix BTi Bi without, of course, forming the product BT

i Bi explicitly. The e�ective

tridiagonal matrices are assumed to be unreduced (note that the implicit symmetric QR works

with unreduced matrices); otherwise we would work with decoupled SVD problems. For example,

if bk;k+1 = 0, then B can be written as the direct sum of two bidiagonal matrices B1 and B2 and

�(B) = �(B1) [ �(B2).

The process has guaranteed convergence and the rate of convergence is quite fast. The details of

the process can be found in the book by Golub and Van Loan (MC 1984 pp. 292-293). We outline

the process brie y in the following.

In the following just one iteration step of the method is described. To simplify the notation,

let's write

B =

0BBBBB@

�1 �2

. . .. . .. . . �n

�n

1CCCCCA (10.9.9)

be an n � n bidiagonal matrix. Then the Wilkinson-shift � for the symmetric matrix BTB is the

eigenvalue � of 2� 2 right-hand corner submatrix �2n�1 + �

2n�1 �n�1�n

�n�n�1 �2n + �

2n

!(10.9.10)

that is closer to �2n + �

2n:

699

Page 321: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

1. Compute a Givens rotation J 01 such that J 01

�21 � �

�1�2

!=

�0

!:

Form J1 =

J0

1 0

0 In�2

!:

2. Apply J1 to the right of B, that is form

B � BJ1

This will give a �ll-in at the (2,1) position of B. That is, we will have

B � BJ1 =

0BBBBBBBB@

� �+

.... . .. . .

. . .

. . . ��

1CCCCCCCCA

(10.9.11)

where + indicates a �ll-in.

(The �ll-in is at the (2,1) position.)

The idea is now to chase the nonzero entry `+' down the subdiagonal to the end of the matrix

by applying the Givens rotations in an appropriate order as indicated by the following:

3. B � JT2 B =

0BBBBBBBB@

� � +

� . . .. . .

. . .

. . . ��

1CCCCCCCCA

(Fill-in at the (1,3) position)

B � BJ3 =

0BBBBBBBB@

� �� . . .

+.. .

. . .

. . . ��

1CCCCCCCCA

(Fill-in at (3,2) position)

4. B � JT4 B =

0BBBBBBBB@

� �� � +

.... . .. . . �

1CCCCCCCCA

(Fill-in at (2,4) position)

700

Page 322: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

B � BJ5 =

0BBBBBBBB@

� �� �

� . . .

+.. . �

1CCCCCCCCA

(Fill-in at the (4,3) position.) And so on.

At the end of one iteration we will have a new bidiagonal matrix B orthogonally equivalent to

the original bidiagonal matrix B:

B = (JT2n�2 � � �JT

4 JT2 )B(J1J3 � � �Jn�1):

Example 10.9.3

B =

0BB@1 2 0

0 2 3

0 0 1

1CCA

1. The Wilkinson shift � = 15:0828

J1 =

0BB@�:9901 :1406 0

�:1406 �:9901 0

0 0 0

1CCA

2.

B � BJ1 =

0BB@�1:2713 �1:8395 0

�0:2812 �1:9801 3

0 0 1

1CCA

(The �ll-in at the (2,1) position.)

3.

J2 =

0BB@�:9764 �:2160 0

0:2160 �:9764 0

0 0 1

1CCA

B � J2B =

0BB@1:3020 2:2238 �:64800 1:5361 �2:92920 0 1

1CCA

(The �ll-in at (1,3) position)

J3 =

0BB@1 0 0

0 0:9601 :2797

0 �:2797 :9601

1CCA

701

Page 323: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

B � BJ3 =

0BB@1:3020 2:3163 0

0 2:2942 �2:38250 �:2797 :9601

1CCA

(Fill-in at the (3,2) position)

4.

J4 =

0BB@1 0 0

0 :9926 �:12100 :1210 :9926

1CCA

B � J4B =

0BB@1:3020 2:3163 0

0 2:3112 �2:48120 0 :6646

1CCA

Stopping Criterion

The algorithm typically requires a few iteration steps before the o�-diagonal entry �n becomes

negligible. A criterion for o�-diagonal negligibility given in Golub and Van Loan (MC 1984 p. 434)

is:

A Criterion for Neglecting an O�-Diagonal Entry

Accept an o�-diagonal �i to be zero if

j�ij � �(j�ij+ j�i�1j);

where � is a small multiple of the machine precision �.

Flop-Count: The cost of the method is determined by the cost of Stage I. Stage II is iterative and

is quite cheap. The estimated op-count is: 2m2n+ 4mn2+

9

2n3(m � n). This count includes

the cost of U; �; and V . There are applications (e.g., least squares) where all three matrices

are not explicitly required. A nice table of di�erent op-count of the Golub-Kahan-Reinsch SVD

and the Chan SVD (to be described in the next section) for di�erent requirements of U; �, and V

appears in Golub and Van Loan (MC 1984, p. 175).

Round-o� Property: It can be shown (Demmel and Kahan (1990)) that the computed SVD,

U �(V )T , produced by the Golub-Kahan-Reinsch algorithm is nearly the exact SVD of A+E, that

is,

A+E � (U + �U)�(V + �V );

702

Page 324: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

where U + �U and V + �V are orthogonal,

(kEk2jkAk2) � p(m;n)�; k�Uk � p(m;n)�;

k�V k � p(m;n)�;

and p(m;n)� is a slowly growing function of m and n.

Entrywise Errors of the Singular Values

Furthermore, let �i be a computed singular value, then

j�i � �ij � �p(n)kAk2 = �p(n)�max;

where p(n) is a slowly growing function of n.

The result says that the computed singular values can not di�er from the true singular values

by an amount larger than � = �p(n)�max.

Thus, the singular values which are not much smaller than �max will be computed

by the algorithm quite accurately, and the small ones may be inaccurate.

10.9.3 The Chan SVD

T. Chan (1982) observed that the Golub-Kahan-Reinsch algorithm for computing the SVD de-

scribed in the last section, can be improved in the case m >

13

8n, if the matrix A is �rst factored

into QR and then the bidiagonalization is performed on the upper triangular matrix R. The im-

provement naturally comes from the fact that the work required to bidiagonalize the triangular

matrix R is much less than that required originally to bidiagonalize the matrix A. Of course, once

the SVD of R is obtained, one can easily retrieve the SVD of A. Thus the Chan-SVD can be

described as follows:

1. Find the QR factorization of A:

QTA =

R

0

!: (10.9.12)

2. Find the SVD of R using the Golub-Kahan-Reinsch algorithm:

R = X�Y T: (10.9.13)

Tony Chan, a Chinese-American mathematician is a professor of mathematics at the University of California,

Los Angeles. He developed this improved algorithm for SVD when he was a graduate student at Stanford University.

703

Page 325: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Then the singular values of A are just the singular values of R. The singular vector matrices U

and V are given by:

U = Q[X j0]; V = Y: (10.9.14)

Flop-Count: The Chan-SVD requires about 2m2n+11n3 ops to compute �; U and V , compared

to 2mn + 4mn2 +9

2n3 ops required by the Golub-Kahan-Reinsch SVD algorithm. Clearly, there

will be savings with the Chan-SVD when m > n.

Remark: The Chan-SVD should play an important role in several applications such as in control

theory, where typically m� n:

Example 10.9.4

A =

0BB@1 2

2 3

4 5

1CCA :

1. The QR factorization of A:

Q =

0BB@�0:2182 �0:8165 �0:5345�0:4364 �0:4082 0:8018

�0:8729 0:4082 �0:2673

1CCA

R =

0BB@�4:5826 �6:1101

0 �0:81650 0

1CCA

(QTA = R)

2. The SVD of R:

R = X�Y T

X =

0BB@�0:9963 0:0856 0

�0:0856 �0:9963 0

0 0 1:0000

1CCA

Y =

0:5956 �0:80330:8033 0:5956

!

� =

0BB@7:6656 0

0 0:4881

0 0

1CCA

704

Page 326: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

3. The Singular Value Decomposition of A = U�V T

The Singular Values of A are 7.6656, 0.4881.

U = Q[X j0] =

0BB@0:2873 0:7948 �0:53450:4698 0:3694 0:8018

0:8347 0:4814 �0:2673

1CCA

V = Y

Flop-Count for the Least-Squares Problem Using the SVD

The number of ops required to solve the linear least squares problem (m � n) using the SVD

computed by the Golub-Kahan-Reinsch algorithm is about 2mn2 + 4n3. If the Chan-SVD is used,

the op-count is about mn2 +17

3n3.

Recall that the op-count for the normal equations approach for the least-squares problem ismn

2

2+n3

6and that using QR factorization (with Householder matrices) is mn2 � n

3=3. Again a

nice table of di�erent least squares methods in regards to their e�ciency appears in Golub and Van

Loan (MC 1984, p. 177).

10.9.4 Computing the Singular Values with High Accuracy: The Demmel-Kahan

Algorithm

The round-o� analysis of the Golub-Kahan-Reinsch algorithm tells us that the algorithm can com-

pute the singular values not much smaller than kAk2 quite accurately; however, the smaller singularvalues may not be computed with high relative accuracy.

Demmel and Kahan (Demmel and Kahan, 1990) in an award-winning paper presented a new

algorithm that computes all the singular values, including the smaller ones, with very high relative

accuracy.

They call this algorithm \QR iteration with a zero shift". The reason for this is that the

new algorithm corresponds to the Golub-Kahan-Reinsch algorithm when the shift is zero. The

new algorithm is based on a remarkable observation that when the shift is zero, no

cancellation due to subtraction occurs, and therefore, the very small singular values

can be found (almost) as accurately as the data permits.

James Demmel is a professor of Computer Science at the University of California-Berkeley. He won several

awards including the prestigious Householder Award (jointly with Ralph Byers of the University of Kansas) in 1984,

the Presidential Young Investigator Award in 1986, the SIAM (Society for Industrial and Applied Mathematics)

Award in 1988, and jointly with William Kahan, in 1991, for the best linear algebra paper and the Wilkinson Prize

in 1993.

705

Page 327: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Indeed the e�ect of the zero shift is remarkable. This is demonstrated in the following. Let J 01

be the Givens rotation such that

(J 01)

�21

�1�2

!=

�0

!:

Compute J1 =

J0

1 0

0 In�2

!. Then

BJ1 =

0BBBBBBBB@

� 0

+ � �. . .

. . .

. . . ��

1CCCCCCCCA;

where there is a �ll-in at the (2,1) position as before, but note that the (1,2) entry now is zero

instead of being nonzero. This zero will now propagate through the rest of the algorithm and is

indeed the key to the e�ectiveness of this algorithm.

Let us now apply J2 to the left of BJ1 to zero the nonzero entry at the (2,1) position. Then

B � J2BJ1 =

0BBBBB@

� � +

� . . .. . . �

1CCCCCA

There is now a �ll-in at the (1,3) position as in the Golub-Kahan-Reinsch algorithm. Since the

rank of the 2� 2 matrix b12 b13

b22 b23

!

is 1, it follows that when J3 is applied to J2BJ1 to the right to zero out (1,3) entry, it will zero out

the (2,3) entry as well; that is, we will have

B � J2BJ1J3 =

0BBBBBBBBBBB@

� � 0

� 0.. . �

. . .. . .. . . �

1CCCCCCCCCCCA

Thus, we now have one extra zero on the superdiagonal compared to the same stage of the Golub-

Kahan algorithm:

This phenomenon continues. Indeed, the rotation J4 zeros out the (3,4) entry as well as the

(2,4) entry, and so on.

706

Page 328: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Example 10.9.5

B =

0BB@1 2 0

0 2 3

0 0 1

1CCA

1.

J1 =

0BB@0:4472 �0:8944 0

0:8944 0:4472 0

0 0 1

1CCA

2.

B � BJ1 =

0BB@2:2361 0 0

1:7889 0:8944 3

0 0 1

1CCA :

(Note that there is a �ll-in at the (2,1) position, but the (1,2) entry is zero.)

3.

J2 =

0BB@

0:7809 0:6244 0

�0:6247 0:7809 0

0 0 1

1CCA :

B � J2B =

0BB@2:8636 0:5588 1:8741

0 0:6984 2:3426

0 0 1

1CCA :

Note that the rank of the 2� 2 matrix 0:5588 1:8741

0:6984 2:3476

!

is one.

J3 =

0BB@1 0 0

0 0:2857 �0:95830 0:9583 0:2857

1CCA

B � BJ3 =

0BB@2:8636 1:9557 0

0 2:4445 0

0 0:9583 0:2857

1CCA

(Note that both (1,3) and (2,3) entries are zero.)

4.

J4 =

0BB@1 0 0

0 0:9310 0:3650

0 �0:3650 0:9310

1CCA

707

Page 329: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

B � J4B =

0BB@2:8636 1:9557 0

0 2:6256 0:1043

0 0 0:2660

1CCA

Note that the singular values of B are: 3.8990, 1.9306, and 0.2657.

Stopping Criterion: Let the nonzero diagonal entries of B be denoted by �1; : : : ; �n, and the

nonzero o�-diagonal entries by �2; : : : ; �n. De�ne the two sequences f�kg and f�kg as follows:

1st sequence: �n = j�njFor j = n � 1 1 to (n-1) do

�j = j�jj � (�j+1/(�j+1 + j�j+1j))and

2nd sequence: �1 = f�1gFor j = n � 1 to 1 do

�j+1 = j�j+1j(�j/(�j + j�j+1j)):

A Criterion for Setting an O�-Diagonal Entry to Zero

Set �j = 0 if

j�j/�j+1j � � or j�j/�jj � �;

where � < 1 is the desired relative accuracy, and f�jg and f�jg are computed as

above.

Remark: For details of how to apply these two di�erent criteria in di�erent situations

in practical implementations, see Demmel and Kahan (1990).

Rate of convergence: The convergence of the last o�-diagonal element to zero is linear with

constant factor �2n�1=�2n: If there is a cluster of singular values of multiplicity m di�erent from the

remaining ones then the convergence will be linear with constant factor �2n�m+1/�2n�m:

Round-o� error: Let �i; i = 1; : : : ; n be the singular values of the computed bidiagonal matrix

B obtained by applying one implicit zero shift QR to B. Let �1 � �2 � � � � � �n. It has been

shown by Demmel and Kahan (1990) that, if

w � 69n2� < 1;

708

Page 330: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

then

j�i � �ij �w

1� w

�i; i = 1; : : : ; n:

Moreover, if after k iterations, the singular values of the then bidiagonal matrix Bk are �k1 � � � � ��kn, then when w � 69n2� < 1, we have

j�i � �kij ��

1

(1� w)k� 1

�� �i � 69kn2� � �i:

The above result basically states that \the relative error in the computed singular values

can only grow with the squares of the dimension". This is a rather pessimistic result. The

authors have given another round-o� result that states that with the approach of the convergences

of the algorithm, \errors do not accumulate at all and the error in the computed �iand

�iis bounded by c0

�; c0 another modest constant".

An error bound on the computed singular values is of the form

c0n�

(1� c0n�)

;

where c0 is another modest constant. For details and the proofs of these results, the reader is

referred to the paper by Demmel and Kahan (1990).

10.9.5 The Di�erential QD Algorithm

Recently Fernando and Parlett (1992) have reported an algorithm based on the di�erential form

of the quotient-di�erence that computes all the singular values with maximal relative accuracy.

This algorithm is claimed to be at least four times faster than the Golub-Kahan-Reinsch algorithm.

Unfortunately, we can not describe the algorithm here, as the machinery needed to explain the

algorithm has not been developed in this book.

10.9.6 The Bisection Method

To conclude the section, we remark that the bisection method for the symmetric eigenvalue problem

discussed in Chapter 8 can be adapted to compute the singular values of a matrix.

Note that the singular values of

B =

2666664

b11 b12 0. . .

. . .

. . . bn�1;n

0 bnn

3777775

are positive eigenvalues of "0 B

T

B 0

#:

709

Page 331: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

The last matrix can be permuted to obtain

T =

0BBBBBBBBBBBBBBBBB@

0 b11

b11

. . . b12

b12

. . . b22

b22

. . . b23

b23

. . .. . .

. . .. . . bn�1;n

bn�1;n

. . . bnn

bnn 0

1CCCCCCCCCCCCCCCCCA

which is a symmetric tridiagonal matrix with 0 diagonal entries. Thus the bisection method de-

scribed earlier in Chapter 8 can now be used to �nd the positive eigenvalues of T , i.e. the singular

values of B. The advantage of the bisection method is its simplicity, accuracy and inherent par-

allelism, see a recent paper by Li, Rhee and Zeng (1993). However, it is ine�cient in sequential

computation compared to QR based algorithms.

10.10 Generalized SVD

The SVD Theorem (Theorem 10.2.1) can be generalized for a pair of matrices A and B, and this

generalized SVD is useful in certain applications such as constrained least squares problems.

The generalization was �rst performed by Van Loan (1976). We merely state the theorem here

without proof. For a proof, see Golub and Van Loan (MC, 1984, pp. 318-319).

Theorem 10.10.1 (Generalized Singular Value Decomposition Theorem)

Let A and B be, respectively, matrices of order m � n and p � n (m � n). Then

there exist orthogonal matrices U and V and a nonsingular matrix W such that

UTAW = C = diag(c1; : : : ; cn); ci � 0

VTBW = D = diag(d1; : : : ; dq); di � 0

where q = min(p; n); d1 � � � � � dr > dr+1 = � � � = dq = 0, r = rank(B). The

elements

�c1

d1

;

c2

d2

; : : : ;

cr

dr

�are called the generalized singular values of A and B.

Charles F. Van Loan is a professor of Computer Science at Cornell University. He is the co-author of the celebrated

book \Matrix Computations".

710

Page 332: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

10.11 Review and Summary

In this section we summarize, for easy reference, the most important results discussed in this

chapter.

1. Existence and Uniqueness of the SVD: The singular value decomposition (SVD) of a

matrix A always exists (Theorem 10.2.1).

A = U�V T:

The singular values (the diagonal entries of �) are unique, but U and V are not unique.

2. Relationship of the singular values and singular vectors with the eigenvalues: The

singular values of A are the nonnegative square roots of the eigenvalues of ATA. (Theorem

10.3.1, see also Theorem 10.3.2.)

3. Sensitivity of the singular values: The singular values are insensitive to small perturba-

tions (Theorem 10.5.1).

4. Applications of the SVD: The singular values and the singular vectors of a matrix A are

useful and most reliable tools for determining the (numerical) rank and the rank-de�ciency

of A; �nding the orthonormal bases for range and the null space of A, �nding the distance

of A from another matrix of lower rank (in particular the nearness to singularity of a

nonsingular matrix); solving both full-rank and the rank-de�cient least squares problems,

and �nding the ipseudoinverse of A, etc.

These remarkable abilities and the fact that the singular values are insensitive to small per-

turbations, have made the SVD an indispensable tool in a wide variety of applications areas

such as the control and systems theory, signal processing, statistical applications, biomedical

engineering, image processing, etc.

5. Computing the SVD: The most widely used approach for computing the SVD of A is

the Golub-Kahan-Reinsch algorithm. This algorithm comes into two phases. In phase

1, the matrix A is reduced to a bidiagonal matrix by orthogonal equivalence, and in phase

2, the bidiagonal matrix is further reduced to a diagonal matrix by orthogonal similarity

using implicit QR iteration with the Wilkinson's shift. Unfortunately, very tiny singular

values may not be computed with very high relative accuracy by this method. A

modi�cation of this method, known as the zero shift QR iteration or the QR iteration

with a zero shift has been proposed byDemmel and Kahan in 1990. The Demmel-Kahan

method computes all the singular values with high relative accuracy.

711

Page 333: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

10.12 Some Suggestions for Further Reading

As mentioned before, applications of the SVD are varied. There are books in each area of appli-

cations where the SVD plays an important role. For applications of the SVD to classical control

problem, see an earlier survey of Klema and Laub (25).

The SVD also plays an important role in modern control theory, especially in H-in�ty and

Robust Control Theory. Curious readers are referred to a growing number of interesting papers in

these areas. For applications of the SVD to robust pole assignment problem, see Kautsky, Nichols

and van Dooren (1985).

For some applications of the SVD to system identi�cation and signal processing problems, see

an interesting survey paper a variety of applications of singular value decomposition in

identi�cation and signal processing by Joos Van Dewalle and Bart DeMoor (1988).

Two important books in in the area of \SVD and Signal processing" are: 1) SVD and Sig-

nal Processing, Algorithms, Applications and Architecture, edited by Ed. F. Depret-

tere, Elsevier Science Publishers B.W. (North Holland), Amsterdam, 1988. 2) SVD and Signal

Processing II, Algorithms, Analysis and Applications, edited by R. Vaccaro, Elsevier,

Amsterdam, 1991.

For applications to image processing, see the book Fundamentals of Digital Image Pro-

cessing by A. K. Jain, Prentice Hall, Information and System Sciences Series, edited by Thomas

Kailath, 1989 and Digital Image Processing by H. C. Andrews and B. R. Hunt, Prentice-Hall,

Inc., 1977.

Many matrices arising in signal processing and control, and systems theory applications are

structured, such as, Hankel, Toeplitz, etc. Finding e�cient and reliable algorithms for di�erent

types of computations that can exploit the structures of these matrices is a challenging problem

to researchers. Much work has been done and it is presently an active area of research. For some

interesting papers in this context, see the book Linear Algebra in Signals, Systems, and

Control, edited by B. N. Datta, et al. SIAM, 1988. See also the recent paper of Van Dooren

(1990).

For some statistical applications, see the excellent survey papers by Golub (1969), and Ham-

marling (1985).

Discussions on mathematical applications of the SVD, such as �nding numerical rank, nearness

to singularity, orthonormal bases for the range and null-space, etc. are contained in all numerical

linear algebra books. The books by Golub and Van Loan (MC) and Watkins (FMC), in particular,

have treated these aspects very well. For discussions on singular values sensitivity, see Stewart

(1979) and (1984).

712

Page 334: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

For computational aspects of singular values and singular vectors, the original paper by Golub

and Kahan (1965), and the recent papers by Demmel and Kahan (1990) and Fernando and Parlett

(1992) are valuable. Codes for the GKR method appear in Golub and Reinsch (1970), and Businger

and Golub (1969).

Fortran codes for the SVD computations also appear in Forsythe, Malcom and Moler (CMMC),

and in Lawson and Hanson (SLS).

The SVD Theorem (Theorem 10.2.1) has been generalized to a pair of matrices (A;B) by Van

Loan (1976). This is known as the generalized singular value decomposition theorem. For the

statement and a proof of this theorem, see Golub and Van Loan (MC 1984, pp. 318-319). For other

papers in this area see Kagstr�om (1985) and Paige and Saunders (1981).

For computational algorithms for the generalized SVD, see Stewart (1983), Van Loan (1985),

and Paige (1986).

For further generalizations of the SVD, see an excellent paper by DeMoor and Zha (1991).

For the SVD of the product of two matrices, see Heath, Laub, Paige and Ward (1986).

713

Page 335: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Exercises on Chapter 10

PROBLEMS ON SECTIONS 10.2 AND 10.3

1. (a) Let A be m � n, and U and V be orthogonal. Then from the de�nitions of singular

values prove that the singular values of A and VTAV are the same.

(b) How are the singular vectors of A related with those of UTAV ?

(c) If m = n and A is symmetric positive de�nite, then prove that the eigenvalues of A are

the same as its singular values.

2. An economic version of the SVD. Let A be m�n (m � n). Let rank(A) = r � n. Then

prove that

A = V SU;

where V is an m � n matrix with orthonormal columns, S is a nonsingular r � r diagonal

matrix, and U is an r � n matrix with orthonormal rows. Why is the version called the

Economic Version?

3. Let � be a singular value of A with multiplicity `; that is, �i = �i+1 = � � � = �i+`�1. Let

U�V T be the singular value decomposition of A. Then construct ~U and ~V such that ~U�(~V )T

is also a singular value decomposition.

4. (a) Derive Theorem 10.3.1 from Theorem 10.3.2.

(b) Given

A =

0BB@1 2

3 4

5 6

1CCA ;

Find the singular values �1 and �2 of A by computing the eigenvalues of ATA. Then

�nd the orthogonal matrix P such that

PTSP = diag(�1; �2; ��1; ��2; 0);

where S =

03�3 A

AT 02�2

!:

714

Page 336: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

5. Using the constructive proof of Theorem 10.2.1, �nd the SVD of the following matrices:

A =

0BB@1 2

3 4

5 6

1CCA ; A = (1 2 3 )

A =

0BB@1

1

1

1CCA ; A = diag(1; 0; 2; 0;�5);

A =

0BB@1 1

� 0

0 �

1CCA ; where � is small:

PROBLEMS ON SECTIONS 10.5, 10.6, and 10.7

6. (a) Find the rank, k k2; k kF , Cond(A), and the orthonormal bases for the null-space and

the range of each of the matrices in problem #5. Find the orthogonal projections onto

the range and the null-space of A and of their orthogonal complements.

(b) Prove that for an mxn matrix A

i. rank(ATA) = rank(AAT ) = rank(A) = rank(AT )

ii. ATA and AA

T have the same nonzero eigenvalues.

iii. If the eigenvectors u1 and u2 of ATA are orthogonal, then Au1 and Au2 are orthog-

onal.

7. (a) Let A be an invertible matrix. Then show that kAk2 = 1 if and only if A is a multiple

of an orthogonal matrix.

(b) Let U be an orthogonal matrix. Then prove that

kAUk2 = kAk2

and

kAUkF = kAkF

(c) Let A be an m� n matrix. Using the SVD of A, prove that

i. Cond2(ATA) = (Cond2(A))

2

ii. kATAk2 = kAk22

iii. Cond2(A) = Cond2(UTAV ),

where U and V are orthogonal.

715

Page 337: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

(d) Let rank(Am�n) = n, and let Bm�r be a matrix obtained by deleting (n � r) columns

from A, then prove that Cond2(B) � Cond2(A):

8. Prove that if A is an m� n matrix with rank r, and if B is another m� n matrix satisfying

kA�Bk2 < �r, then B has at least rank r.

9. (a) Give a proof of Theorem 10.6.3.

(b) Given

A =

0BB@1 2

3 4

5 6

1CCA ;

�nd a rank-one matrix B closest to A in 2-norm. What is kB �Ak2?

10. Let A and B be n�n real matrices. Let Q be an orthogonal matrix such that kA�BQkF �kA�BXkF for any orthogonal matrix X . Then prove that Q = UV

T , where BTA = U�V T .

11. Given

A =

0BB@1 2 3

2 3 4

5 6 7

1CCA ;

and using the result of problem #10, show that out of all the orthogonal matrices X , the

matrix

Q =

0BB@�:2310 �:3905 :8912

�:4824 :8414 :2436

:8449 :3736 :3827

1CCA

is such that kA � QkF � kA � XkF : Find kA � QkF by computing the singular values of

A�Q.

12. (a) Let A =

0BB@1 2

1 3

1 4

1CCA. Find the outer product expansion of A using the SVD of A.

(b) Compute (ATA)�1 using the SVD of A.

716

Page 338: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

PROBLEMS ON SECTION 10.8

13. Let

D =

0BBBBBBBBBBB@

�1 0.. .

�r

0. . .

0 0

1CCCCCCCCCCCA; �i > 0; i = 1; : : : ; r:

Then show that

Dy =

0BBBBBBBBBBB@

1�1

0

. ..

1�r

0. ..

0 0

1CCCCCCCCCCCA:

14. Verify that the matrix Ay = V�yUT where �y = diag(1

�j

) (with the convention that if �j = 0,

we use1

�j

= 0), is the pseudoinverse of A. (Check all four conditions for the de�nition of the

pseudoinverse.)

15. For any nonzero matrix A, show that

(a) AAyv = v for any vector v in R(A).

(b) Ayx = 0 for any x in N(AT).

(c) (AT )y = (Ay)T

(d) (Ay)y = A:

16. Let A be an m� n matrix. Show that

(a) If A has full column rank, then

Ay = (AT

A)�1AT

(b) If A has full row rank, then

Ay = A

T (AAT )�1:

17. >From the SVD of A, compute the singular value decompositions of the projection matrices:

P1 = AyA; P2 = I �A

yA; P3 = AA

y and P4 = I �AAy. Also verify that each of these is a

projection matrix.

717

Page 339: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

18. Let

A =

0BB@1 2

2 4

3 6

1CCA ; b =

0BB@3

6

9

1CCA :

Find the minimum 2-norm solution x to the least squares problem

minx

kAx� bk2:

What is kxk2?

Obtain x and kxk2 using both the SVD of A and the pseudoinverse of A.

19. Given u =

0BB@1

2

3

1CCA ; v =

0BB@1

1

1

1CCA ; �nd A

y where

A = uvT:

20. Let

A =

0BB@1 1 1 0

0 1 1 1

2 3 4 5

1CCA ; b =

0BB@

3

3

14

1CCA :

(a) Find a least squares solution x : minx

kAx� bk2. What is kxk2?

(b) Find the minimum-norm solution x, and kxk2.

PROBLEMS ON SECTION 10.9

21. Let B be an upper bidiagonal matrix having a multiple singular value. Then prove that B

must have a zero either on its diagonal or superdiagonal.

22. Consider the family of bidiagonal matrices

B(�) =

0BBBBBBBB@

1� � �(1 + �). ..

. . .

. . .. . .. . . �(1 + �)

1� �

1CCCCCCCCA;

� � 1: It can be shown (Demmel and Kahan 1990) that the smallest singular value of B(�)

is approximately �1�n(1� (2n� 1)�).

Taking � = 106; and using � = 0, verify the above result.

718

Page 340: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

23. Let

A =

0BB@1 :9999

2 1:9999

3 2:9999

1CCA

Find the SVD of A

(a) using the Golub-Kahan-Reinsch algorithm.

(b) using the Demmel-Kahan algorithm.

(c) Compare your results of (a) and (b).

24. Show that an approximate op-count for the Golub-Kahan-Reinsch and the Chan SVD are,

respectively, 2m2n+4mn2+

2

9n3 and 2m2

n+11n3 for an m�n matrix A. Compute also the

op-count for the Demmel-Kahan algorithm.

719

Page 341: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

MATLAB PROGRAMS AND PROBLEMS ON CHAPTER 10

You will need housqr, parpiv, reganl from MATCOM.

1. (The purpose of this exercise is to study the sensitivities (insensitivities) of the

singular values of a matrix).

Using MATLAB commands svd and norm, verify the inequalities in Theorems 10.5.1 and

10.5.2, respectively.

Test-Data

(i)

A =

0BBBBBB@

1 1 1 1

0 0:99 1 1

0 0 0:99 1

0 0 0 0:99

1CCCCCCA;

(ii) A = The Wilkinson Bidiagonal matrix of order 20.

In each case, construct a suitable E so that (A+E) di�ers from A in the (n; 1)th element

only by an � = 10�5.

(Note that the eigenvalues of both matrices are ill-conditioned).

2. Generate randomly a 15 � 5 matrix using MATLAB command: A = rand (15,5). Find

s = svd (A). Compute now jjAjj2; jjAjjF ; the condition number of A with respect to 2-

norm using the entries of s and then compare your results with those obtained by MATLAB

commands norm(a), norm(a, 'fro'), cond(a), respectively.

3. (a) Compute the orthonormal bases for the range and the null space of a matrix A as follows:

(i) Use [U; S; V ] = svd (A) from MATLAB.

(ii) Use housqr or housqrp from Chapter 5, as appropriate.

(iii) Use orth(A) and null(A) from MATLAB.

(b) Compare the results of (i) and (ii) and (iii) and op-count for each algorithm.

Test-Data:

720

Page 342: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

(i)

A =

0BBBBBB@

0 0 1 1

0 0 0 0

1 1 1 0

1 1 1 0

1CCCCCCA;

(ii) A = A randomly generated matrix of order 10.

4. Compute the rank of each of the following matrices using (i) MATLAB command rank (that

uses the singular values of A) and (ii) the program housqrp (Householder QR factorization

with pivoting) and parpiv from Chapter 5, compare the results.

Test-Data and the Experiment

(a) (Kahan Matrix)

A = diag (1; s; � � � ; sn�1)

0BBBBBBBBBB@

1 �c �c � � � �c0 1 �c � � � �c...

. . ....

.... . . �c

0 0 � � � 0 1

1CCCCCCCCCCA;

where, c2 + s2 = 1; c; s > 0; c = 0:2; s = 0:6; n = 100.

(b) A 15� 10 matrix A created as follows: A = xyT; where

x = round (10� rand (15,1))

y = round (10� rand (10,1)).

5. (a) Generate randomly a matrix A of order 6� 4 by using MATLAB command rand (6,4).

Now run the following MATLAB command:

[U; S; V ] = svd (A):

Set S(4; 4) = 0; compute B = U�S�V0. What is rank (B)?

(b) Construct a matrix C of rank 3 as follows:

C = qr (rand (3)):

Verify that jjC�Ajj2F � jjB�Ajj2F using MATLAB command norm for computing the

Frobenius norm.

(c) What is the distance of B from A?

721

Page 343: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

(d) Find a matrix D of rank 2 that is closest to A.

(This exercise is based on Theorems 10.6.2 and 10.6.3).

6. Let

A =

0BBBBBB@

1 1 1 1

0 :0001 1 1

0 0 0:0001 1

0 0 0 1

1CCCCCCA

Find the distance of A from the nearest singular matrix. Find a perturbation which will make

A singular. Compare the size of this perturbation with j�rj.

7. Let A = U�V T be the singular value decomposition (SVD) of a randomly generated 15� 10

matrix A = rand (15,10), obtained by using MATLAB command [U; S; V ] = svd(A):

Set S(8; 8) = S(9; 9) = S(10; 10) = 0 all equal to zero. Compute B = U � S � V 0.

Find the best approximation of the matrix B in the form

B �rX

i=1

xiyTi

such that jjB�Pr

i=1 xiyTi jj2 = minimum, where xi and yi are vectors, and r is the rank of B.

8. For matrices A and B in problem #7, �nd an unitary matrix Q such that jjA � BQjj isminimized.

(Hint: Q = V UT , where AT

B = U�V T ).

(Use MATLAB command svd to solve this problem).

9. (a) Write a MATLAB program, called covsvd to compute (ATA)�1 using the singular value

decomposition.

Use it to �nd (ATA)�1 for the 8 � 8 Hilbert matrix and compare your results and

op-count with those obtained by running reganl from MATCOM.

(b) Using covsvd �nd the Pseudoinverse of A and compare your result with that obtained

by running MATLAB command pinv.

(A is same as in part (a)).

10. Let A be a 10� 10 Hilbert matrix and b be a vector generated such that all entries of the

vector x of Ax = b are equal to 1.

Solve Ax = b using the SVD of A, and compare the accuracy, op-count and elapsed time

with those obtained by linsyspp from Chapter 6.

722

Page 344: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

11. Let A = rand (10,3), and

X = pinv(A):

Verify that X satis�es all the four conditions of the Pseudoinverse using MATLAB: AXA =

X; XAX = X; (AX)T = AX; (XA)T = XA.

12. Write a MATLAB program, called chansvd to implement the improved

SVD algorithm of Chan given in Section 10.9.3, using MATLAB commands qr and svd.

[U; S; V ] = chansvd(A):

Run your program with a randomly generated 30� 5 matrix A = rand (30,5) and compare

the op-count and elapsed time with those obtained by using svd(A).

13. Write a MATLAB program, called bidiag to bidiagonalize a matrix A (Section 10.9.2) :

[B] = bidiag(A; tol)

where B is a bidiagonal matrix and tol is the tolerance.

Test your program using A = rand(15,10).

14. (The purpose of this exercise is to compare the three related approaches for

�nding the small singular values of a bidiagonal matrix.) Write a MATLAB program

to implement the Demmel-Kahan algorithm for computing the singular values of a bidiagonal

matrix:

[s] = dksvd(A)

where s is the vector containing the singular values of A.

Experiment:

Set A = rand (15,10). Compute [U; S; V ] = svd(A). Set S(10; 10) = S(9; 9) = S(8; 8) = 10�5.

Compute B = U � S � V 0.

Run the program bidiag on B:

C = bidiag(B):

Compute now the singular values of C using (i) svd, (ii) dksvd, and (iii) chansvd and

compare the results with respect to accuracy (especially for the smallest singular values),

op-count and elapsed time.

723

Page 345: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

11.A TASTE OF ROUND-OFF ERROR ANALYSIS

11.1 Basic Laws of Floating Point Arithmetic : : : : : : : : : : : : : : : : : : : : : : : : : 724

11.2 Backward Error Analysis for Forward Elimination and Back Substitutions : : : : : : 724

11.3 Backward Error Analysis for Triangularization by Gaussian Elimination : : : : : : : 727

11.4 Backward Error Analysis for Solving Ax = b : : : : : : : : : : : : : : : : : : : : : : : 734

11.5 Review and Summary : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 736

11.6 Suggestions for Further Reading : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 737

Page 346: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

CHAPTER 11

A TASTE OF

ROUND-OFF ERROR ANALYSIS

Page 347: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

11. A TASTE OF ROUND-OFF ERROR ANALYSIS

Here we give the readers a taste of round-o� error analysis in matrix computations by giving back-

ward analysis of some basic computations such as solutions of triangular systems, LU factorization

using Gaussian elimination and solution of a linear system.

Let's recall that by backward error analysis we mean an analysis that shows that the computed

solution by the algorithm is an exact solution of a perturbed problem. When the perturbed problem

is close to the original problem, we say that the algorithm is backward stable.

11.1 Basic Laws of Floating Point Arithmetic

We �rst remind the readers of the basic laws of oating point arithmetic which will be used in the

sequel. These laws were obtained in Chapter 2. Let j�j < �; where � is the machine precision.

Then

1: (x� y) = (x� y)(1 + �) (11.1.1)

2: (xy) = xy(1 + �) (11.1.2)

3: If y 6= 0, then (x

y

) = (x

y

)(1 + �): (11.1.3)

Occasionally, we will also use

4: (x � y) =x � y

1 + �

; (11.1.4)

where `*' denotes any of the arithmetic operations +, �, �, /.

11.2 Backward Error Analysis for Forward Elimination and Back Substitutions

Case 1. Lower Triangular System

Consider solving the lower triangular system

Ly = b (11.2.1)

where

L = (lij); b = (b1; : : : ; bn)T; (11.2.2)

and

y = (y1; : : : ; yn)T;

using the forward elimination Scheme.

We will use s to denote a computed quantity of s.

724

Page 348: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Step 1.

y1 = (b1

l11

) =b1

l11(1 + �1);

where

j�1j � �

(using law 4).

This gives

l11(1 + �1)y1 = b1

that is,

l11y1 = b1;

where

l11 = l11(1 + �1):

This shows that y1 is the exact solution of an equation line whose coe�cient is a number close to

l11.

Step 2.

Similarly,

y2 =

�b2 � l21y1

l22

�=

�b2 � (l21y1)

l22

=(b2 � l21y1(1 + �11))(1 + �22)

l22(1 + �2)(11.2.3)

(using both (11.1.2), and (11.1.4)), (11.2.4)

where j�11j; j�21j and j�2j are all less than or equal to �. Equation (11.2.3) can be rewritten as

l21(1 + �11)(1 + �22)y1 + l22(1 + �2)y2 = b2(1 + �22)

That is,

l21(1 + �21)y1 + l22(1 + �22)y2 = b2;

where

�21 =�11

1 + �22

; �22 =

��2 � �22

1 + �22

(neglecting �11�22, which is small). Thus, we can say that y1 and y2 satisfy

l21y1 + l22y2 = b2 (11.2.5)

where l21 = l21(1 + �21)

and l22 = l22(1 + �22):

725

Page 349: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Step k.

The above can be easily generalized and we can say that at the kth step, the unknowns y1

through yk satisfy

lk1y1 + lk2y2 + � � �+ lkkyk = bk (11.2.6)

where lkj = lkj(1 + �kj); j = 1; : : : ; k. The process can be continued until k = n.

Thus, we see that the computed y1 through yn satisfy the following perturbed triangular system:

l11y1 = b1

l21y1 + l22y2 = b2

...

ln1y1 + ln2y2 + � � �+ lnnyn = bn

where lkj = lkj(1 + �kj); k = 1; : : : ; n; j = 1; : : : ; k. Note that �11 = �1.

These equations can be written in matrix form

Ly = (L+ �L)y = b (11.2.7)

where �L is a lower triangular matrix whose (i; j)th element (�L)ij = lij�ij .

Knowing the bounds for �ij , the bounds for �ij can be easily computed. For example, if n is

small enough so that n� <

1

100, then j�kjj � 1:06(k� j + 2)� (see Chapter 2, Section 2.3). Then

j(�L)ijj � 1:06(i� j + 2)�jlijj: (11.2.8)

The above can be summarized in the following theorem.

Theorem 11.2.1 The computed solution y to the n � n lower triangular system

Ly = b obtained by forward elimination, satis�es a perturbed triangular system:

(L+ �L)y = b;

where the entries of �L are bounded by (11.2.8) assuming that n� <

1

100.

Case 2. Upper Triangular System

The round-o� error analysis of solving an upper triangular system

Ux = c

using back substitution is similar to case 1. We can state

726

Page 350: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Theorem 11.2.2 Let U be an n � n upper triangular matrix and c be a vector.

Then the computed solution x to the system

Ux = c

using back substitution satis�es

(U + �U)x = c (11.2.9)

where

j(�U)ijj � 1:06(i� j + 2)�juijj; (11.2.10)

assuming n� <

1

100.

11.3 Backward Error Analysis for Triangularization by Gaussian Elimination

The treatment here follows very closely to the one given in Ortega (Numerical Analysis: A

Second Course), and in Forsythe, Malcom and Moler (CSLAS).

Recall that the process of triangularization using Gaussian elimination consists of (n�1) steps.

At step k, the matrix A(k) is constructed which is triangular in the �rst k columns; that is

A

(k) =

0BBBBBBBB@

a

(k)11 � � � � � � � a

(k)

ln

. . ....

a

(k)

kk � � � a

(k)

kn...

. . ....

a

(k)

nk � � � a(k)nn

1CCCCCCCCA: (11.3.1)

The �nal matrix A(n�1) is triangular. We shall assume that the quantities a

(k)ij are the computed

numbers.

First, let's analyze the computations of the entries of A(1) from A in the �rst step. Let the

computed multipliers be

mi1; i = 2; 3; : : : ; n:

Then

mi1 = (ai1

a11

) =ai1

a11

(1 + �i1);

where

j�i1j � �: (11.3.2)

727

Page 351: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Thus, the error e(0)i1 in setting a

(1)i1 to zero is given by

e

(0)i1 = a

(1)i1 � ai1 + mi1a11

= 0� ai1 + (ai1

a11

)(1 + �i1)a11

= �i1ai1 (11.3.3)

Let us now compute the errors in computing the other elements a(1)ij of A(1). The computed elements

a

(1)ij ; i; j = 2; : : : ; n are given by

a

(1)

ij = (aij � (mi1aij))

= (aij � (mi1a1j))(1 + �

(1)ij )

= [aij � m1ja1j(1 + �

(1)ij )](1 + �

(1)ij ); i; j = 2; : : : ; n;

where

j�(1)

ij j � �; j�(1)

ij j � �:

(11.3.3) can be rewritten as

a

(1)ij = (aij � mi1a1j) + e

(0)ij ; i; j = 2; : : : ; n: (11.3.4)

where

e

(0)

ij =�

(1)

ij a(1)

ij

1 + �

(1)ij

� mi1a1j�(1)

ij ; i; j = 2; : : : ; n: (11.3.5)

From (11.3.4) and (11.3.5), we have

A

(1) = A� L

(0)A+ E

(0); (11.3.6)

where

L

(0) =

0BBBBB@

0 0 � � � 0

m21 0 � � � 0...

. . .

mn1 0 � � � 0

1CCCCCA ; E

(0) =

0BBBBB@

0 0 � � � 0

e

(0)21 � � � e

(0)2n

.... . .

e

(0)n1 � � � e

(0)nn

1CCCCCA :

Analogously, at the end of step 2, we will have

A

(2) = A

(1) � L

(1)A

(1) + E

(1); (11.3.7)

where L(1) and E(1) are similarly de�ned.

728

Page 352: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Substituting (11.3.6) in (11.3.7), we have

A(2) = A

(1) � L(1)A

(1) +E(1)

= A� L(0)A +E

(0) � L(1)A

(1) +E(1)

(11.3.8)

Continuing in this way, we can write

A

(n�1) + L

(0)A+ L

(1)A

(1) + � � �+ L

(n�2)A

(n�2) = A+ E

(0)+ E

(1) + � � �+ E

(n�2)

Since

L

(k�1) =

0BBBBBBBB@

0 0 � � � 0

0... mk+1;k

......

......

0 mn;k � � � 0

1CCCCCCCCA;

we have

L(k)A

(k) = L(k)A

(n�1); k = 0; 1; 2; : : : ; n� 2: (11.3.9)

Thus from (11.3.8) and (11.3.9), we obtain

A(n�1) + L

(0)A(n�1) + L

(1)A

(n�1) + � � �+ L(n�2)

A(n�1) (11.3.10)

= A+ E(0)+ E

(1) + � � �+ E(n�2)

That is,

(I + L(0) + L

(1) + � � �+ L(n�2))A(n�1) (11.3.11)

= A+E

(0) + E

(1)+ � � �+E

(n�2) (11.3.12)

729

Page 353: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Noting now

I + L(0) + L

(1) + � � �+ L(n�2) =

0BBBBBBBB@

1 0 0 � � � 0

m21 1 0 � � � 0

m31 m32 1 � � � 0...

. . .. . .

. . .

mn1 mn2 � � � mn;n�1 1

1CCCCCCCCA= L (Computed L);

A(n�1) = U (computed U), and denoting E

(0) +E(1) + � � �+E

(n�2) by E, we have from (11.3.11):

A+ E = LU (11.3.13)

where the entries of the matrices E(0); : : : ; E

(n�2) are given by:

E(k�1) =

0BBBBBBBB@

0 0 0 � � � � � � 0

0 0 0 � � � � � � 0...

...... e

(k�1)

k+1;k � � � e

(k�1)

k+1;n

......

......

......

0 0 � � � e

(k�1)

n;k � � � e(k�1)n;n

1CCCCCCCCA; k = 1; 2; : : : ; n� 1; (11.3.14)

e

(k�1)

i;k = a

(k�1)

i;k �i;k; (11.3.15)

e

(k�1)ij =

(k)ij

1 + �

(k)ij

a

(k)ij � mika

(k�1)

kj �

(k)ij ; i; j = k + 1; : : : ; n; (11.3.16)

and

j�ikj � �; j�(k)ij j � �; (11.3.17)

and

j�(k)ij j � �: (11.3.18)

We formalize the above discussions in the following theorem:

730

Page 354: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Theorem 11.3.1 The computed upper and lower triangular matrices L and U

produced by Gaussian elimination satisfy

A +E = LU

where U = A(n) and L is lower triangular matrix of computed multipliers:

L =

0BBBBBBBB@

1 0 � � � � � � 0

m21 1 0 � � � 0...

. . .. . .

. . ....

.... . .

. . .. . .

...

mn1 mn2 � � � mn;n�1 1

1CCCCCCCCA

Example 11.3.1 Let t = 2.

A =

0BB@:21 :35 :11

:11 :81 :22

:33 :22 :39

1CCA

Step 1.

a

(1)22 = :81� :52� :35 = :63

m21 =:11

:21= :52 a

(1)23 = :22� :52� :11 = :16

m31 =:33

:21= 1:57 a

(1)32 = :22� 1:57� :35 = �:33

a

(1)33 = :39� 1:57� :11 = :22

A

(1) =

0BB@:21 :35 :11

0 :63 :16

0 �:33 :22

1CCA

e

(0)21 = 0� [:11� :52� :21] = �:0008

e

(0)22 = :63� [:81� :52� :35] = :0020

e

(0)23 = :10� [:22� :52� :11] = �:0020

e

(0)31 = 0� [:33� 1:57� :21] = �:0003

731

Page 355: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

e

(0)32 = �:33� [:22� 1:57� :35] = �:0005

e

(0)33 = :22� [:39� 1:57� :11] = :0027

E

(0) =

0BB@

0 0 0

�:0008 :0020 �:0028

�:0003 �:0005 :0027

1CCA

Step 2.

m32 = �:33

:63= �:52; a

(2)33 = :22 + :52� :16 = :30

A(2) =

0BB@:21 :35 :11

0 :63 :16

0 0 :30

1CCA = U :

e

(1)32 = 0� [�:33 + :52� :63] = :0024

e

(1)33 = :30� [:22 + :52� :16] = �:0032

E(1) =

0BB@0 0 0

0 0 0

0 :0024 �:0032

1CCA

Thus

E = E

(0) + E

(1) =

0BB@

0 0 0

�:0008 :0020 �:0028

�:003 :0019 �:0005

1CCA

Since

L =

0BB@

1 0 0

:52 1 0

1:57 �:52 1

1CCA

we can easily verify that LU = A+E.

Bounds for the elements of E

We now assess how large the entries of the error matrix E can be. For this purpose we assume

that pivoting has been used in Gaussian elimination so that jmikj � 1. Recall that the growth

factor � is de�ned by

� =maxi;j;k ja

(k)

ij j

maxi;j

jaijj:

732

Page 356: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Let a = maxi;j jaijj. Then from (11.3.14) and (11.3.15), we have

je(k�1)

ik j � a��; k = 1; 2; : : : ; n� 1; i = k + 1; : : : ; n

and, for i; j = k + 1; : : : ; n;

je(k)ij j �

1� �

ja(k)ij j+ �ja

(k�1)ij j �

2

1� �

a��: (since mik � 1)

Denote�

1� �

by �.

Then

jEj = jE(0)+ � � �+E(n�2)j

� jE(0)j+ � � �+ jE(n�2)j

� a��

2666666664

0BBBBBBBB@

0 � � � � 0

1 2 � � � 2

� � � � � �

� � � � � �

1 2 � � � 2

1CCCCCCCCA

+

0BBBBBBBBBBB@

0 � � � � � 0

0 � � � � � 0

0 1 2 � � � 2

� � � � � � �

� � � � � � �

0 1 2 � � � 2

1CCCCCCCCCCCA

+ � � �+

0BBBBBBBB@

0 0 � � � � 0

0 0 � � � � 0...

0 0 � � � � 0

0 0 � � � 1 2

1CCCCCCCCA

3777777775

� a��

0BBBBBBBB@

0 0 � � � � 0

1 2 2 � � � 2

1 3 4 � � � 4...

1 3 5 � � � 2n� 2

1CCCCCCCCA

(11.3.19)

Remark: The inequalities (11.3.18) hold element-wise. We can immediately obtain a bound in

terms of norms. Thus,

kEk1

� a��(1+ 3 + � � �+ (2n� 1))

= a�n2�: (11.3.20)

733

Page 357: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

11.4 Backward Error Analysis for Solving Ax = b

We are now ready to give a backward round-o� error analysis for solving Ax = b using triangular-

ization by Gaussian elimination, followed by forward elimination and back substitution.

First, from Theorem 11.3.1, we know that triangularization of A using Gaussian elimination

yields L and U such that A +E = LU .

These L and U will then be used to solve:

Ly = b

Ux = y:

From Theorem 11.2.1 and Theorem 11.2.2, we know that computed solution y and x of the

above two triangular systems satisfy:

(L+ �L)y = b;

and

(U + �U)x = y:

From these equations, we have

(U +�U)x = (L+�L)�1b

or

(L+�L)(U +�U)x = b

or

(A+ F )x = b (11.4.1)

where

F = E + (�L)U + L(�U) + (�L)(�U); (11.4.2)

(Note that A+ E = LU).

Bounds for F

From (11.4.2) we have

kFk1� kEk

1+ k�Lk

1kUk

1+ kLk

1k�Uk

1+ k�Lk

1k�Uk

1:

We now obtain expressions for k�Lk1; k�Uk

1; kLk

1and kUk

1. Since,

L =

0BBBBB@

1

m21

. . . 0...

. . .

mn1 � � � mn;n�1 1

1CCCCCA ;

734

Page 358: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

from (11.2.8), we obtain

j�Lj � 1:06�

0BBBBB@

2

3jm21j 2...

. . .

(n+ 1)jm21j � � � 3jmn;n�1j 2

1CCCCCA (11.4.3)

Assuming partial pivoting, i.e., jmikj � 1; k = 1; 2; : : : ; n� 1; i = k + 1; : : : ; n, we have

kLk1

� n (11.4.4)

k�Lk1

�n(n+ 1)

2(1:06�) (11.4.5)

Similarly,

kUk1� na�; (11.4.6)

(note that U = A(n�1))

and

k�Uk1�

n(n + 1)

21:06a��: (11.4.7)

(note that max juijj � a�).

Also recall that

kEk1� n

2a�

�� 1: (11.4.8)

Assume that n2�� 1 (which is a very reasonable assumption in practice), then

k�Lk1� k�Uk

1� n

2�a� (11.4.9)

Using (11.4.4){(11.4.8) in (11.4.2), we have

kFk1

� kEk1+ k�Lk

1kUk

1+ kLk

1k�Uk

1

+ k�Lk1k�Uk

1

� n

2a�

�� 1+ 1:06n2(n+ 1)a��+ n

2�a� (11.4.10)

Since�

�� 1� l and a � kAk

1, from (11.4.10) we can write

kFk1� 1:06(n3 + 3n2)�kAk

1�: (11.4.11)

The above discussion leads to the following theorem.

735

Page 359: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Theorem 11.4.1 The computed solution x to the linear system

Ax = b

using Gaussian elimination with partial pivoting satis�es a perturbed system

(A+ F )x = b

where F is de�ned by (11.4.2) and kFk1� 1:06(n3 + 3n2)�kAk

1�.

Remarks:

1. The above bound for F is grossly overestimated. In practice, this bound for F is very rarely

attained.

Wilkinson (AEP, pp ) states that in practice kFk1is always less than or equal to

n�kAk1.

2. Making use of (11.2.8), (11.2.10), and (11.3.17), we can also obtain an element-wise bound

for F . (Exercise)

11.5 Review and Summary

In this chapter, we have presented backward error analyses for:

1. Lower and upper triangular systems using forward elimination and back substitution (Theo-

rems 11.2.1 and 11.2.2).

2. LU factorization using Gaussian elimination with partial pivoting and (Theorem 11.3.1).

3. Linear systems problem Ax = b using Gaussian elimination with partial pivoting followed by

forward elimination and back substitution (Theorem 11.4.1).

Bounds for the error matrix E in each case has been derived (11.2.8, 11.2.10, 11.3.19, 11.4.11).

We have merely attempted here to give the readers a taste of round-o� error analysis, as the

title of the chapter suggests.

The results of this chapter are already known to the readers. They have been stated earlier in

the book without proofs. We have tried to give formal proofs here.

736

Page 360: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

To repeat, these results say that the forward elimination and back substitution methods for

triangular systems are backward stable, whereas, the stability of the Gaussian elimination process

for LU factorization and therefore, for the linear system problem Ax = b using the process, depend

upon the size of the growth factor.

11.6 Suggestions for Further Reading

The most authoritative book for learning details of backward error analyses of algorithms for matrix

computations is the Wilkinson's Algebraic Eigenvalue Problem (AEP).

Wilkinson's other book in this area, Rounding Errors in Algebraic Process, is also a

good source of knowledge.

The books A Second Course in Numerical Analysis, by James Ortega, and Computer

Solutions of Linear Algebraic Systems, by Forsythe and Moler, have also given in-depth

treatment of the material of this chapter.

737

Page 361: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Exercises on Chapter 11

1. Using � = 10, and t = 2; compute the LU decomposition using Gaussian elimination (without

pivoting) for the following matrices, and �nd the error matrix E in each case such that

A +E = LU:

(a) A =

3 4

5 6

!;

(b)

:25 :79

:01 :12

!;

(c)

10 9

8 5

!;

(d)

4 1

1 2

!;

(e)

:01 :05

:03 :01

!:

2. Suppose now that partial pivoting has been used in computing the LU factorization of each of

the above matrices of problem #1. Find again the error matrix E in each case, and compare

the bounds of the entries in E predicted by (11.3.12) with the actual errors.

3. Consider the problems of solving linear systems:

Ax = b

using Gaussian elimination with partial pivoting with each of the matrices from problem #1

and taking b =

1

1

!in each case. Find F in each case such that the computed solution x

satis�es

(A+ F )x = b:

Compare the bounds predicated by (11.4.11) with actual errors.

4. Making use of (11.2.8), (11.2.10), and (11.3.13{(11.3.17), �nd an element-wise bound for F

in Theorem 11.4.1.

(A+ F )x = b:

5. From Theorems 11.2.1 and 11.2.2, show that the process of forward elimination and back

substitution for lower and upper triangular systems, respectively, are backward stable.

6. From (11.3.18), conclude that the backward stability of Gaussian elimination is essentially

determined by the size of the growth factor �.

738

Page 362: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

7. Consider the problem of evaluating the polynomial

p(�) = an�n + an�1�

n�1 + � � �+ a0

by synthetic division:

pn = an

pi�1 = (�pi + ai�1); i = n; n� 1; : : : ; 1:

Then p0 = p(�): Show that

p0 = an(1 + �n)�n + an�1(1 + �n+1)�

n�1 + � � �+ a0(1 + �0):

Find a bound for each �i; i = 0; 1; : : : ; n: What can you say about the backward stability of

the algorithm from your bounds?

739

Page 363: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

A. A BRIEF INTRODUCTION TO MATLAB

A.1 Some Basic Information on MATLAB : : : : : : : : : : : : : : : : : : : : : : 740

A.1.1 What is MATLAB ? : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 740

A.1.2 Entering and Exiting MATLAB : : : : : : : : : : : : : : : : : : : : : : 740

A.1.3 Two most important commands: HELP and DEMO : : : : : : : : : 740

A.1.4 Most frequently used MATLAB operations and functions : : : : : 741

A.1.5 Numerical Examples : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 743

A.2 Writing Your Own Programs Using MATLAB Commands : : : : : : : : : 746

A.2.1 Some Relational Operators in MATLAB : : : : : : : : : : : : : : : : 746

A.2.2 Some Matrix Building Functions : : : : : : : : : : : : : : : : : : : : : 747

A.2.3 Colon Notation : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 747

A.2.4 for, while, if commands : : : : : : : : : : : : : : : : : : : : : : : : : : : 748

A.2.5 Computing Flop-Count and Elapsed Time of An Algorithm. : : : : 748

A.2.6 Saving a MATLAB Program : : : : : : : : : : : : : : : : : : : : : : : : 748

A.2.7 Getting a Hard Copy : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 748

A.2.8 Examples of Some Simple MATLAB Programs : : : : : : : : : : : : 749

A.2.9 Use of `diary' Command and Printing The Output : : : : : : : : : : 750

Page 364: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

APPENDIX A

A BRIEF INTRODUCTION TO MATLAB

Page 365: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

A. A BRIEF INTRODUCTION TO MATLAB

A.1 Some Basic Information on MATLAB

A.1.1 What is MATLAB ?

MATLAB stands for MATrix LABoratory. It is an interactive software package for solving problems

arising in scienti�c and engineering computations. MATLAB contains programs for all fundmental

matrix computations such as solutions of linear systems, various matrix factorizations, solutions

of least squares problems , eigenvalues and eigenvector computations, singular values and singular

vectors computations, etc. It was developed by Cleve Moler. The most current version contains

programs for many other types of computations including 2-D and 3-D graphic capabilitiies.

A.1.2 Entering and Exiting MATLAB

On most systems the command matlab will let you enter into MATLAB. Give the command exit

to quit MATLAB, when you are all done.

A.1.3 Two most important commands: HELP and DEMO

The two most important commands are help and demo. Typing 'help' you will get the listing of

all the matlab functions and other matlab capabilities. Typing 'help' followed by a matlab function

name from the list will give you more speci�c information about that particular function.

Example A.1.1

>> help norm

NORM Matrix or vector norm.

For matrices..

NORM(X) is the largest singular value of X, max(svd(X)).

NORM(X,2) is the same as NORM(X).

NORM(X,1) is the 1-norm of X, the largest column sum,

= max(sum(abs((X)))).

NORM(X,inf) is the infinity norm of X, the largest row sum,

= max(sum(abs((X')))).

NORM(X,'inf') is same as NORM(X,inf).

NORM(X,'fro') is the F-norm, sqrt(sum(diag(X'*X))).

Page 366: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

NORM(X,P) is available for matrix X only if P is 1, 2, inf or 'fro'.

For vectors..

NORM(V,P) = sum(abs(V)^P)^(1/P).

NORM(V) = norm(V,2).

NORM(V,inf) = max(abs(V)).

NORM(V,-inf) = min(abs(V)).

In MATLAB 4.0, if X has complex components, z, then

abs(z) = sqrt(z*conj(z)), not abs(real(z)) + abs(imag(z)),

which was used in some earlier versions of MATLAB.

See also COND, RCOND, CONDEST, NORMEST.

Demo teaches you how to use the matlab functions such as how to enter matrix values into a

matrix, how to �nd its transpose, how to �nd the rank of a matrix, etc.

A.1.4 Most frequently used MATLAB operations and functions

Some Basic Matrix Operations

+ Plus

- Minus

* Matrix multiplication

.* Array multiplication

^ power

\ Backslash or left division

/ Slash or right division

& Logical AND

| Logical OR

~ Logical NOT

Matrix functions - Numerical linear algebra.

Matrix analysis.

cond - Matrix condition number.

norm - Matrix or vector norm.

741

Page 367: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

rcond - LINPACK reciprocal condition estimator.

rank - Number of linearly independent rows or columns.

det - Determinant.

trace - Sum of diagonal elements.

null - Null space.

orth - Orthogonalization.

rref - Reduced row echelon form.

Linear equations.

\ and / - Linear equation solution; use "help slash".

chol - Cholesky factorization.

lu - Factors from Gaussian elimination.

inv - Matrix inverse.

qr - Orthogonal-triangular decomposition.

qrdelete - Delete a column from the QR factorization.

qrinsert - Insert a column in the QR factorization.

pinv - Pseudoinverse.

lscov - Least squares in the presence of known covariance.

Eigenvalues and singular values.

eig - Eigenvalues and eigenvectors.

poly - Characteristic polynomial.

hess - Hessenberg form.

svd - Singular value decomposition.

qz - Generalized eigenvalues.

rsf2csf - Real block diagonal form to complex diagonal form.

cdf2rdf - Complex diagonal form to real block diagonal form.

schur - Schur decomposition.

balance - Diagonal scaling to improve eigenvalue accuracy.

Using help you can get information on any of the above routines. Here is an exapmle.

Example A.1.2

>> help lu

742

Page 368: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

LU Factors from Gaussian elimination.

[L,U] = LU(X) stores a upper triangular matrix in U and a

"psychologically lower triangular matrix", i.e. a product

of lower triangular and permutation matrices, in L , so

that X = L*U.

[L,U,P] = LU(X) returns lower triangular matrix L, upper

triangular matrix U, and permutation matrix P so that

P*X = L*U.

By itself, LU(X) returns the output from LINPACK'S ZGEFA routine.

A.1.5 Numerical Examples

To enter a matrix and a vector in MATLAB

>> A=[1 3 5; 2 4 6; 1 3 9]

A =

1 3 5

2 4 6

1 3 9

>> b=[1 1 1]'

b =

1

1

1

To solve the Linear system Ax = b

>> x=A\b

x =

743

Page 369: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

-0.5000

0.5000

0

To compute the inverse of A

>> inv(A)

ans =

-2.2500 1.5000 0.2500

1.5000 -0.5000 -0.5000

-0.2500 0 0.2500

To compute the eigenvalues of A

>> eig(A)

ans =

-0.3246

12.3246

2.0000

To reduce A to an upper hessenberg matrix

>> hess(A)

ans =

1.0000 -4.9193 3.1305

-2.2361 8.6000 -6.2000

0 -3.2000 4.4000

To �nd the rank of A

744

Page 370: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

>> rank(A)

ans =

3

To compute the 2-norm of A

>> norm(A)

ans =

13.3538

To compute the condition number of A (with respect to 2-norm)

>>cond(A)

ans =

42.1539

To compute the QR factorization of A using Householder matrices.

>> [q,r] = qr(A) will give the qr factorization of A

q =

-0.4082 0.5774 -0.7071

-0.8165 -0.5774 -0.0000

-0.4082 0.5774 0.7071

r =

-2.4495 -5.7155 -10.6145

0 1.1547 4.6188

0 0 2.8284

745

Page 371: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

To compute the lu factorization of A using partial pivoting.

>> [l,u] = lu(A)

l =

0.5000 1.0000 0

1.0000 0 0

0.5000 1.0000 1.0000

u =

2 4 6

0 1 2

0 0 4

A.2 Writing Your Own Programs Using MATLAB Commands

It is easy to write your own programs using MATLAB commands. We list �rst some most common

uses and then give examples.

We urge students to get hold of a copy of Matlab Primer written by Professor

Kermit Sigmon of University of Florida. This is available via anonymous ftp from

Address: math.u .edu

Deirectory: pub/matlab

Files: primer.tex, primer.ps

or

Send e-mail to [email protected] containing the single line send

matlab/primer.tex

A.2.1 Some Relational Operators in MATLAB

< less than

> greater than

<= less than or equal to

746

Page 372: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

>= greater than or equal to

== equal

A.2.2 Some Matrix Building Functions

eye identity matrix

zeros matrix of zeros

rand randomly generated matrix with entries

between zero and one.

max max entry

diag create or extract a diagonal

triu upper triangular part of a matrix.

tril lower triangular trianluar part of a matrix

hilb Hilbert matrix

toeplitz Toeplitz matrix

size gives the dimension of a matrix

abs absolute value of the elements of ammatrix or a vector.

Examples

1. rand(5,3) will create a 5 x 3 randomly generated matrix

2. If x is a vector diag(x) is the diagonal matrix with entries of x on the diagonal. diag(A) is

the vector consisting ot the diagonal of A

3. hilb(5) will create the 5 x 5 Hilbert matrix.

4. max(A(:,2)) will give the maximum value of the second column of A. max(max(A)) will give

the maximum entry of the whole matrix A.

A.2.3 Colon Notation

The 'colon' notation (:) is used to conveniently indicate a whole row or column

Examples

A(:,2) denotes the entire 2nd column of A.

A(1:3,:) denotes the �rst 3 rows of A.

A(:,[2,5,7]) denotes the second, �fth and seventh columns of A

The statement A(:,[2,5,7]) = B(:,1:3) will replace the columns 2,5,7 of A with the �rst three

columns of B

747

Page 373: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

A.2.4 for, while, if commands

These commands are most useful in writing MATLAB programs for matrix algorithms.

The uses of these commands will be illustrated in the following examples.

A.2.5 Computing Flop-Count and Elapsed Time of An Algorithm.

To compute the op count of an algorithm set ops(0) immediately before executing the algorithm

and type ops immediately after completion.

Example

flops(0) \\

x = a\b

flops

will give the total ops to solve a linear system with a given matrix a and a vector b.

The function cputime returns the CPU time in seconds that has been used by the MATLAB

process since the MATLAB process started.

For example :

t = cputime; your operation; cputime� t

returns the cputime to run your operation. Since the PC version of MATLAB does not have a

cputime function, MATCOM contains a program cputime.m. If the version of matlab that you use

contains the cputime function then you can delete the cputime.m program from MATCOM.

A.2.6 Saving a MATLAB Program

The command save < filename > will store all variables in the �lename '�lename.mat'.

The command load < filename > will restore all the variables from the �le named '�le-

name.mat'.

A.2.7 Getting a Hard Copy

diary< filename > will cause a copy of all subsequent terminal input and most of the resulting

output to be writen on the named �le.

diary o� suspends it.

748

Page 374: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

A.2.8 Examples of Some Simple MATLAB Programs

Example A.2.1

The following code will make the elements below the diagonal of the 4 x 4 matrix A = a(i,j) zero.

a = rand(4,4)

for i = 1:4

for j = 1:4

if i > j

a(i,j) = 0

end;

end;

end;

Example A.2.2

The following code will create a matrix A such that the (i; j)-th entry of the matrix A = a(i; j) is

(i+ j).

a= zeros(4,4)

for i = 1:4

for j = 1:4

a(i,j) = i+j

end;

end;

Example A.2.3

The following MATLAB program computes the matrix-matrix product of two upper triangular

matrices. This program will be called matmat.m

% Matrix-Matrix product with upper triangular matrices

% input U and V two upper triangular matrices of order n

% output C = U * V

% function C = matmat(U,V)

749

Page 375: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

function C = matmat(U,V)

[n,m] = size(U)

C = zeros(n,n)

for i = 1:n

for j = i:n

for k = i:j

C(i,j) = C(i,j) + U(i,k) * V(k,j)

end;

end;

end;

end;

Example A.2.4 (Matlab Implementation of Algorithm 3.1.1)

% Computing the two norm of a vector x

% input x

% output nrm, the two norm of the vector x

% function nrm = twonorm(x)

function nrm = twonorm(x)

[n,m] = size(x)

r = max(abs(x))

y=x/r

s = 0

for i=1:n

s = s + y(i)^2

end;

nrm = r * s^0.5

end;

A.2.9 Use of `diary' Command and Printing The Output

.

Sometimes you may want a listing of your matlab program step by step as it was executed. The

750

Page 376: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

diary command can be used to create a listing.

Example:

>>diary B:diary8 <----- sets the diary on

>> C = matmat(U,V) <----- execute your program

>> diary off <----- set the diary off

The above command will store all the commands that are executed by the program matmat.m

in the �le diary8. Only that data which is printed on the screen is stored in diary8. This �le can

then be printed. In case you do not want the output to be printed on the screen place a semi

colon at the end of the line.

To write a comment-line put the % sign in the �rst column. Examples of some M �les are given

in appendix B.

751

Page 377: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

B. MATLAB AND SELECTED MATLAB PROGRAMS

B.1 MATCOM and Some Selected Programs From MATCOM : : : : : : : : : 752

B.1.1 What is MATCOM ? : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 752

B.2 How To Use MATCOM ? : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 752

B.3 Chapter-wise Listing Of MATCOM Programs : : : : : : : : : : : : : : : : : 755

B.4 Some Selected MATCOM Programs : : : : : : : : : : : : : : : : : : : : : : : 759

Page 378: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

APPENDIX B

MATCOM AND SELECTED MATLAB PROGRAMS FROM

MATCOM

Page 379: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

B. MATLAB AND SELECTED MATLAB PROGRAMS

B.1 MATCOM and Some Selected Programs From MATCOM

B.1.1 What is MATCOM ?

MATCOM is a MATLAB based interactive software package containing the implementation of all

the major algorithms of chapter 3 through chapter 8 of the book ' Numerical Linear Algebra

and Applications ' by Prof. Biswa Nath Datta.

For each problem considered in this book, there are more than one (in some cases several)

algorithms.

By using the programs in MATCOM the students will be able to compare di�erent alogrithms

for the same problem with respect to accuracy , op-count, and elapsed time , etc. The students will

be able to verify the statements about goodness and badness of di�erent algorithms. In particular,

they will be able to distinguish between a good and a bad algorithm. MATCOM has been written

by Conrad Fernandes, a graduate student of Professor Datta.

B.2 How To Use MATCOM ?

.

In section B3 you have a chapter wise listing of the programs in MATCOM

Example

create a householder matrix housmat.m 5.3.1

/ \

/ \

The program name is / \ is the algorithm

or the section number

To use this program in matlab, you need to know the input and output variables. To �nd out

these variables type

>> help housmat

create a householder matrix 5.3.1 housmat.m

H = I - 2 *u*u'/(u'*u)

input vector x

output [ u,H]

Page 380: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

function [u,H] = housmat(x)

The input is a vector x and the output are a matrix H and a vector u.

To execute the program you have to do the following

1. create the input vector x

2. then type

[u,H] = housmat(x)

As output you will get the Householder matrix H such that Hx is a multiple of e1 and the

vector u out of which the Householder matrix H has been formed.

>> x = rand(4,1)

x =

0.2190

0.0470

0.6789

0.6793

>> [u,H] = housmat(x)

u =

1.7740

0.0693

0.9994

1.0000

H =

-0.2220 -0.0477 -0.6884 -0.6888

-0.0477 0.9981 -0.0269 -0.0269

753

Page 381: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

-0.6884 -0.0269 0.6122 -0.3880

-0.6888 -0.0269 -0.3880 0.6117

754

Page 382: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

B.3 Chapter-wise Listing Of MATCOM Programs

CHAPTER 3

Title Program Name Number

Back substitution backsub.m 3.1.3

The Inverse of an Upper Triangular Matrix invuptr.m 3.1.4

Basic Gaussian Elimination gauss.m 3.1.5

CHAPTER 4

Title Program Name Number

Computing (I � 2(u � uT )=(uT � u)) �A housmul.m 4.2.1

Computing A � (I � 2(u � uT )=(uT � u)) houspostmul.m 4.2.1 (sec. num.)

CHAPTER 5

Title Program Name Number

Triangularization Using Gaussian elimination lugsel.m 5.2.2

Without Pivoting

Triangularization Using Gaussian Elimination parpiv.m 5.2.3

With Partial Pivoting

Triagularization Using Gaussian elimination

With Complete Pivoting compiv.m 5.2.4

Creating Zeros in a Vector With a Householder

Matrix housmat.m 5.4.1

Householder QR Factorization housqr.m 5.4.2

Householder QR Factorization for a

Nonsquare Matrix housqrnon.m 5.4.2

Householder Hessenberg Reduction houshess.m 5.4.3

Creating Zeros in a Vector

Using Givens Rotations givcs.m and givrot.m 5.5.1 (sec. num.)

Creating Zeros in a Speci�ed Position

of a Matrix Using Givens Rotations givrota.m 5.5.1

QR factorization Using Givens Rotations givqr.m 5.5.2

Givens Hessenberg Reduction givhs.m 5.5.3

755

Page 383: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

CHAPTER 6

Forward Elimination forelm.m 6.4.1

Solving Ax = b with Partial Pivoting gausswf 6.4.3

without Explicit Factorization

Cholesky Algorithm choles.m 6.4.4

Sherman Morrison Formula shermor.m 6.5.2 (sec. num.)

Inverse by LU Factorization inlu.m 6.5.3 (sec. num.)

without Pivoting

Inverse by Partial Pivoting inparpiv.m 6.5.3 (sec. num.)

Inverse by Complete Pivoting incompiv.m 6.5.3 (sec. num.)

Hager's norm-1 condition number estimator hagnormin1.m 6.7.1

Iterative Re�nement iterref.m 6.9.1

The Jacobi Method jacobi.m 6.10.1

The Gauss-Seidel Method gaused.m 6.10.2

The Succesvie Overrelaxation Method sucov.m 6.10.3

The Basic Conjugate Gradient Algorithm congrd.m 6.10.4

Incomplete Cholesky Factorization icholes.m 6.10.6

No-Fill Incomplete LDLT nichol.m 6.10.7

756

Page 384: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

CHAPTER 7

Title Program Name Number

Least Squares Solution Using Normal Equations lsfrnme.m 7.8.1

The Householder-Golub Method For the Full-Rank lsfrqrh.m 7.8.2

Least Squares Problem

Classical Gram-Schmidt for QR factorization clgrsch.m 7.8.3

Modi�ed Gram-Schmidt for QR factorization mdgrsch.m 7.8.4

Least Squares Solution by MGS lsfrmgs.m 7.8.5

Least Squares Solution for the

Rank-De�cient Problem Using QR lsrdqrh.m 7.8.6

Minimum Norm Solution for the

Full-Rank Underdetermined Problem Using lsudnme.m 7.9.1

Normal Equations

Minimum Norm solution for the Full-Rank

Underdetermined Problem Using QR lsudqrh.m 7.9.2

Linear Systems Analog Least Squares

Iterative Re�nement lsitrn1.m 7.10.1

Iterative Re�nement for Least Squares Solution lsitrn2.m 7 .10.2

Computing the Variance-Covariance Matrix reganal.m 7.11.1

CHAPTER 8

Title Program Name Number

Power Method power.m 8.5.1

Inverse Iteration invitr.m 8.5.2

Rayleigh-Quotient Iteration rayqot.m 8.5.3

Sensitivities of Eigenvalues senseig.m 8.7.2 (sec. num.)

The Basic QR Iteration qritrb 8.9.1 (sec. num.)

The Hessenberg QR Iteration qritrh.m 8.9.2 (sec. num.)

The Explicit Single Shift QR

Iteration qritrsse.m 8.9.4 (sec. num.)

The Explicit Double Shift QR Iteration qritrdse 8.9.5 (sec. num.)

One Iteration-Step of the Implicit Double Shift QR qritrdsi.m 8.9.1 (section 8.9.6)

NO CHAPTER

757

Page 385: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

Title Program Name Number

The Absolute Maximum of a Vector absmax.m

Interchange Two Vectors inter.m

Computing the CPU Time cputime.m

758

Page 386: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

B.4 Some Selected MATCOM Programs

% Back substitution 3.1.3 backsub.m

% input upper triangular T and vector b

% output [ y] the solution to Ty = b by back subst

% function [y] = backsub(T,b);

function [y] = backsub(T,b);

% !rm diary8

% diary diary8

[m,n] = size(T);

if m~=n

disp('matrix T is not square')

return

end;

y = zeros(n,1)

for i = n:-1:1

sum = 0

for j = i+1:n

sum = sum + T(i,j)*y(j)

end;

y(i) = (b(i) - sum ) / T(i,i)

end;

end;

% inverse of an upper triangular matrix 3.1.4 invuptr.m

% the matrix T is overwritten by its inverse

% function [T] = invuptr(T);

function [T] = invuptr(T);

% !rm diary8

% diary diary8

[m,n] = size(T);

if m~=n

disp('matrix T is not square')

return

end;

759

Page 387: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

s = eye(n,n)

for k = n:-1:1

T(k,k) = 1/T(k,k)

for i = k-1 :-1 :1

sum = 0

for j = i+1:k

sum = sum + T(i,j)*T(j,k)

end;

T(i,k) = -sum/T(i,i)

end;

end;

end;

% pre multiply a matrix by a Housholder matrix housmul.m 4.2.1

% compute [I - 2uu'/u'*u]*A

% input A and vector u

% output [A]

% function [A] = housmul(A,u)

function [A] = housmul(A,u)

% !rm diary8

% diary diary8

[m1,n] = size(A);

beta = 2/(u'*u)

for j = 1 : n

alpha = 0

for i = 1 : m1

alpha = alpha + u(i) * A(i,j)

end;

alpha = beta * alpha

for i = 1:m1

A(i,j) = A(i,j) - alpha * u(i)

end;

end;

760

Page 388: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

end;

% LU factorization using Gaussian Elimination Without Pivoting 5.2.2 lugsel.m

% input A

% output [l, u]

% function [l,u] = lugsel(A)

function [l,u] = lugsel(A)

% !rm diary8

% diary diary8

[m1,n] = size(A);

for k = 1 : n-1

for i = k+1:n

A(i,k) = A(i,k)/ A(k,k)

end;

for i = k+1:n

for j = k+1 :n

A(i,j) = A(i,j) - A(i,k) * A(k,j)

end;

end;

end;

u = triu(A)

l = tril(A,-1)

for i = 1:n

l(i,i) = 1

end;

end;

% Creating Zeros in a Specified Posn. of a

% matrix A using Givens Rotations 5.5.5 givrota.m

% this program calls the MATCOM program givcs.m

% input i j and matrix A

% output [A] , A = J * A

% function [A] = givrota(i,j,A)

761

Page 389: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

function [A] = givrota(i,j,A)

[m,n] = size(A)

% !rm diary89

% diary diary89

x = zeros(2,1)

x(1) = A(i,i)

x(2) = A(j,i)

[c,s] = givcs(x)

J = eye(n,n)

J(i,i) = c

J(i,j) = s

J(j,i) =-s

J(j,j) = c

A = J*A

end;

%Solving Ax = b with partial pivoting without Explicit Factorization

% gausswf.m 6.4.2

% input matrix A and vector b

% output [A, b] matrix A is overwritten with the upper triangular

% part A^(n-1) and the multipliers are stored in the lower

% triangular part of A. The vector b is overwritten by b^(n-1).

% function [A,b] = gausswf(A,b)

function [A,b] = gausswf(A,b)

% !rm diary8

% diary diary8

[m1,n] = size(A);

for k = 1 : n-1

for i = k+1:n

A(i,k) = A(i,k)/ A(k,k)

end;

762

Page 390: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

for i = k+1:n

b(i) = b(i) + A(i,k) * b(k)

for j = k+1 :n

A(i,j) = A(i,j) - A(i,k) * A(k,j)

end;

end;

end;

u = triu(A)

l = tril(A,-1)

for i = 1:n

l(i,i) = 1

end;

end;

% Jacobi method 6.10.1 jacobi.m

% input matrix A x b and numitr

% output [xold]

% function [xold] = jacobi(A,x,b,numitr);

function [xold] = jacobi(A,x,b,numitr);

% !rm diary8

% diary diary8

[m,n] = size(A);

if m~=n

disp('matrix a is not square')

return

end;

xold = x

Bsub = zeros(n,n)

for i = 1 : n

for j = 1 : n

if i ~= j

Bsub(i,j) = -A(i,j) / A(i,i)

end;

end;

763

Page 391: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

end;

bsub = zeros(n,1)

for i = 1 : n

bsub(i) = b(i) / A(i,i)

end;

for i = 1 : numitr

disp('the iteration number')

i

xnew = Bsub * xold + bsub

xold = xnew;

end

end;

% Householder-Golub method for the least squares problem 7.8.2 lsfrqrh.m

% input matrix A and vector b

% output [ x]

% function [x] = lsfsqrh(A,b);

function [x] = lsfrqrh(A,b);

% !rm diary8

% diary diary8

[m,n] = size(A);

y = zeros(n,1)

[q,r1] = qr(A)

c = q'*b

ran = rank(r1)

r = r1(1:ran,:)

[r,c,x] = backsub(r,c)

[m1,n] = size(A);

if m1~=n

disp('matrix A is not square')

764

Page 392: Numerical Linear Algebra Biswa Nath Datta PART II_Ch7-11

return

end;

[q,r] = qr(A)

for k = 1 : numitr

disp('the iteration number')

k

Anew = r*q

[q,r] = qr(Anew)

end;

xold = diag(Anew)

end;

765