A two-day workshop with `R`

and `Nimble`

**What**: This is a workshop on Bayesian inference of animal demography. Hopefully, you will learn about how to infer demographic parameters (e.g. survival, dispersal). Our hope is to provide you with what you need to go your own path. The event is free of charge, and video-recorded.

**For whom**: This is a workshop for ecologists. No previous experience with `Nimble`

or Bayesian statistics is assumed, but knowledge of `R`

is required.

**How**: Through a combination of lectures and live demonstrations, you will get acquainted with the Bayesian approach, MCMC methods and the `R`

`Nimble`

package to fit single-site, multi-site, multi-state and multi-event models to capture-recapture data within the hidden Markov modeling (HMM) framework.

**Who**: O. Gimenez

**When**: July 12-13, 2023

**Where**: València VIBASS

**Day 1**

- Welcoming words (9am-9:30am)
- Crash course on Bayesian statistics and MCMC algorithms (9:30am-11am)
- Free the modeler in you: Introduction to Nimble (11:30am-12:30pm)
- What you see is not what you get: Hidden Markov models and capture-recapture data (2pm-3:30pm)
- Dead or alive: Survival estimation - part 1 (4pm-5pm)

**Day 2**

- Dead or alive: Survival estimation - part 2 (9am-10:30am)
- On the move: Transition estimation (11am-12:30pm)
- Known knowns, unknown knowns and unknowns: Uncertainty in state assignment (2pm-3:30pm)
- Skip your coffee break: Speed up MCMC convergence (4pm-5pm)
- Take-home messages (5pm-5:30pm)

Install

`Nimble`

following these guidelines. Then run the following code in`R`

. If that runs without error, you’re all set. If not, please get in touch with us.`library(nimble) code <- nimbleCode({ y ~ dnorm(0,1) }) model <- nimbleModel(code) cModel <- compileNimble(model)`

Install the following

`R`

packages:`tidyverse`

,`MCMCvis`

,`here`

and`nimbleEcology`

. You can install them all at once by running the following code in`R`

:`install.packages(c("tidyverse", "MCMCvis", "here", "nimbleEcology"))`

- Add examples of sensitivity analyses.
- Make class number match name of live demos html and R scripts files.
- Add messages in the video recordings about typos in the slides.
- In Nimble code for multievent models, change observation matrix at first encounter omega.init into omega.firste to avoid confusion with vector of initial state probabilities.

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.