eigen                  package:base                  R Documentation

_S_p_e_c_t_r_a_l _D_e_c_o_m_p_o_s_i_t_i_o_n _o_f _a _M_a_t_r_i_x

_D_e_s_c_r_i_p_t_i_o_n:

     Computes eigenvalues and eigenvectors of real or complex matrices.

_U_s_a_g_e:

     eigen(x, symmetric, only.values = FALSE, EISPACK = FALSE)

_A_r_g_u_m_e_n_t_s:

       x: a matrix whose spectral decomposition is to be computed.

symmetric: if 'TRUE', the matrix is assumed to be symmetric (or
          Hermitian if complex) and only its lower triangle (diagonal
          included) is used.  If 'symmetric' is not specified, the
          matrix is inspected for symmetry.

only.values: if 'TRUE', only the eigenvalues are computed and returned,
          otherwise both eigenvalues and eigenvectors are returned.

 EISPACK: logical. Should EISPACK be used (for compatibility with R <
          1.7.0)?

_D_e_t_a_i_l_s:

     By default 'eigen' uses the LAPACK routines DSYEVR, DGEEV, ZHEEV
     and ZGEEV whereas 'eigen(EISPACK=TRUE)' provides an interface to
     the EISPACK routines 'RS', 'RG', 'CH' and 'CG'.

     If 'symmetric' is unspecified, the code attempts to determine if
     the matrix is symmetric up to plausible numerical inaccuracies. 
     It is faster and surer to set the value yourself.

     'eigen' is preferred to 'eigen(EISPACK = TRUE)' for new projects,
     but its eigenvectors may differ in sign and (in the asymmetric
     case) in normalization. (They may also differ between methods and
     between platforms.)

     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.

_V_a_l_u_e:

     The spectral decomposition of 'x' is returned as components of a
     list with components

  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. 

 vectors: either a p * p matrix whose columns contain the eigenvectors
          of 'x', or 'NULL' if 'only.values' is 'TRUE'.

          For 'eigen(, symmetric = FALSE, EISPACK =TRUE)' the choice of
          length of the eigenvectors is not defined by EISPACK.  In all
          other cases 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). 

_R_e_f_e_r_e_n_c_e_s:

     Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S
     Language_. Wadsworth & Brooks/Cole.

     Smith, B. T, Boyle, J. M., Dongarra, J. J., Garbow, B. S.,
     Ikebe,Y., Klema, V., and  Moler, C. B. (1976). _Matrix
     Eigensystems Routines - EISPACK Guide_. Springer-Verlag Lecture
     Notes in Computer Science.

     Anderson. E. and ten others (1999) _LAPACK Users' Guide_. Third
     Edition. SIAM.
      Available on-line at <URL:
     http://www.netlib.org/lapack/lug/lapack_lug.html>.

     Wilkinson, J. H. (1965) _The Algebraic Eigenvalue Problem._
     Clarendon Press, Oxford.

_S_e_e _A_l_s_o:

     'svd', a generalization of 'eigen'; 'qr', and 'chol' for related
     decompositions.

     To compute the determinant of a matrix, the 'qr' decomposition is
     much more efficient: 'det'.

_E_x_a_m_p_l_e_s:

     eigen(cbind(c(1,-1),c(-1,1)))
     eigen(cbind(c(1,-1),c(-1,1)), symmetric = FALSE)
     # same (different algorithm).

     eigen(cbind(1,c(1,-1)), only.values = TRUE)
     eigen(cbind(-1,2:1)) # complex values
     eigen(print(cbind(c(0,1i), c(-1i,0))))# Hermite ==> real Eigen values
     ## 3 x 3:
     eigen(cbind( 1,3:1,1:3))
     eigen(cbind(-1,c(1:2,0),0:2)) # complex values

