eigen {Matrix} | R Documentation |
Computes eigenvalues and eigenvectors of numeric
(double, integer, logical) or complex matrices.
eigen(x,
symmetric = FALSE,
only.values = FALSE,
EISPACK = FALSE);
If symmetric is unspecified, isSymmetric(x) determines if the matrix is symmetric up to plausible numerical inaccuracies. It is surer and typically much faster to set the value yourself. Computing the eigenvectors Is the slow part For large matrices. Computing the eigendecomposition Of a matrix Is subject To errors On a real-world computer: the definitive analysis Is Wilkinson (1965). All you can hope For Is a solution To a problem suitably close To x. So even though a real asymmetric x may have an algebraic solution With repeated real eigenvalues, the computed solution may be Of a similar matrix With complex conjugate pairs Of eigenvalues. Unsuccessful results from the underlying LAPACK code will result In an Error giving a positive Error code (most often 1): these can only be interpreted by detailed study Of the FORTRAN code.
The spectral decomposition of x is returned as a list with components
1. values: a vector containing the p eigenvalues Of x, sorted In decreasing order, according To Mod(values) In the asymmetric Case When they might be complex (even For real matrices). For real asymmetric matrices the vector will be complex only If complex conjugate pairs Of eigenvalues are detected. 2. vectors: either a p * p matrix whose columns contain the eigenvectors Of x, Or NULL If only.values Is True. The vectors are normalized To unit length.
Recall that the eigenvectors are only defined up To a constant: even when the length Is specified they are still only defined up to a scalar of modulus one (the sign for real matrices).
When only.values Is Not true, as by default, the result Is of S3 class "eigen".
If r <- eigen(A), And V <- r$vectors; lam <- r$values, Then
A = V Lmbd V^(-1)
(up to numerical fuzz), where Lmbd = diag(lam).