swp                   package:ggm                   R Documentation

_S_w_e_e_p _o_p_e_r_a_t_o_r

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

     Sweeps a covariance matrix with respect to a subset of indices.

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

     swp(V, b)

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

       V: a symmetric positive definite matrix, the covariance matrix.

       b: a subset of indices of the columns of 'V'.

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

     The sweep operator has been introduced by Beaton (1964) as a tool
     for inverting symmetric matrices (see Dempster, 1969).

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

     a square matrix 'U' of the same order as 'V'. If 'a' is the
     complement of 'b', then 'U[a,b]' is the matrix of regression
     coefficients of 'a' given 'b' and 'U[a,a]' is the corresponding
     covariance matrix of the residuals.

     If 'b' is empty the function returns 'V'.

     If 'b' is the vector '1:nrow(V)' (or its permutation) then the
     function returns the opposite of the inverse of 'V'.

_A_u_t_h_o_r(_s):

     Giovanni M. Marchetti

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

     Beaton, A.E. (1964). _The use of special matrix operators in
     statistical calculus_. Ed.D. thesis, Harvard University. Reprinted
     as Educational Testing Service Research Bulletin 64-51. Princeton.

     Dempster, A.P. (1969). _Elements of continuous multivariate
     analysis_.  Reading: Addison-Wesley.

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

     'fitDag'

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

     ## A very simple example
     V <- matrix(c(10, 1, 1, 2), 2, 2)
     swp(V, 2)

