MIMfit {mimR} | R Documentation |
Fits model in MIM either directly or using an EM–algorithm in the case of incomplete data
fit(object, arg=NULL)
object |
A mim model object |
arg |
Additional MIM arguments controlling the fitting algorithm |
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.
Returns a fitted mim object
Before using mimR, make sure that the MIM program is runnning.
Søren Højsgaard, sorenh@agrsci.dk
David Edwards, An Introduction to Graphical Modelling, Springer Verlag, 2002
## Not run: data(math) math$L <- factor(NA, levels=1:2) gmd.math <- as.gmData(math) latent(gmd.math) <- "L" m1 <- mim("..", data=gmd.math, fit=FALSE) m2 <- editmim(m1, deleteEdge=paste(names(math)[1:5],collapse=':')) m2f <- fit(m2) imputeMissing() d.imp <- retrieveData() ## End(Not run)