Next: glsfactor() Up: Multivariate Macros Help File Previous: forstep()   Contents

# glscrit()

Usage:
 ```result <- glscrit(logpsi, k, structure(r, nfact [, del])), REAL vector logpsi, integer scalar k, integer nfact > 0, small REAL scalar del ```

Keywords: factor analysis
```glscrit() is used by facanal() with method:"gls" to compute the
generalized least squares (GLS) criterion F_gls(x), x = log(psi) being
eigenvalues.

trace((I - solve(r) %*% rhat) %*% (I - solve(r) %*% rhat))

result <- glscrit(logpsi, k, structure(r, nfact [,del]) computes a
scalar, vector or structure, depending on the value of integer k.

r is a REAL symmetric covariance or correlation matrix, nfact > 0 is the
number of factors, and del >= 0 is a small REAL scalar (default is 1e-5)
controlling how the gradient is computed.

When del = 0 (value used by facanal()), the gradient is computed
analytically.

When del > 0, the gradient vector has elements gradient[i] = (F_gls(x) +
del*(run(p)==i)) - F_gls(x))/del.

The result computed is as follows:
k           result
0           scalar F_gls(x), x = logpsi