MIMfit {mimR}R Documentation

Function to fit model in MIM

Description

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

Usage

## S3 method for class 'mim':
fit(m, arg=NULL, ...)

Arguments

m A mim model object
arg Additional MIM arguments controlling the fitting algorithm
... Additional arguments, currently not used.

Details

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.

Value

Returns a fitted mim object

Note

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

Author(s)

Søren Højsgaard, sorenh@agrsci.dk

References

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

Examples


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,"er")
imputeMissing()
d.imp <- retrieveData()


[Package mimR version 2.6.1 Index]