FIT                   package:mimR                   R Documentation

_F_u_n_c_t_i_o_n _t_o _f_i_t _m_o_d_e_l _i_n _M_I_M

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

     Fits model in MIM either directly or using an EM-algorithm in the
     case of incomplete data

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

     fit(mim, submitData=TRUE)
     emfit(mim, arg = "R", submitData=TRUE, emconv=0.0001, emmax=1000, plot = FALSE,info=FALSE) 

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

     mim: A mim model object

submitData: If TRUE  data are submitted to MIM, otherwise not. If data
          is already loaded in MIM, setting submitData=FALSE saves some
          time

     arg: can be one of the letters "R", "S" or "F"

  emconv: Convergence criterion for EM algorithm

   emmax: 

    plot: If TRUE, the convergence history of the EM algorithm is
          plotted

    info: If TRUE, information about EM fit is printed

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

     The S option enables the user to supply start values for the
     missing data: as with the R option these are used to calculate the
     sufficient statistics, and thence the initial parameter estimates.
     First start values are entered, and then these are overwritten 
     with an asterix (missing value). For an example of how to do this,
     see the examples below.

     The start values can be entered using EditData in MIM: first enter
     the desired value, and then overwrite this with an asterix
     (missing value). Check using Print E in MIM that the values have
     been correctly entered.

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

     Returns a fitted mim object

_N_o_t_e:

     Before using mimR, make sure that the MIM program is runnning.

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

     Sren Hjsgaard, sorenh@agrsci.dk

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

     David Edwards, An Introduction to Graphical Modelling, Springer
     Verlag, 2002

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

     data(mathmark)
     math     <- mathmark
     math$L   <- factor(NA, levels=1:2)
     gmd.math <- as.gmData(math)
     latent(gmd.math) <- "L"
     m1  <- mim("..", data=gmd.math)
     m2  <- editmim(m1, deleteEdge=paste(names(math)[1:5],":",collapse='')) 
     m2f <- emfit(m2)
     imputeMissing()
     d.imp <- retrieveData()

