Language Reference |
computes the Gram-Schmidt orthonormalization
The GSORTH subroutines implements an algorithm described by Golub (1969).
The GSORTH subroutine is not recommended for the construction of matrices of values of orthogonal polynomials; the ORPOL function should be used for that purpose.
If lindep is 1, you can rearrange the columns of and rows of so that the zero columns of are right-most - that is, , where is the column rank of and is preserved. The following statements make this rearrangement:
d=rank((ncol(t)-(1:ncol(t))`)#(vecdiag(t)=0)); temp=p; p[,d]=temp; temp=t; t[,d]=temp;An example of a valid GSORTH call follows:
x={1 1 1, 1 2 4, 1 3 9}; xpx=x`*x; call gsorth(p, t, l, xpx);These statements produce the following output matrices:
P 3 rows 3 cols (numeric) 0.193247 -0.753259 0.6286946 0.386494 -0.530521 -0.754434 0.9018193 0.3887787 0.1886084 T 3 rows 3 cols (numeric) 15.524175 39.035892 104.99753 0 2.0491877 8.4559365 0 0 0.1257389 L 1 row 1 col (numeric) 0
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.