This R package implements flexible hidden Markov models, based on Template Model Builder (TMB): flexible state-dependent distributions, transition probability structures, random effects, and smoothing splines.


Michelot, T. (2022). hmmTMB: Hidden Markov models with flexible covariate effects in R. arXiv:2211.14139.

Package installation

Install the package from Github using devtools,


Package documentation

To find help files for the methods implemented in the package, search for help using the name of the corresponding class, e.g.,


We describe functionalities of the package in several vignettes: