
estModelMaybe is a highorder function which
turns an estimator for a model over a dataspace, t,
into an estimator for a corresponding "modelmaybe" over the
dataspace Maybe t,
i.e. where a datum may or may not be missing.
There are at least two options for modelling missingness:
If missingness is noninformative and not to be inferred,
a fixed distribution, "50:50" say, can be used to "model" it.
If missingness is to be estimated, use the option
m1 = estMultiState (map present dataSet).
estModelMaybe :: ([t]>ModelType t) > [Maybe t] > ModelType (Maybe t)
estModelMaybe estModel dataSet =
let present (Just _) = True
present Nothing = False
 m1 = estMultiState (map present dataSet)  model missingness
m1 = fiftyFifty  don't est' missingness
m2 = estModel (map (\(Just x) > x) (filter present dataSet))
in modelMaybe m1 m2

29/12/2003

modelMaybe is a "highorder" function which
takes a model of Boolean (for missingness) and
a model over dataspace, t, and produces
the corresponding model over the
dataspace Maybe t.
(NB. "quotes" in this case because models are
made of functions, rather than literally being functions,
whereas estimators are functions.)
modelMaybe :: (ModelType Bool) > (ModelType t) > ModelType (Maybe t)
modelMaybe m1 m2 =  Model of Bool > Model of T > Model of Maybe T
let negLogPr (Just x) = (nlPr m1 True) + (nlPr m2 x)  present
negLogPr Nothing = nlPr m1 False  missing
in MnlPr (msg1 m1 + msg1 m2)
negLogPr
(\() > "(Maybe " ++ showsPrec 0 m1 ("," ++ show m2 ++ ")"))
 29/12/2003

See the mixed Bayesian network
casestudy for an example of the use of
models for missing data.
The types of estModelMaybe and modelMaybe
can be generalised somewhat, but this will do for a start.

