glsresids() is used by macro glsfactor() to do GLS factor extraction by a nonlinear least squares method. |

glsresid(theta,0,vector(r),m) returns a length p^2 "residual vector" computed from but not identical with dmat(p,1) - solve(r) %*% rhat, where r is a REAL p by p correlation or variance-covariance matrix. m > 0 is an integer specifying the number of factors to extract. When __USELOGSGLS, a LOGICAL scalar defined by glsfactor(), has value False, argument theta is interpreted as psi, the length(p) REAL vector of uniquenesses. When __USELOGSGLS is True, theta is interpreted as log(psi). glsresid saves a copy of psi in variable _PSIGLS. rhat = dmat(psi) + V, where V is the best rank m approximation to r - dmat(psi) in a generalized least squares sense. glsresids() is used by macro glsfactor() which does generalized least squares (GLS) factor extraction.

Gary Oehlert 2003-01-15