Here I provide R codes to fit multievent capture-recapture models (Pradel et al. 2005). Multievent models are hidden Markov models that are helpful in lots of situations to analyse capture-recapture data (see this list of applications for example).
I show how to obtain maximum-likelihood estimates using R and Bayesian estimates using Nimble and JAGS. Two examples are considered. First a simple Cormack-Jolly-Seber model is illustrated with the classical Dipper dataset (Pradel 2005; Gimenez et al. 2007). Second, a multistate model with uncertainty in the state assignement is illustrated with a dataset on Sooty shearwaters (Pradel 2005; Gimenez et al. 2012).
cjs_nimble.R
: Bayesian fitting using R and Nimblecjs_jags.R
: Bayesian fitting using R and JAGScjs_R.R
: maximum-likelihood fitting using Rdipper.txt
: the Dipper dataset
uncertainty_nimble.R
: Bayesian fitting using R and Nimbleuncertainty_jags.R
: Bayesian fitting using R and JAGSuncertainty_R.R
: maximum-likelihood fitting using Rtitis2.txt
: the Sooty shearwater dataset
Gimenez, O., Lebreton, J.-D., Gaillard, J.-M., Choquet, R. and R. Pradel (2012). Estimating demographic parameters using hidden process dynamic models. Theoretical Population Biology 82: 307-316.
Gimenez, O., V. Rossi, R. Choquet, C. Dehais, B. Doris, H. Varella, J.-P. Vila and R. Pradel (2007). State-space modelling of data on marked individuals. Ecological Modelling 206: 431-438.
Pradel, R. (2005). Multievent: an extension of multistate capture–recapture models to uncertain states. Biometrics 61: 442–447.