Next: chplot()
Up: MacAnova Help File
Previous: changestr()
Contents
Usage:
cholesky(x [,pivot:T or force:T , nonposok:T]), x a positive definite
square REAL matrix with no MISSING values
|
Keywords:
matrix algebra
cholesky(A) returns the Cholesky decomposition of the positive definite
REAL symmetric matrix A. Its value is the REAL upper triangular matrix
r of the same size as A such that r' %*% r = A. It is an error if A is
not positive definite.
cholesky(A, nonposok:T) does the same, except that a non positive
definite A is not considered to be an error, but results a value of NULL
being returned. This makes it possible for a macro to take corrective
action when a matrix is not positive definite. See topics 'macros' and
'NULL'.
cholesky(A,pivot:T [,nonposok:T]) reorders the rows and columns as the
computation proceeds so as to obtain the most stable computation. It
returns a structure with components 'r', a REAL upper triangular matrix,
and 'pivot', a REAL vector of integers describing the reordering. After
result <- cholesky(A,pivot:T), result$r' %*% result$r should equal
A[result$pivot, result$pivot] except for rounding error.
cholesky(A,force:Vec [,nonposok:T]), where Vec is a REAL vector whose
length is nrows(A), enables pivoting, but allows some control on
reordering. The elements of Vec should be 1, -1, or 0, since only the
signs are used. Before factoring, rows and columns of A, if any, with
index j such that Vec[j] > 0 are moved to rows and columns 1, 2, ...,
(initial columns) but are not further moved. All rows and columns with
Vec[j] < 0 are moved to rows and columns nrows(A), nrows(A) - 1, ...,
(final columns) but are not further moved. Rows and columns, if any,
with Vec[j] == 0 (pivoted columns), are free to be reordered, but will
follow the initial columns and precede the final columns. Again the
result is a structure with components 'r' and 'pivot'.
See also qr().
Gary Oehlert
2003-01-15