Next: stepuls() Up: Multivariate Macros Help File Previous: stepgls()   Contents


stepml(s, psi, m [, print:T]), REAL positive definite symmetric matrix
  s, REAL vector psi or structure with psi[1] a REAL vector, integer m
  > 0

Keywords: factor analysis, iteration
stepml(r, psi, m) performs one step of an iteration which attempts to
extract m factors in factor analyis.  r is a p by p correlation or
variance-covariance matrix, psi is a REAL vector of trial uniquenesses
of length p with min(psi) > 0 and integer m > 0.

The value returned is structure(psi:newpsi, loadings:L, crit:criterion),
where newpsi is an updated vector of uniquenesses, L a p by m matrix of
factor loadings satisfying L' %*% dmat(1/psi) %*% L is diagonal, and
criterion is a value of the criterion being minimized; see below.

In addition, stepml() also creates side effect variabls PSI, LOADINGS,
and CRITERION containing newphi, L and criterion.

Actually L is the loadings that minimize the criterion for argument
phi, not the output newphi, and criterion is the criterion assocated
with phi and L.

Each step reduces the likelihood (ML) criterion = log(det(rhat)) -
trace(r %*% solve(rhat)) - log(det(r)) - p, where rhat has the form
rhat = dmat(psi) + V where V is the unique rank m matrix that minimizes
this criterionfor given psi.

Argument psi can also have the form structure(psi1, ...) where psi1 is
the vector of uniquenesses.  This means you can do many steps of the
iteration as follows.

  Cmd> psi <- psi0 # psi0 a vector of starting values

  Cmd> for (i,1,500){psi <- stepml(r,psi,m);;}

stepml(r, psi, m, print:T) does the same except the updated psi and the
criterion value are printed.  For example,

  Cmd> for (i,1,500){psi <- stepml(r,psi,m,print:i %% 50 == 0);;}

prints out psi and and the criterion every 50 steps.

The iteration performed by stepml() is similar but not identical to what
is known Principal Factor Iteration.  It is not unusual for it to
converge very slowly.  In addition, it is possible a step to produce a
psi with min(psi) < 0 or r - dmat(psi) not non-negative definite.  When
this happens stepml() aborts.  You can retrieve the most recent
uniquenesses and loadings from variables PSI and LOADINGS.

It is usually preferable to use a method that more directly minimizes
the criterion.  At present, none such is distributed with MacAnova.
However, one of the function minimization macros, dfp, bfs or broyden
could be used to minimize the criterion as a function of psi or

Gary Oehlert 2003-01-15