top of page

R package moveHMM

 

The R package moveHMM, available on CRAN, provides tools for the analysis of movement data with hidden Markov models. In particular, it includes functions for the estimation and simulation of HMMs, with the possibility to incorporate the effects of environmental (or other) covariates as drivers of the behavioural switching.

The package is described in detail in its vignette, where we illustrate its use on elk movement data.

We also present the package in a recent paper in Methods in Ecology and Evolution, and demonstrate its functionalities to determine a conservation plan for the Scottish wild haggis.

​

Tutorial on fitting HMMs

 

Hidden Markov models offer a very flexible framework to analyse various types of ecological data. We realise that the package moveHMM only covers the specific case of movement modelling, so we would like to provide some advice to implement more general HMM formulations.

 

EcoHMM member Théo Michelot compiled a document which describes two examples in detail: a 2-state HMM with Poisson-distributed observations, and a 3-state HMM inspired by movement models. R code is provided for simulation, estimation, and inference in these models.


This tutorial is targeted at readers familiar with the HMM statistical machinery (see references in our Publications page), and with R programming, who would like to get started with implementing HMMs from scratch.

​

Théo's tutorial on implementing HMMs:

General-purpose R packages

 

  • depmixS4 (a very powerful and useful R package that incorporates various types of dependent mixture models, and in particular HMMs)

  • HiddenMarkov (another useful package for HMMs, perhaps a bit easier to get started with as it focuses on HMMs exclusively, but also less general)

  • msm (developed specifically for the purpose of fitting continuous-time Markov chains and HMMs, but can also be used to fit discrete-time models)

​

These three packages and their use in a simple example are described in Chapter 8 of the second edition of the book Hidden Markov Models for Time Series: An Introduction Using R.

Other software

​

(content will be added soon)

bottom of page