depmixS4
is a framework for specifying and fitting dependent
mixture models, otherwise known as hidden or latent Markov models.
Optimization is done with the EM algorithm or optionally with Rdonlp2
when (general linear (in-)equality) constraints on the parameters need
to be incorporated. Models can be fitted on (multiple) sets of
observations. The response densities for each state may be chosen from
the GLM family, or a multinomial. User defined response densities are
easy to add.
Mixture or latent class (regression) models can also be fitted; these
are the limit case in which the length of observed time series is 1 for
all cases. Model fitting is done in two steps; first, models are specified through
the depmix
function (or the mix
function for
mixture and latent class models), which both use standard
glm
style arguments to specify the observed
distributions; second, the model needs to be fitted by using the
fit
function; imposing constraints is done through the
fit function. Standard output includes the optimized parameters and
the posterior densities for the states and the optimal state sequence.
On latent class models: A. L. McCutcheon (1987). Latent class analysis. Sage Publications.
depmix
, fit
# These should be added at some point ...
Run the code above in your browser using DataLab