Cholesky Factorization using MATLAB | MATLAB Tutorial

A symmetric matrix is one where ai j = aji for all i and j. In other words, [A] = [A]T. Such systems occur commonly in both mathematical and engineering/science problem contexts.

Special solution techniques are available for such systems. They offer computational advantages because only half the storage is needed and only half the computation time is required for their solution.

One of the most popular approaches involves Cholesky factorization (also called Cholesky decomposition). This algorithm is based on the fact that a symmetric matrix can be decomposed, as in

[A] = [U]T [U]

That is, the resulting triangular factors are the transpose of each other.

The terms of above eq. can be multiplied out and set equal to each other. The factorization can be generated efficiently by recurrence relations. For the ith row:


Problem 1: Compute the Cholesky factorization for the symmetric matrix


For the first row (i = 1),


For the second row (i = 2),


For the third row (i = 3),


Thus, the Cholesky factorization yields


After obtaining the factorization, it can be used to determine a solution for a right-hand- side vector {b} in a manner similar to LU factorization. First, an intermediate vector {d} is created by solving

[U]T {d} = {b}

Then, the final solution can be obtained by solving

[U]{x} = {d}

Matlab m-file:

function x = Cholesky(A)
% input:
% A = coefficient matrix
% output:
% x = solution vector
if m~=n, error('Matrix A must be square');
% Right-hand-side vector is the sum of
% the rows of [A] can be generated as
b = [sum(A(1,:)); sum(A(2,:)); sum(A(3,:))];
U = chol(A);                % Cholesky factorization
disp('U = ');disp(U)
d = U'\b;
x = U\d;                    % solution
disp('x = ');disp(x)

Type the following in the command window. The same example is used as in above theory

>> A = [6 15 55; 15 55 225; 55 225 979];

>> Cholesky(A);

U =

2.4495    6.1237   22.4537

0    4.1833   20.9165

0         0    6.1101

x =




More Tutorials:

I am a Certified MATLAB Associate. I love MATLAB Coding & Enjoy Programming. I can make anything & everything possible with MATLAB.