CAex                 package:Matrix                 R Documentation

_A_l_b_e_r_s' _e_x_a_m_p_l_e _M_a_t_r_i_x _w_i_t_h "_D_i_f_f_i_c_u_l_t" _E_i_g_e_n _F_a_c_t_o_r_i_z_a_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     An example of a sparse matrix for which 'eigen()' seemed to be
     difficult, an unscaled version of this has been posted to the web,
     accompanying an E-mail to R-help (<URL:
     https://stat.ethz.ch/mailman/listinfo/r-help>), by Casper J
     Albers, Open University, UK.

_U_s_a_g_e:

     data(CAex)

_F_o_r_m_a_t:

     This is a 72 * 72 symmetric matrix with 216 non-zero entries in
     five bands, stored as sparse matrix of class 'dgCMatrix'.

_D_e_t_a_i_l_s:

     In some versions of R, 'eigen(CAex)' fell into an infinite loop
     (whereas 'eigen(CAex, EISPACK=TRUE)' has been okay).

_E_x_a_m_p_l_e_s:

     data(CAex)
     str(CAex) # of class "dgCMatrix"

     image(CAex)# -> it's a simple band matrix with 5 bands
     ## and the eigen values are basically 1 (42 times) and 0 (30 x):
     zapsmall(ev <- eigen(CAex, EISPACK=TRUE, only.values=TRUE)$values)
     ## i.e., the matrix is symmetric, hence
     sCA <- as(CAex, "symmetricMatrix")
     ## and
     stopifnot(class(sCA) == "dsCMatrix",
               as(sCA, "matrix") == as(CAex, "matrix"))

