GINVERSE procedure

Calculates the generalized inverse of a matrix (S.K. Haywood).


Options

PRINT = string
Printed output from the procedure (inverse); default *, i.e. no printing

METHOD = string
Method to be used to invert symmetric matrices (svd, lrv); default lrv

TOLERANCE = scalar
How close a number must be be to zero before it is recognised as zero; default 1.0-6


Parameters

INMATRIX = matrices
The matrix whose inverse is to be calculated

INVERSE = matrices
Matrix to save the generalized inverse


Description

GINVERSE calculates generalized inverses. The method of inversion depends on the type of the matrix to be inverted. Ordinary (square or rectangular) matrices are inverted using the singular value decomposition. This method can also be used for symmetric matrices, by setting option METHOD=svd; however, by default, these are inverted using an eigenvalue (lrv) decomposition. For a diagonal matrix, the inverse is calculated by taking the reciprocal of each individual value on the diagonal. The tolerance for zero, to be used in the calculations, can be set using the TOLERANCE option.

   The inverse can be saved using the INVERSE parameter; its type and dimensions will be defined automatically if it has not been declared in advance. The inverse can also be printed, by setting option PRINT=inverse.


Options: PRINT, METHOD, TOLERANCE. Parameters: INMATRIX, INVERSE.


Method

GINVERSE inverts a matrix structure by performing an singular value decomposition to represent the input matrix as

left-matrix *+ diagonal-matrix *+ right-matrix.

In the case of a square matrix both left- and right-matrices are orthogonal while, for a non-square matrix, one of the left- or the right-matrices is orthogonal (which one depending on the dimensions of the input matrix), and the other one is orthonormal. The three matrices are inverted: the diagonal matrix by taking each non-zero element and calculating the inverse of that value, the left- and right-matrices by transposition. The order of the three matrices is then reversed, and they are multiplied together to form the generalized inverse of the original matrix.

   A symmetric matrix is inverted in a similar way except that, by default, the matrix is decomposed using an eigenvalue decomposition.

   A diagonal matrix is inverted by taking the reciprocal of each non-zero element down the diagonal.

   For further details, see Graybill (1969) pages 96-103.


Reference

Graybill, A.F. (1969). Introduction to Matrices with Applications in Statistics. Colorado State University, Fort Collins, Colorado.