eigen
is generic.
eigen(x, ...) eigen.default(x, symmetric=all(x==t(x)), only.values=F)
x
;
the default test is prone to problems due to the finite precision
of numeric computations.
(If
x
is complex,
symmetric is taken to mean hermitian symmetric
and the default test is replaced
by
all(x==t(Conj(x)))
.)
TRUE
;
the default is to compute eigenvectors also.
x
:
nrow(x)
eigenvalues
in descending order of modulus.
x
giving the
eigenvectors corresponding to the eigenvalues in
values
.
The
j
th column is the eigenvector
for the
j
th element
of
values
.
Each vector has norm 1 if
symmetric=TRUE
.
Or NULL if
only.values
is
TRUE
.
If y <- eigen(x) and
x
is symmetric, then up to numerical error
x == y$vectors %*% diag(y$values) %*% t(y$vectors) in case
x
is real and .
x == y$vectors %*% diag(y$values) %*% t(Conj(y$vectors)) in case
x
is
complex.
When
symmetric
is
TRUE
, this algorithm
only looks at the lower triangle of
x
.
Note that different algorithms are used in the symmetric and non-symmetric cases, so the eigenvectors may not change smoothly from a symmetric matrix to a near-by, nearly symmetric one.
In the case of a non-symmetric real matrix, the eigenvalues and eigenvectors may be complex.
The EXAMPLES section shows a function that uses
eigen
to compute determinants.
If
A
is a square matrix
and
Ax == gx
where
g
is a scalar
and
x
is a vector,
then
g
is an eigenvalue
of
A
and
x
is an eigenvector
of
A
.
Eigenvalues occur frequently in statistics
(especially in multivariate analysis) as well as in other fields.
Maindonald, J. H. (1984). Statistical Computation. Wiley, New York.
Mardia, K. V., Kent, J. T. and Bibby, J. M. (1979). Multivariate Analysis. Academic Press, London.
Smith, B. T., Boyle, J. M., Dongarra, J. J., et al. (1976). Lecture Notes in Computer Science, Vol. 6, 2nd Edition. Eigensystem Routines - EISPACK Guide. Springer-Verlag, New York.
Thisted, R. A. (1988). Elements of Statistical Computing. Chapman and Hall, New York.
amat <- matrix(c(19,8,11,2,18,17,15,19,10), nrow = 3) eigen(amat) pprcom <- eigen(cov.mve(x)) # robust principal components # compute determinant using eigenvalues: det <- function(x) prod(eigen(x)$values)