## Stata 15 help for mf__factorsym

```
Title

[M-5] _factorsym() -- Factor a symmetric nonnegative-definite matrix

Syntax

real scalar _factorsym(real matrix A[, real scalar tol])

Description

_factorsym(A) factors a symmetric nonnegative-definite matrix A to a
lower triangular matrix and overwrites A with the solution.  Returned is
the rank of A.  For a matrix with dimension n and rank r < n, the
resulting matrix has n - r rows with zeros.  The optional argument tol is
the tolerance used to determine whether the matrix is nonnegative
definite.  The default is tol = sum(abs(diagonal(A)))*epsilon(16).

Remarks

The decomposition G of a symmetric nonnegative-definite matrix A is

A = GG'

where G is lower triangular.

A generalized inverse (G-inverse) can be computed from the factored
matrix G by typing

: G = A

: rank = _factorsym(G)

: Ai = I(n)

: rank = _solvelower(G,Ai)

: Ai = Ai'Ai

: mreldif(A,A*Ai*A)

You can compare this G-inverse Ai with that computed from invsym().

Conformability

_factorsym(A)
input:
A:  n x n
tol:  1 x 1  (optional)
output:
A:  n x n
result:  1 x 1

Diagnostics

_factorsym(A) uses the elements from the lower triangle of A without
checking whether A is symmetric.

Source code

_factorsym() is built-in.

```