Ginv               package:haplo.stats               R Documentation

_C_o_m_p_u_t_e _G_e_n_e_r_a_l_i_z_e_d _I_n_v_e_r_s_e _o_f _I_n_p_u_t _M_a_t_r_i_x

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

     Singular value decomposition (svd) is used to compute a
     generalized inverse of input matrix.

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

     Ginv(x, eps=1e-6)

_A_r_g_u_m_e_n_t_s:

       x: A matrix. 

     eps: minimum cutoff for singular values in svd of x 

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

     The svd function uses the LAPACK standard library to compute the 
     singular values of the input matrix, and the rank of the matrix is
      determined by the number of singular values  that  are  at  least
      as large   as  max(svd)*eps,  where  eps  is  a  small  value.  
     For S-PLUS, the Matrix library is required (Ginv loads Matrix if
     not already done so).

_V_a_l_u_e:

     List with components:

    Ginv: Generalized inverse of x. 

    rank: Rank of matrix x. 

_R_e_f_e_r_e_n_c_e_s:

     Press  WH,  Teukolsky  SA,  Vetterling  WT,  Flannery  BP.
     Numerical  recipes  in C. The art of scientific computing. 2nd ed.
     Cambridge University Press,  Cambridge.1992.  page 61.

     Anderson, E., et al. (1994). LAPACK User's Guide,  2nd edition,
     SIAM, Philadelphia.

_S_e_e _A_l_s_o:

     svd

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

     # for matrix x, extract the generalized inverse and 
     # rank of x as follows
         x <- matrix(c(1,2,1,2,3,2),ncol=3)
         save <- Ginv(x)
         ginv.x <- save$Ginv
         rank.x <- save$rank

