Finds the linear relations associated with matrix singularities (J.H. Maindonald).
|Printed output (
||Specifies the positive semi-definite matrix for which the information is required|
||Stores the coefficients of the linear dependencies|
LINDEPENDENCE takes a positive semi-definite matrix S (e.g. a matrix formed as X′X), and identifies any columns of S that are a linear combination of earlier columns. It determines the linear relations involved, and stores these in the columns of the matrix specified by the
In more mathematical terms the output, stored as columns of
COEFFICIENTS, is a basis for the null space of a positive semi-definite matrix S. If S = X′X, then this will also be a basis for the column space of X.
The first parameter,
DATA, specifies the symmetric matrix S for which the information is required. The columns of the
COEFFICIENTS matrix store the linear relations. This matrix will be defined automatically if it has not been declared earlier.
Printed output information on either which columns are dependent and/or what the coefficients for the dependencies are can be requested with the settings
coefficients of the
The matrix function
CHOLESKI is used to determine a lower triangular matrix L such that LL′ = S. Zeros on the diagonal of L identify columns of S that are a linear combination of earlier columns. The corresponding columns of L′ form a matrix H. The algorithm then replaces zeros on the diagonal of L′ by ones, to give the matrix T, and solves the equation T B = H. Finally it identifies in each column of H the element that was originally on the diagonal of L, and sets each such element to -1. For further details, see Maindonald (1984) page 105.
Warning – if S is inaccurately formed, e.g. using single precision calculations, there is a risk that it will not be detected as singular, or that it will be detected as not positive semi-definite.
Maindonald, J.H. (1984). Statistical Computation. Wiley, New York.
Commands for: Calculations and manipulation.
CAPTION 'LINDEPENDENCE example'; STYLE=meta VARIATE [VALUES=0...10] x VARIATE [VALUES=6,5,5,4,3,3,2,1,1,0,0] x CALCULATE x=x+0.5*x "This ensures that x is a linear combination of x and x" VARIATE [VALUES=(0,1)5,1] x CALCULATE x=0.5*x+x+0.5*x "This ensures that x is a linear combination of x, x, and x" MATRIX [ROWS=5; COLUMNS=11; VALUES=#x[1...5]] xt CALCULATE ss=QPROD(xt;1) LINDEPENDENCE [PRINT=dependent,coefficient] ss; b