Bayesian capture-recapture inference with hidden Markov models

A half-a-day workshop with R and Nimble

The hidden Markov modelling (HMM) framework has gained much attention in the ecological literature over the last decade, and has been suggested as a general modelling framework for the demography of plant and animal populations. In particular, HMMs are increasingly used to analyse capture-recapture data and estimate key population parameters (e.g., survival, dispersal, recruitment or abundance) with applications in all fields of ecology.

In parallel, Bayesian statistics is relatively well established in ecology and related disciplines, because it resonates with scientific reasoning and allows accommodating uncertainty smoothly. The popularity of Bayesian statistics also comes from the availability of free pieces of software that allow practitioners to code their own analyses.

In this half-a-day workshop, we offer a Bayesian treatment of HMMs applied to capture-recapture data. Through a combination of lectures, real case studies and live demonstrations, you will get acquainted with multi-site, multi-state and multi-event capture-recapture models.

We will use the R Nimble package that is seen by many as the future of ecological data modelling because it i) helps overcome computational limitations that ecologists are faced with when dealing with complex models and/or big data, and iii) provides samplers that can deal with discrete latent states that are typical of capture-recapture data analysis.

You may check a longer version of this workshop here. A book is also on its way, you may check the online version there.

Who: Olivier Gimenez, Daniel Turek

When: Sunday, 26 June 2022

Where: Online


All times are Cape Town/Paris time UTC+2. The video recording of the workshop is available at

  1. Welcoming words (Olivier)
  2. What you see is not what you get: Hidden Markov models and capture-recapture data (Olivier)
  3. On the move: Transition estimation (Daniel)
  4. Known knowns, unknown knowns and unknowns: Uncertainty in state assignment (Olivier)
  5. Skip your coffee break: Speed up MCMC convergence (Daniel)
  6. Conclusions, take-home messages and recommendations (Olivier)



Text and figures are licensed under Creative Commons Attribution CC BY 4.0. Any computer code (R, HTML, CSS, etc.) in slides and worksheets, including in slide and worksheet sources, is also licensed under MIT.


If you see mistakes or want to suggest changes, please create an issue on the source repository.