ABSTRACT

This chapter describes three R packages that deal with hidden Markov models (HMM), namely depmixS4, HiddenMarkov and msm. It discusses how these packages can be used to fit basic HMMs to data, and to decode. The chapter provides one example of the use of 2OpenBUGS, which provides an interface to OpenBUGS. The software OpenBUGS and its predecessor WinBUGS are designed to produce samples from the posterior distributions of a wide range of statistical models. The package depmixS4 is a powerful R package that incorporates various types of dependent mixture model. The specified parameter values serve as initial values in the numerical search for the maximum likelihood estimates, though the HMM object specified in this way can be used to simulate data from a model with those parameters. Hidden Markov does offer the option of fitting stationary models, but as D. Harte writes, this is done 'in a slightly ad-hoc manner by effectively disregarding the first term' of the complete-data log-likelihood.