I’m happy to announce the first registered release of EmissionModels.jl!
HiddenMarkovModels.jl is deliberately agnostic about the observation model: anything implementing rand, logdensityof, and fit! can serve as an emission model; a model specifying how observations are generated conditional on a latent state.
EmissionModels.jl provides ready-to-use implementations for models that satisfy at least one of two criteria:
- Models commonly paired with HMMs, such as penalized generalized linear models.
- Models that arise regularly in specialized applications but are difficult to implement correctly, such as the calcium-imaging emission model included in the package.
The package grew out of a recurring problem in my own work: I kept reimplementing the same observation models for different collaborators and projects. I suspect there is a fair amount of duplicated effort across the community—not only for standard models, but also for more specialized models whose implementation burden can put them out of reach even when the statistical formulation is well understood. My hope is that EmissionModels.jl can provide a shared home for these implementations while preserving the flexibility that makes HiddenMarkovModels.jl useful.
In addition to emission models, the package includes a robust method for selecting the number of hidden states, (K), called the accumulated cutoff discrepancy criterion (ACDC). Criteria such as AIC and BIC can favor additional latent states that compensate for relatively small departures from the assumed emission model. This can improve predictive fit while producing states that do not correspond to meaningful latent processes. ACDC instead uses state-level discrepancies to select the smallest model whose states provide an acceptable description of the data. Although ACDC was originally developed for mixture models and related latent-variable models, the implementation in EmissionModels.jl extends it to HMMs.
Since the package is registered in General, it can be installed with:
pkg> add EmissionModels
This is an early release, so feedback, bug reports, feature requests, and contributions are very welcome. In particular, if there is an emission model you repeatedly implement for HMM applications, please open an issue or PR.
The repository currently lives under my personal account, but if the package proves useful to the community, I would eventually like to move it into an appropriate Julia organization for long-term maintenance.