Download notes

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Cartesian tensor wikipedia , lookup

Capelli's identity wikipedia , lookup

Linear algebra wikipedia , lookup

System of polynomial equations wikipedia , lookup

Factorization of polynomials over finite fields wikipedia , lookup

System of linear equations wikipedia , lookup

Quadratic form wikipedia , lookup

Four-vector wikipedia , lookup

Eigenvalues and eigenvectors wikipedia , lookup

Determinant wikipedia , lookup

Complexification (Lie group) wikipedia , lookup

Invariant convex cone wikipedia , lookup

Matrix (mathematics) wikipedia , lookup

Jordan normal form wikipedia , lookup

Non-negative matrix factorization wikipedia , lookup

Matrix calculus wikipedia , lookup

Cayley–Hamilton theorem wikipedia , lookup

Perron–Frobenius theorem wikipedia , lookup

Singular-value decomposition wikipedia , lookup

Matrix multiplication wikipedia , lookup

Transcript
CME 302: NUMERICAL LINEAR ALGEBRA
FALL 2005/06
LECTURE 8
GENE H. GOLUB
1. Positive Definite Matrices
A matrix A is positive definite if x> Ax > 0 for all nonzero x. A positive definite matrix has
real and positive eigenvalues, and its leading principal submatrices all have positive determinants.
From the definition, it is easy to see that all diagonal elements are positive.
To solve the system Ax = b where A is positive definite, we can compute the Cholesky decomposition A = F > F where F is upper triangular. This decomposition exists if and only if A is
symmetric and positive definite. In fact, attempting to compute the Cholesky decomposition of A
is an efficient method for checking whether A is symmetric positive definite.
It is important to distinguish the Cholesky decomposition from the square root factorization. A
square root of a matrix A is defined as a matrix S such that
S 2 = SS = A.
Note that the matrix F in A = F > F is not the square root of A, since it does not hold that F 2 = A
unless A is a diagonal matrix. The square root of a symmetric positive definite A can be computed
by using the fact that A has an eigendecomposition A = U ΛU > where Λ is a diagonal matrix whose
diagonal elements are the positive eigenvalues of A and U is an orthogonal matrix whose columns
are the eigenvectors of A. It follows that
A = U ΛU > = (U Λ1/2 U > )(U Λ1/2 U > ) = SS
and so S = U Λ1/2 U > is a square root of A.
2. The Cholesky Decomposition
The Cholesky decomposition can be computed directly from the matrix equation A = F > F .
Examining this equation on an element-by-element basis yields the equations
2
a11 = f11
,
a1j = f11 f1j ,
..
.
j = 2, . . . , n
2
2
2
akk = f1k
+ f2k
+ · · · + fkk
,
akj = f1k f1j + · · · + fkk fkj ,
j = k + 1, . . . , n
and the resulting algorithm that runs for k = 1, . . . , n:
P
2 1/2
fkk = akk − k−1
j=1 fjk
P
fkj = akj − k−1
fkk ,
`=1 f`k f`j
j = k + 1, . . . , n.
This algorithm requires roughly half as many operations as Gaussian elimination.
Date: October 26, 2005, version 1.0.
Notes originally due to James Lambers. Edited by Lek-Heng Lim.
1
So if A is symmetric positive definite, then we could compute the decomposition
A = F F >,
known as the Cholesky decompostion. In fact, there are several ways to write A = GG> for some
matrix G since
A = F F > = F QQ> F = (F Q)(F Q)> = GG>
for any orthogonal matrix Q, but for the Cholesky decomposition, we require that F is lower
triangular, with positive diagonal elements.
We can compute F by examining the matrix equation A = F F > on an element-by-element basis,
writing

 


f11 f21 · · · fn1
a11 · · · a1n
f11
.. 
 a21 · · · a2n   f21 f22

f22
. 

 

.
 ..

..  =  ..
..
.
.. 
.
.
 .

.
..
.   .
.
. 
an1 · · · ann
fn1 fn2 · · · fnn
fnn
2 = a , from which it follows that
From the above matrix multiplication we see that f11
11
√
f11 = a11 .
From the relationship f11 fi1 = ai1 and the fact that we already know f11 , we obtain
ai1
fi1 =
, i = 2, . . . , n.
f11
2 + f 2 = a . Since we already know f , we
Proceeding to the second column of F , we see that f21
22
21
22
have
p
2
.
f22 = a22 − f21
Next, we use the relation f21 fi1 + f22 fi2 = a2i to compute
a2i − f21 fi1
.
fi1 =
f22
In general, we can use the relationship aij = fi> fj to compute fij , where fi is the ith column of F .
Another method for computing the Cholesky decomposition is to compute
1
f1 = √ a1
a11
where ai is the ith column of A. Then we set A(1) = A and compute


0 0 ··· 0
0



(2)
(1)
>
A = A − f1 f1 =  ..
.
.

A2
0
Note that
A
(1)
1 0
=B
B>
0 A2
where B is the identity matrix with its first column replaced by f1 . Writing C = B −1 , we see that
A2 is positive definite since
1 0
= CAC >
0 A2
is positive definite. So we may repeat the process on A2 . h
i
(2)
(2)
We partition the matrix A2 into columns, writing A2 = a(2)
and then compute
a
·
·
·
a
n
2
3
0
1
f2 = p
(2) .
(2)
a22 a2
2
We then compute
A3 = A(2) − f2 f2>
and so on.
Note that
2
2
2
akk = fk1
+ fk2
+ · · · + fkk
,
which implies that
|fki | ≤ |akk |.
In other words, the elements of F are bounded. We also have the relationship
2 2
2
det A = det F det F > = (det F )2 = f11
f22 · · · fnn
.
Is the Cholesky decompositon unique? Employing a similar approach to the one used to prove
the uniquess of the LU decomposition, we assume that A has two Cholesky decompositions
A = F1 F1> = F2 F2> .
Then
F2−1 F1 = F2> F1−> ,
but since F1 and F2 are lower triangular, both matrices must be diagonal. Let
F2−1 F1 = D = F2> F1−> .
So F1 = F2 D and thus F1> = DF2> and we get D−1 = F2> F1−> . In other words, D−1 = D or
D2 = I. Hence D must have diagonal elements equal to ±1. Since we require that the diagonal
elements be positive, it follows that the decomposition is unique.
In computing the Cholesky decomposition, no row interchanges are necessary because A is positive definite, so the number of operations required to compute F is approximately n3 /3.
A variant of the Cholesky decomposition is known as the square-root-free Cholesky decomposition, and has the form
A = LDL>
where L is a unit lower triangular matrix, and D is a diagonal matrix with positive diagonal
elements. This is a special case of the A = LDM > factorization previously discussed. The LDL>
and Cholesky decompositions are related by
F = LD1/2 .
3. Banded Matrices
A banded matrix has all of its nonzero elements contained within a “band” consisting of select
diagonals. Specifically, a matrix A that has upper bandwidth p and lower bandwidth q has the form


a11
···
a1,p+1
..


.
a2,p+1 a2,p+2
 a21

 .


.
A =  ..



···
aq+1,n 
aq+1,1 · · · aq+1,q+1
..
..
..
.
.
.
Matrices of this form arise frequently from discretization of partial differential equations.
The simplest banded matrix is a tridiagonal matrix, which has upper bandwidth 1 and lower
bandwidth 1. Such a matrix can be stored using only three vectors instead of a two-dimensional
array. Computing the LU decomposition of a tridiagonal matrix without pivoting requires only
O(n) operations, and produces bidiagonal L and U . When pivoting is used, this desirable structure
is lost, and the process as a whole is more expensive in terms of computation time and storage
space.
3
Various applications, such as the solution of partial differential equations in two or more space
dimensions, yield symmetric block tridiagonal matrices, which have a block Cholesky decomposition:

 

 >
F1
F1 G >
A1 B2>
2

 

..
..

B2 . . . . . .
 G2 . . .

.
.


=

.


 


.. ..
..
..
..

>
>



.
.
.
.
. Bn
Gn 
G n Fn
Bn An
Fn>
From the above matrix equation, we determine that
A1 = F1 F1> ,
B2 = G2 F1>
from which it follows that we can compute the Cholesky decomposition of A1 to obtain F1 , and
>
then compute G2 = B2 (F1> )−1 . Next, we use the relationship A2 = G2 G>
2 + F2 F2 to obtain
−1
> −1 −1 >
F2 F2> = A2 − G2 G>
2 = A2 − B2 (F1 ) F1 B2 = A2 − B2 A1 B2 .
It is interesting to note that in the case of n = 2, the matrix A2 − B2 A−1
1 B2 . is known as the Schur
complement of A1 .
Continuing with the block tridiagonal case with n = 2, suppose that we wish to compute the
factorization
A B
0
F >
> + 0
=
.
F
G
G
0 X
B> 0
It is easy to see that X = −B > A−1 B, but this matrix is negative definite. Therefore, we cannot
compute a block Cholesky decomposition, but we can achieve the factorization
A B
F 0 F > G>
=
G K
B> 0
0 −K >
where K is the Cholesky factor of the positive definite matrix B > A−1 B.
4. Parallelism of Gaussian Elimination
Suppose that we wish to perform Gaussian elimination on the matrix A = a1 · · ·
the first step of the elimination, we compute
P (1) Π1 A = P (1) Π1 a1 · · · P (1) Π1 an .
an . During
Clearly we can work on each column independently, leading to a parallel algorithm. As the elimination proceeds, we obtain less benefit from parallelism since fewer columns are being modified at
each step.
5. Error Analysis of Gaussian Elimination
Suppose that we wish to solve the system Ax = b. Our computed solution x̃ satisfies a perturbed
system (A + ∆)x̃ = b. It can be shown that
kA−1 kk∆k
kx − x̃k
≤
kxk
1 − kA−1 kk∆k
≤
≤
kAkkA−1 k k∆k
kAk
1 − kAkkA−1 k k∆k
kAk
κ(A)r
1 − κ(A)r
where κ(A) = kAkkA−1 k is the condition number of A and r = k∆k/kAk.. The condition number
has the following properties:
• κ(αA) = κ(A) where α is a nonzero scalar.
4
• κ(I) = 1
• κ(Q) = 1 when Q> Q = I.
The perturbation matrix ∆ is typically a function of the algorithm used to solve Ax = b.
In this section, we will consider the case of Gaussian elimination and perform a detailed error
analysis, illustrating the analysis originally carried out by J.H. Wilkinson. The process of solving
Ax = b consists of three stages:
(1) Factoring A = LU , resulting in an approximate LU decomposition A + E = L̄Ū
(2) Solving Ly = b, or, numerically, computing y such that
(L̄ + δ L̄)(y + δy) = b
(3) Solving U x = y, or, numerically, computing x such that
(Ū + δ Ū )(x + δx) = y + δy.
Combining these stages, we see that
b = (L̄ + δ L̄)(Ū + δ Ū )(x + δx)
= (L̄Ū + δ L̄Ū + L̄δ Ū + δ L̄δ Ū )(x + δx)
= (A + E + δ L̄Ū + L̄δ Ū + δ L̄δ Ū )(x + δx)
= (A + ∆)(x + δx)
where ∆ = δ L̄Ū + L̄δ Ū + δ L̄δ Ū .
Department of Computer Science, Gates Building 2B, Room 280, Stanford, CA 94305-9025
E-mail address: [email protected]
5