hmmTMB: hidden Markov models with flexible covariate effects in R

📅 2022-11-25
📈 Citations: 10
✨ Influential: 1
📄 PDF
🤖 AI Summary
Standard hidden Markov models (HMMs) lack flexibility in incorporating covariates to elucidate drivers of state transitions or to construct Markov-switching regression models. Method: We develop the R package `hmmTMB`, the first framework to unify automatic smoothness-selection multivariate penalized splines, hierarchical random effects, and generalized response distributions within the HMM paradigm. It enables nonlinear covariate effects in both transition probabilities and observation parameters, and supports extensions such as semi-Markov and higher-order Markov structures. Inference leverages the Template Model Builder (TMB), Laplace approximation, and ADMB’s automatic differentiation for efficient Bayesian estimation. Contribution/Results: Applied to complex time-series data—including animal movement tracking—`hmmTMB` significantly improves state decoding accuracy and interpretability of covariate effects. It broadens the applicability and flexibility of HMMs in ecology, medicine, and finance by enabling rich, interpretable, and computationally scalable modeling of dynamic processes.
📝 Abstract
Hidden Markov models (HMMs) are widely applied in studies where a discrete-valued process of interest is observed indirectly. They have for example been used to model behaviour from human and animal tracking data, disease status from medical data, and financial market volatility from stock prices. The model has two main sets of parameters: transition probabilities, which drive the latent state process, and observation parameters, which characterise the state-dependent distributions of observed variables. One particularly useful extension of HMMs is the inclusion of covariates on those parameters, to investigate the drivers of state transitions or to implement Markov-switching regression models. We present the new R package hmmTMB for HMM analyses, with flexible covariate models in both the hidden state and observation parameters. In particular, non-linear effects are implemented using penalised splines, including multiple univariate and multivariate splines, with automatic smoothness selection. The package allows for various random effect formulations (including random intercepts and slopes), to capture between-group heterogeneity. hmmTMB can be applied to multivariate observations, and it accommodates various types of response data, including continuous (bounded or not), discrete, and binary variables. Parameter constraints can be used to implement non-standard dependence structures, such as semi-Markov, higher-order Markov, and autoregressive models. Here, we summarise the relevant statistical methodology, we describe the structure of the package, and we present an example analysis of animal tracking data to showcase the workflow of the package.
Problem

Research questions and friction points this paper is trying to address.

Develops R package for flexible hidden Markov models with covariates
Enables non-linear covariate effects using penalized splines
Supports multivariate observations and diverse response data types
Innovation

Methods, ideas, or system contributions that make the work stand out.

Flexible covariate models in HMMs
Non-linear effects via penalised splines
Supports multivariate and mixed data types
🔎 Similar Papers
No similar papers found.
💼 Related Jobs
No related jobs found.
Dalhousie University
T
T. Michelot
Dalhousie University