Stata 11 help for mf_cholesky

help mata cholesky() -------------------------------------------------------------------------------

Title

[M-5] cholesky() -- Cholesky square-root decomposition

Syntax

numeric matrix cholesky(numeric matrix A)

void _cholesky(numeric matrix A)

Description

cholesky(A) returns the Cholesky decomposition G of symmetric (Hermitian), positive-definite matrix A. cholesky() returns a lower-triangular matrix of missing values if A is not positive definite.

_cholesky(A) does the same thing, except that it overwrites A with the Cholesky result.

Remarks

The Cholesky decomposition G of a symmetric, positive-definite matrix A is

A = GG'

where G is lower triangular. When A is complex, A must be Hermitian, and G', of course, is the conjugate transpose of G.

Decomposition is performed via [M-1] LAPACK.

Conformability

cholesky(A) A: n x n result: n x n

_cholesky(A) input: A: n x n output: A: n x n

Diagnostics

cholesky() returns a lower-triangular matrix of missing values if A contains missing values or if A is not positive definite.

_cholesky(A) overwrites A with a lower-triangular matrix of missing values if A contains missing values or if A is not positive definite.

Both functions use the elements from the lower triangle of A without checking whether A is symmetric or, in the complex case, Hermitian.

Source code

cholesky.mata; _cholesky() is built in.

Also see

Manual: [M-5] cholesky()

Help: [M-5] lud(); [M-4] matrix


© Copyright 1996–2009 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index