Learn R Programming

moveHMM

An R package for analysing animal movement with hidden Markov models.

Get started with the vignettes:

Installation instructions

Stable release

The package is available on CRAN. To install it from CRAN, you can use the following command:

install.packages("moveHMM")

Install from Github

To install the latest (unstable) version of the package from Github:

devtools::install_github("TheoMichelot/moveHMM", build_vignettes = TRUE)

References

Michelot, T., Langrock, R., Patterson, T.A. (2016). moveHMM: An R package for analysing animal movement data using hidden Markov models. Methods in Ecology and Evolution. 7(11), 1308-1315.

Langrock, R., King, R., Matthiopoulos, J., Thomas, L., Fortin, D., & Morales, J. M. (2012). Flexible and practical modeling of animal telemetry data: hidden Markov models and extensions. Ecology, 93(11), 2336-2342.

Patterson, T. A., Basson, M., Bravington, M. V., & Gunn, J. S. (2009). Classifying movement behaviour in relation to environmental conditions using hidden Markov models. Journal of Animal Ecology, 78(6), 1113-1123.

Copy Link

Version

Install

install.packages('moveHMM')

Monthly Downloads

833

Version

1.11

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Theo Michelot

Last Published

June 23rd, 2025

Functions in moveHMM (1.11)

elk_data

Elk data set from Morales et al. (2004, Ecology)
is.moveHMM

Is moveHMM
haggis_data

Wild haggis data set from Michelot et al. (2016, Methods Eco Evol)
example

Example dataset
plotStationary

Plot stationary state probabilities
plot.moveHMM

Plot moveHMM
predictStationary

Predict stationary state probabilities
plot.moveData

Plot moveData
plotStates

Plot states
parDef

Parameters definition
dwrpcauchy_rcpp

Wrapped Cauchy density function
dwrpcauchy

Density function of wrapped Cauchy distribution
plotSat

Plot observations on satellite image
turnAngle

Turning angle
plotPR

Plot pseudo-residuals
viterbi

Viterbi algorithm
w2n

Scaling function: working to natural parameters
is.moveData

Is moveData
nLogLike

Negative log-likelihood function
simData

Simulation tool
splitAtGaps

Split track at gaps
nLogLike_rcpp

Negative log-likelihood
moveHMM

Constructor of moveHMM objects
moveData

Constructor of moveData objects
pseudoRes

Pseudo-residuals
logBeta

Backward log-probabilities
print.moveHMM

Print moveHMM
stateProbs

State probabilities
n2w

Scaling function: natural to working parameters.
summary.moveData

Summary moveData
predictTPM

Predict transition probabilities for new covariate values
trMatrix_rcpp

Transition probability matrix
prepData

Preprocessing of the tracking data
stationary

Stationary state probabilities
rvm

Sample from von Mises distribution
rwrpcauchy

Sample from wrapped Cauchy distribution
dlnorm_rcpp

Log-normal density function
allProbs

Matrix of all probabilities
CI

Confidence intervals
dexp_rcpp

Exponential density function
dvm

Density function of von Mises distribution
dvm_rcpp

Von Mises density function
AIC.moveHMM

AIC
dgamma_rcpp

Gamma density function
angleCI

Confidence intervals for angle parameters
dweibull_rcpp

Weibull density function
exGen

Example data simulation
getPalette

Discrete colour palette for states
getPlotData

Data to produce plots of fitted model
fitHMM

Fit an HMM to the data
logAlpha

Forward log-probabilities