Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Group: Linear Algebra
See also: svd eigsm ludecomp chol

Function: chold
Description: The function chold is calculating the triangularisation and the Cholesky decomposition of x into matrices b and d, so that b'*d*b = x.

Usage: bd = chold(x,l)
Input:
x n x n matrix, the input matrix
l scalar, the number of lower non-zero subdiagonals including the diagonal
Output:
bd n x n matrix, see note

Note:

Example:
randomize(0)
x = normal(3,3)
x = x*x'
x[1,3]=0
x[3,1]=0
x
chold(x,2)  ; since the third lower diagonal is zero                 
Result:

Contents of x
[1,]   1.9005   2.6997        0 
[2,]   2.6997   5.5519  -2.5479 
[3,]        0  -2.5479   4.3615 
Contents of chol
[1,]   1.9005   1.4205        0 
[2,]        0    1.717  -1.4839 
[3,]        0        0   0.5808 
Example:
randomize(0)
x = normal(3,3)
x = x*x'
x
bd = chold(x, 3)
d = diag(xdiag(bd))
b = bd -d + eye(rows(bd))
b'*d*b ; triangularisation
l = b'*sqrt(d) ; cholesky
l*l'      
Result:

Contents of x
[1,]   1.9005   2.6997  -1.2229 
[2,]   2.6997   5.5519  -2.5479 
[3,]  -1.2229  -2.5479   4.3615 
Contents of _tmp
[1,]   1.9005   2.6997  -1.2229 
[2,]   2.6997   5.5519  -2.5479 
[3,]  -1.2229  -2.5479   4.3615 
Contents of _tmp
[1,]   1.9005   2.6997  -1.2229 
[2,]   2.6997   5.5519  -2.5479 
[3,]  -1.2229  -2.5479   4.3615 

Group: Linear Algebra
See also: svd eigsm ludecomp chol

Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

(C) MD*TECH Method and Data Technologies, 17.8.2000