You are on page 1of 1

Algorithm for Cholesky Decomposition

Input: an n n SPD matrix A


Output: the Cholesky factor, a lower triangular matrix L such that A = LLT
Theorem:(proof omitted) For a symmetric matrix A, the Cholesky algorithm will succeed with non-zero
diagonal entries in L if and only if A is SPD. If A is not SPD then the algorithm will either have a zero
entry in the diagonal of some Lk (making Lk singular) or will require complex numbers in step 0 or step
1.2.
Notation:
Lk1 : the k 1 k 1 upper left corner of L
ak : the first k 1 entries in column k of A
`k : the first k 1 entries in column k of LT
akk and `kk : the kk entries of A and L, respectively.

0) Initialize L1 = a11
1) For k = 2, . . . , n
1.1) Solve L qk1 `k = ak for `k (Lk1 is k 1 k 1: for k = 2 this is a 1 1 or scalar equation)
1.2) `kk = akk `Tk `k .

Lk1 0
1.3) Lk = .
`kT `kk
Cholesky Example

16 4 4 4 32
4 10 4 2
For A = and b = 26 construct a Cholesky decompostion and solve Ax = b
4 4 6 2 20
4 2 2 4 6
.
Solution:

k = 1: L1 = 16 = 4

k=2: L1 = 4, a2 = 4, a22 = 10, Solve the 1 1 system L1 `2 = a2 or 4`2 = 4 so `2 = 1.


4 0
`22 = 10 1 = 3. Therefore L2 = .
1 3

4 0 4 4 0
k=3: L2 = , a3 = , a33 = 6. Solve the 2 2 system L2 `3 = a3 or `3 =
1 3 4 1 3
s
1 4 0 0
4 1
so `3 = . `33 = 6 1 1 = 2. Therefore L3 = 1 3 0
4 1 1
1 1 2

4 0 0 4
k=4: L3 = 1 3 0 , a4 = 2 , a44 = 4. Solve the 3 3 system L3 `4 = a4 or
1 1 2 2
v
u
4 0 0 4 1 u 1
1 3 0 `4 = 2 so `4 = 1 . `44 = u t4 1 1 1 1 = 1.
1 1 2 2 1 1

4 0 0 0
1 3 0 0
Therefore L = L4 = 1 1

2 0
1 1 1 1

T T
To solve Ax
= b note
that LL x = b which can be solved by solving Lc = b and then L x = c.
8 1
6
Lc = b c = and LT x = c x = 2 .
3 1
1 1

You might also like