













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!














LU, Cholesky
N. Bell
Department of Computer Science University of Illinois at Urbana-Champaign
September 27, 2006
LU factorization Cholesky factorization Use of the backslash operator
Decompose once, solve many righthand sides quickly. O(Mn^3 ) with GE vs. O(n^3 + Mn^2 ) with LU Given A = LU you can compute A−^1 , det(A), rank(A), ker(A) etc.
Since L and U are triangular, it is easy to apply their inverses. Consider the solution to Ax = b.
A = LU =⇒ (LU)x = b
Regroup, matrix multiplication is associative
L(Ux) = b
Let Ux = y, then Ly = b Since L is triangular it is easy (without Gaussian elimination) to compute
y = L−^1 b
This expression should be interpreted as “Solve Ly = b with a forward substitution.”
Listing 1: Solve Ax
1 Factor A into L and U 2 Solve Ly = b for y use forward substitution 3 Solve Ux = y for x use backward substitution
Consider the following matrix
After reducing the first column we have
Notice that we can write A 1 as the product of matrices M 1 A
We can continue applying matrices to reduce the other columns
In our example we determined matrices M 1 and M 2 such that M 2 M 1 A = U was upper triangular. In the general case we have
(MnMn− 1... M 2 M 1 )A = U
So it follows A = (MnMn− 1... M 2 M 1 )−^1 U Now we need to show that (MnMn− 1... M 2 M 1 )−^1 is lower triangular.
Therefore we have factored A = LU
1 2 3 1
Caveat: Notice that the LU factorization can be stored in the same space as A. Some implementations overwrite A in the process of computing LU.
Like GE without pivoting, LU fails for some matrices [ 0 1 1 1
However with pivoting, the LU always exists. In practice, you get a factorization
LU = PA
where P is a permutation matrix. This even works when A is singular or rectangular.
A must be symmetric and positive definite (SPD) Factors A into LLt, like LU where U = Lt For SPD matrices, pivoting is not required Cholesky factorization requires one half as many flops as LU factorization. Since pivoting is not required, Cholesky factorization will be more than twice as fast as LU factorization since data movement is avoided. Refer to the text for a view of the algorithm Use built-in chol function for routine work
A matrix is Positive Definite (PD) if for all choices of the vector x the following holds
xtAx > 0
A matrix is SPD if it is symmetric and positive definite. This definition is not particularly intuitive.
Imagine 2 D space, except that moving in the x-direction is twice as expensive as moving in the y-direction. New innerproduct
[ x y
x y
Taking the norm of a vector [x, y] using this innerproduct represents our modified notion of length.
In practice we like SPD matrices because They are non-singular (why?) Cholesky is faster than LU Sparse Cholesky is faster than Sparse LU Conjugate Gradient SPD matrices arise in the discritization of many physical problems and are by no means exotic.