Conclusion

To wrap up this book, let me share a few pieces of advice. This is not rocket science, just some lessons I’ve picked up along the way from building hidden Markov models and analysing data with Bayesian statistics.

  • Make your ecological question explicit. First things first. Make sure you’ve spent some to time to make your ecological question explicit. This step will help you to stay on course, and make the right choices. For example, it’s fine to use subsets of your data to address different questions.

  • Now in terms of modeling. Think of observations and states first. Don’t jump on your keyboard right away. Spend some time thinking about your model with pen and paper. In particular make sure you have the observations and the states of your HMM. Then write down the observation and transition matrices on paper. Write down the transition matrix first. You may act as if you had no imperfect detection. This is really what you’re after, the ecological process (survival, dispersal, etc). Then proceed with the observation matrix.

  • When it comes to model fitting with NIMBLE, start simple, with all parameters constant for example. Make sure convergence is reached. Then add complexity one step at a time. Time effect for example, or random effects, or uncertainty in the assignment of states.

  • Consider doing simulations to better understand your model. When it comes to model building, consider simulating data to better understand your model. You will always learn something on your model by seeing it an engine to generate data, instead of estimating its parameters. The nice thing with NIMBLE is that you can use your model to simulate data.

  • Another advice, quite general in programming, is to not try to optimize your code or to try to make it elegant right away. Make your model work first, then think of optimization.

I hope to have convinced you that hidden Markov models combined with the Bayesian framework are very flexible to analyse capture-recapture data. With your data, you may ask a myriad of questions. The limit is your imagination (and CPU time).

To stimulate your imagination, I have assembled a searchable list at https://oliviergimenez.github.io/curated-list-of-HMM-CR-papers/ with HMM analyses of capture-recapture data for you to get inspiration. This list is not exhaustive, please get in touch with me if you’d like to add a reference.