Next: eigenvals() Up: MacAnova Help File Previous: edit()   Contents

# eigen()

Usage:
 ```eigen(x [,maxit:N, nonconvok:T]), x a REAL symmetric matrix with no MISSING values, integer N > 0 ```

Keywords: matrix algebra
```eigen(x) computes an eigenvector/eigenvalue decomposition of the
REAL symmetric matrix x.  The result is a structure with two REAL
components, 'values' and 'vectors'.  It an error if x contains any
MISSING values.

Vector eigen(x)\$values contains the eigenvalues in decreasing order
(eigen\$values[i] >= eigen\$values[i+1]).  If all you need are the eigen-
values, use eigenvals(x).

The columns of square matrix eigen(x)\$vectors are the eigenvectors of x
with eigen\$vectors[,j] corresponding to eigen\$values[j].  The eigen-
vectors are orthonormal, even when there are repeated eigenvalues.

From the properties of the eigenvalue/eigenvector decomposition of a
matrix,
eigen(x)\$vectors %*% dmat(eigen(x)\$values) %*% eigen(x)\$vectors'
should be the same as x, except for rounding error.

Non-convergence
It is possible for the algorithm used by eigen() not to converge,
although it rarely happens.  When it happens, the message
ERROR: algorithm to compute eigenvalues in eigen() did not converge
is printed.  Keywords 'maxit' and 'nonconvok' may be helpful in this
situation.

eigen(x maxit:N), where N > 0 is an integer, computes the eigenvalues
and eigenvectors, but sets the maximum number of iterations in the
algorithm to N.  The default value is 30.  By using N > 30, this may
allow you to compute eigenvalues and vectors you can't otherwise

eigen(x [,maxit:N] ,nonconvok:T) does the same, except failure to
converge is not an error.  When convergence does not occur, no message
printed and NULL is returned.  You can use this in a macro to make it
possible to recover from failure to converge, perhaps by invoking
eigen() again using 'maxit' to increase the number of iterations.

Keyword phrases 'maxit:T' and 'nonconvok:T' may also be used on
eigenvals(), releigen() and releigenvals().