ORTHON

Example

ORTHON orthonormalizes an arbitrary matrix and saves the orthonormalizing transformation. The columns of the resulting matrix span the same space as the columns of the original matrix, but are orthonormal (orthogonal and scaled so that their Euclidean norm is one).

ORTHON <input matrix> <triangular matrix> <orthonormalized matrix> ;

Usage

The input matrix X is a general NROW by NCOL matrix. ORTHON obtains a triangular matrix S of order NROW such that X'X = S'S. It uses the inverse of S to transform X by postmultiplying it. S-inverse and the orthonormalized X are returned in the second and third arguments to the procedure.

ORTHON transforms a data matrix X as it is done in TSP's regression calculation to obtain more accurate results. Even if S is not determined very accurately due to inaccuracy in forming the cross product matrix X'X, a regression run on the transformed Xs and then untransformed will produce extremely accurate results, since the actual matrix inversion is performed on an X'X matrix from which most collinearity has been removed.

Output

ORTHON produces no printed output. Two matrices are stored in data storage.

Method

ORTHON forms X'X from the X matrix, factors it using the Choleski factorization algorithm, inverts the result using the method described in MATRIX, and postmultiplies X by the resulting upper triangular matrix.

Example

The following example shows how to use ORTHON in programming ordinary least squares explicitly in TSP:

MMAKE X C X1 X2 ;

ORTHON X S XTILDA ;

MAT XTXINV = (XTILDA'XTILDA)" ;

MAT BETA = S*XTXINV*XTILDA'Y ;

MAT XXINV = S*XTXINV*S';

The resulting BETA and XXINV are estimates of the untransformed coefficients and the inverse of the X'X matrix.