fitDag                  package:ggm                  R Documentation

_F_i_t_t_i_n_g _o_f _G_a_u_s_s_i_a_n _D_A_G _m_o_d_e_l_s

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

     Fits linear recursive regressions with independent residuals
     specified by a DAG.

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

     fitDag(amat, S, n)

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

    amat: a square matrix with dimnames representing the adjacency
          matrix of the DAG

       S: a symmetric positive definite matrix, the sample covariance
          matrix

       n: an integer > 0, the sample size

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

     'fitDag' checks if the order of the nodes in adjacency matrix is
     the same of 'S' and if not it reorders the adjacency matrix to
     match the order of the variables in 'S'. The nodes of the
     adjacency matrix may form a subset of the variables in 'S'.

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

    Shat: the fitted covariance matrix.

    Ahat: a square matrix of the fitted regression coefficients. The
          entry 'Ahat[i,j]' is minus the regression coefficient of
          variable 'i' in the regression equation 'j'. Thus there is a
          non zero partial regression coefficient 'Ahat[i,j]'
          corresponding to each non zero value  'amat[j,i]' in the
          adjacency matrix.

    Dhat: a vector containing the partial variances of each variable
          given the parents.

     dev: the `deviance' of the model.

      df: the degrees of freedom.

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

     Giovanni M. Marchetti

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

     Cox, D. R. & Wermuth, N. (1996). _Multivariate dependencies_.
     London: Chapman & Hall.

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

     'DAG', 'swp'.

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

     dag <- DAG(y ~ x+u, x ~ z, z ~ u)
     "S" <- structure(c(2.93, -1.7, 0.76, -0.06,
                        -1.7, 1.64, -0.78, 0.1,
                         0.76, -0.78, 1.66, -0.78,
                         -0.06, 0.1, -0.78, 0.81), .Dim = c(4,4),
              .Dimnames = list(c("y", "x", "z", "u"), c("y", "x", "z", "u")))
     fitDag(dag, S, 200)

