Posts

Showing posts with the label Cholesky decomposition

Cholesky-decomposition of a Matrix

Cholesky-decomposition of a Matrix When a coefficient matrix of a linear system of equations is positive definite and symmetric, then Cholesky decomposition can be used. A positive definite symmetric matrix satisfies the condition $x^{T}Ax > 0$ and the elements of the lower $L$ and upper $U$ triangular matrix satisfies the condition $L_{i,j}=U_{j,i}$ i.e. $U = L^{T}$ and hence $A = LL^{T}$ . A symmetric matrix is positive definite if all its diagonal elements are positive and the diagonal element is larger than the sum of all other elements in that row (i.e. diagonally dominant). Example: choleskydeco_example function [X,C] = choleskydecomposition(A,B) % Applicable to only symmetric positive definite matrix % Input : % A : Coefficient matrix % B : right hand vector % Output : % X : Solution vector % C : Upper triangular metrix [n,m] = size(A); % rank of matrix A C = zeros(n,n); for i=1:n