fitDagLatent               package:ggm               R Documentation

_F_i_t_t_i_n_g _G_a_u_s_s_i_a_n _D_A_G _m_o_d_e_l_s _w_i_t_h _o_n_e _l_a_t_e_n_t _v_a_r_i_a_b_l_e

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

     Fits by maximum likelihood a Gaussian DAG model where one of the
     nodes of the graph is latent and it is marginalised over.

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

     fitDagLatent(amat, Syy, n, latent, norm = 1, seed = 144,
                  maxit = 9000, tol = 1e-06, pri = FALSE)

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

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

     Syy: a symmetric positive definite matrix, with dimnames, the
          sample covariance matrix of the observed variables. The set
          of the observed nodes of the graph must be a subset of the
          set of the names of the variables in 'Syy'.

       n: a positive integer, the sample size.

  latent: the name of the latent variable.

    norm: an integer, the kind of normalization of the latent variable.
          If 'norm=1', the latent is scaled to have unit variance. If
          'norm=2', the latent is scaled to have unit partial variance
          given its parents.

    seed: an integer, used by 'set.seed' to specify a random starting
          point of the EM algorithm.

   maxit: an integer denoting the maximum number of iterations allowed
          for the EM algorithm. If the convergence criterion is not
          satisfied within maxit iterations the algorithms stops and a
          warning message is returned.

     tol: a small real value, denoting the tolerance used in testing
          convergence.

     pri: logical, if 'pri=TRUE' then the value of the deviance at each
          iteration is printed.

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

     For the EM algorithm used see Kiivery (1987).

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

    Shat: the fitted covariance matrix of all the variables including
          the latent one. The latent variable is the last. If 'norm=1'
          then the variance of the latent variable is constrained to 1. 

    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. If 'norm=2' then the partial variance of
          the latent variable is constrained to 1.  

     dev: the `deviance' of the model. 

      df: the degrees of freedom of the model. 

      it: the number of EM algorithm iterations at convergence. 

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

     Giovanni M. Marchetti

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

     Kiiveri,H. T. (1987). An incomplete data approach to the analysis
     of covariance structures. _Psychometrika_, 52, 4, 539-554.

     J\"oreskog, K.G. & Goldberger, A.S. (1975). Estimation of a model
     with multiple indicators and multiple causes of a single latent
     variable. _Journal of the American Statistical Association_, 10,
     631-639.

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

     'fitDag', 'checkIdent'

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

     ## data from Joreskog and Goldberger (1975)
     V <- matrix(c(1,     0.36,   0.21,  0.10,  0.156, 0.158,
                   0.36,  1,      0.265, 0.284, 0.192, 0.324,
                   0.210, 0.265,  1,     0.176, 0.136, 0.226,
                   0.1,   0.284,  0.176, 1,     0.304, 0.305, 
                   0.156, 0.192,  0.136, 0.304, 1,     0.344,
                   0.158, 0.324,  0.226, 0.305, 0.344, 1),     6,6)
     nod <- c("y1", "y2", "y3", "x1", "x2", "x3")
     dimnames(V) <- list(nod,nod)
     dag <- DAG(y1 ~ z, y2 ~ z, y3 ~ z, z ~ x1 + x2 + x3, x1~x2+x3, x2~x3) 
     fitDagLatent(dag, V, n=530, latent="z", seed=4564)
     fitDagLatent(dag, V, n=530, latent="z", norm=2, seed=145)

