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 (), 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"))