Source-linked AI summary

momentuHMM: R package for generalized hidden Markov models of animal movement

Brett T. McClintock, Theo Michelot

arXiv:1710.03786v2q-bio.QMstat.AP

TL;DR

Existing animal-movement HMM software is limited in its handling of movement complexity and telemetry data with irregular timing or measurement error. momentuHMM provides a flexible R package with broader movement, covariate, imputation, and modelling capabilities. The package extends available software and supports more realistic hypothesis-driven animal-movement analyses, with an example six-state, seven-stream model fitting in about one hour.

  • Problem

    Existing animal-movement HMMs have limited movement-model flexibility, while common software assumes temporally regular data with negligible measurement error.

  • Method

    momentuHMM is a user-friendly R package using familiar model formulas and flexible HMM components, including multiple imputation and continuous-time movement modelling.

  • Results

    The package greatly expands available software; one HMM with N = 6 states, seven data streams, and T = 7414 time steps took about 1 hour to fit.

  • Takeaways & Limitations

    momentuHMM facilitates more realistic hypothesis-driven animal-movement analyses while accounting for common telemetry-data challenges.

  • Takeaways & Limitations

    Model-fitting times could likely be improved by further optimizing the code for speed.

Abstract

from arXiv · show

Discrete-time hidden Markov models (HMMs) have become an immensely popular tool for inferring latent animal behaviors from telemetry data. Here we introduce an open-source R package, momentuHMM, that addresses many of the deficiencies in existing HMM software. Features include: 1) data pre-processing and visualization; 2) user-specified probability distributions for an unlimited number of data streams and latent behavior states; 3) biased and correlated random walk movement models, including "activity centers" associated with attractive or repulsive forces; 4) user-specified design matrices and constraints for covariate modelling of parameters using formulas familiar to most R users; 5) multiple imputation methods that account for measurement error and temporally-irregular or missing data; 6) seamless integration of spatio-temporal covariate raster data; 7) cosinor and spline models for cyclical and other complicated patterns; 8) model checking and selection; and 9) simulation. momentuHMM considerably extends the capabilities of existing HMM software while accounting for common challenges associated with telemetery data. It therefore facilitates more realistic hypothesis-driven animal movement analyses that have hitherto been largely inaccessible to non-statisticians. While motivated by telemetry data, the package can be used for analyzing any type of data that is amenable to HMMs. Practitioners interested in additional features are encouraged to contact the authors.

1 Introduction

Animal-movement HMMs can infer latent behaviours from telemetry, but existing approaches are constrained by limited data streams, states, and assumptions about data quality and timing. momentuHMM addresses these constraints with a more flexible R-based framework for realistic, hypothesis-driven analyses.

  • HMM foundations: HMMs model multivariate observations with state-dependent probability distributions and an unobservable state sequence governed by a Markov chain.The forward algorithm supports likelihood evaluation, while the Viterbi algorithm identifies the most likely hidden-state sequence.
  • Motivation: Location-only HMMs are limited in the number and type of biologically meaningful movement states they can accurately identify.Auxiliary biotelemetry and environmental data enable multivariate HMMs that capture greater behavioural realism and complex ecological relationships.
  • HMM foundations: Decoded movement states can identify behavioural changes, associated habitats, foraging hotspots, and activity budgets.
  • Motivation: Telemetry data commonly include measurement error, irregular timing, and missing observations, making explicit uncertainty treatment computationally intensive.These conditions conflict with the regular time steps typically required by discrete-time HMMs.
  • Software gap: Existing animal-movement HMM software is often limited to correlated random walks with two states and two data streams, while other packages require regular, nearly error-free locations.Additional deficiencies include limited support for covariates, biased movements, cyclical patterns, and parameter constraints.
  • Contribution: momentuHMM is introduced as a user-friendly R package for flexible, realistic HMM analyses that account for common telemetry-data challenges.The package provides practitioner-oriented examples and documentation while extending existing HMM software capabilities.

2 momentuHMM overview

momentuHMM provides a flexible workflow for preparing, fitting, visualizing, checking, and simulating multivariate HMMs with diverse data streams and covariate structures. It also supports irregular or error-prone telemetry through imputation and integrates spatio-temporal covariates and advanced movement models.

  • The package workflow covers data preparation, visualization, model specification and fitting, results visualization, model checking, and simulation.
  • momentuHMM supports an unlimited number of HMM data streams, with distributions including beta, gamma, normal, Poisson, von Mises, and Weibull.Additional streams can be added by adding list elements corresponding to those streams.
  • Spatio-temporal raster covariates, including wind velocity, forest cover, and sea ice concentration, are matched to observations by time and location.
  • The package supports cyclical and complex covariate patterns through cosinor models, splines, factor variables, and state- or parameter-specific formulas.Transition probabilities can also be fixed to selected values to prohibit or enforce switching between states.
  • For irregular or error-prone locations, crawlWrap predicts regular tracks from a continuous-time correlated random walk, while MIfitHMM repeatedly fits HMMs to imputed tracks.simData can simulate tracks for study design, power analyses, and model-performance assessment, potentially including observation error.

3 Examples

Real telemetry examples demonstrate momentuHMM's use for cyclical behavior, multiple behavioral data streams, environmental movement effects, and activity centers. The examples recover interpretable state patterns while incorporating irregular sampling and location uncertainty.

  • 3.1 African elephant: The elephant analysis modeled 24 h cycles in step length and temperature effects on turning-angle concentration, step length, and transition probabilities.Pseudo-residuals indicated that the model explained much of the periodicity in step length, although some improvement remained possible.
  • 3.1 African elephant: The African elephant model identified slow undirected “encamped” and faster directed “exploratory” states, assigned to about 74% and 26% of 1 h steps.Step lengths and transition probabilities varied with temperature, and the model was overwhelmingly supported by AIC over models with fewer covariates.
  • 3.2 Northern fur seal: The seal analysis estimated activity budgets of 0.31 resting, 0.28 foraging, and 0.41 transit, with foraging periods often followed by resting at sea.
  • 3.3 Loggerhead turtle: The loggerhead turtle model linked transit step length and turning angle to ocean-current speed, direction, and movement bearing using angular covariates.Transit movement followed currents, whereas foraging showed shorter steps perpendicular to currents and no directional persistence.
  • 3.4 Grey seal: The grey seal analysis identified haul-out, foraging, and low- and high-speed exploratory states associated with activity centers.Activity-center states exhibited shorter step lengths and less biased movements near targets, with results similar to a Bayesian analysis but requiring less computation and no custom MCMC.

4 Discussion

The authors present momentuHMM as an R package that expands animal-movement HMM capabilities, supports analyses accounting for telemetry-data challenges, and makes previously custom-coded analyses accessible to practitioners.

  • momentuHMM provides flexible capabilities for multivariate HMM analyses using animal location, auxiliary biotelemetry, and environmental data.
  • Analyses previously requiring custom code and model-fitting algorithms can be conducted with momentuHMM.
  • The package enables analyses incorporating greater behavioural and ecological realism while accounting for challenges commonly associated with telemetry data.
  • With sufficient processing power, parallel multiple imputations need not take longer than fitting a single HMM, although computation increases with the number of states or parameters.
  • On a standard desktop, fitting one HMM with N = 6 states, seven data streams, and T = 7414 time steps took about 1 hour.
  • Model fitting depends on starting values, and the package includes tools for specifying and perturbing parameters to diagnose convergence to local maxima.
  • The package includes position-process simulation based on the CTCRW model, while other movement models accounting for measurement error or temporal irregularity can also be passed to MIfitHMM.
  • Multiple imputation can account for measurement error, temporal irregularity, and other forms of missing data, including potentially non-random missingness.

Data accessibility

The authors make the code available through the momentuHMM R package on CRAN, with a development version hosted on GitHub.

  • All code discussed in the paper is available in the momentuHMM package for R on CRAN.
  • The development version of momentuHMM is available on GitHub.
Loading 1710.03786v2…