Code to simulate common data structures in R and perform MLE from simulated data
Below we are providing links to R code that will simulate data from several of the data structures and models we use in class, and then run these through one of our estimation procedures (RMark, unmarked, SightabilityModel, SECR, etc). Code in some cases is my own, more often adapted from Kery and Schaub; code for SECR data is from that package by Efford using his built-in function. These are the stripped down versions, designed for specific cases and only to simulate and estimate a single data set. Several of these are written as user-defined functions, but a few are still "loose code" meaning I haven't had the chance to organize them sensibly into a function.
In other places on the site we will see these or very similar code as part of more general code , e.g., parametric bootstrapping for goodness of fit or simulation trials for sample size estimation.
Sightability Model
Single-season occupancy
Multi-season occupancy
Distance sampling
Closed CMR
Spatially Explicit CMR (SECR)
Open CMR (CJS)
Open CMR (JS)
Joint Live Recapture/ Dead Recovery (also outputs dead only (band/ring recovery) and live only (CJS) data
Known Fates data (simulated as special case of Joint Live- Dead)
Known Fates with an individual covariate (Julian date example)
Robust Design for estimating abundance, survival, and recruitment