Capture-recapture in R
Every capture-recapture model is built on one idea: the animals you catch twice tell you about the animals you never catch at all. If marks come back often, you have caught much of the population. If they rarely do, there is more out there than you have seen. Everything else, a century of it, is that idea made precise under conditions where animals die, arrive, move, hide, and differ from one another.
This page collects every capture-recapture tutorial on this site. All of them build the likelihood by hand in base R, so the assumption that carries the estimate is visible in the code rather than buried in a package.
Closed, open, and why the word matters
A closed population does not change while you work: no births, no deaths, no movement in or out. That assumption is what lets a handful of occasions produce an abundance figure. It is also why closed models want a short study, and why the word “closed” should make you check the calendar before it makes you check the code.
Open models let animals die and arrive between occasions, which is honest but costs you something specific. The Cormack-Jolly-Seber model, the workhorse of open-population work, conditions on first capture and returns apparent survival: an animal that leaves for good is indistinguishable from one that died. That is not a bug to be fixed, it is the price of conditioning, and it is why abundance and recruitment need a superpopulation layer on top rather than a different likelihood underneath.
The recurring villain
Individual heterogeneity in capture probability is the thing that ruins capture-recapture estimates, and it does so quietly. Animals differ in how catchable they are; the catchable ones fill your marked sample; the population looks smaller than it is. Every serious model on this page either handles it, absorbs it into a parameter that then means something else, or fails a goodness-of-fit test that has little power against it. Sometimes heterogeneity leaves the point estimate almost alone and destroys the interval instead, which is worse, because the number looks fine.
The second recurring theme is that better design beats better likelihood. The robust design is the clearest case: closed periods nested inside an open study, which is a calendar change rather than a modelling trick, and it identifies parameters no amount of cleverness recovers from a badly spaced study.
Where the space comes in
Non-spatial models give you a number of animals, but not a density, because they do not know the area you sampled. Spatial capture-recapture fixes that by modelling where each animal lives: a latent activity centre per individual, a detection function that falls off with distance from it, and density as a parameter rather than a division at the end. It also turns trap spacing into a design question with an answer, since traps too far apart never record the spatial recaptures the model runs on.
The tutorials
Closed populations
- Closed-population capture-recapture - Lincoln-Petersen, Schnabel and the M0 likelihood from scratch.
- Bayesian closed capture-recapture - parameter-expanded data augmentation, and a posterior for the animals never seen.
Open populations: survival first
- Cormack-Jolly-Seber survival models - the m-array and the likelihood that separates survival from recapture.
- Bayesian Cormack-Jolly-Seber survival - the same model with a latent alive-state, sampled by hand.
Open populations: abundance and growth
- Jolly-Seber and POPAN - the superpopulation layer that turns survival into abundance, and where every new number comes from.
- Pradel seniority - the same likelihood on reversed histories, giving a growth rate without counting anything.
- The robust design and temporary emigration - closed inside, open between, and the parameter that absorbs the damage.
- Checking an open-population model - what a goodness-of-fit test on the m-array leaves out.
States, sites and uncertain reads
- Multi-state capture-recapture - the Arnason-Schwarz model as a hidden Markov likelihood.
- Estimating transition probabilities - movement between states, and the detection gap that imitates it.
- Multi-event models for uncertain states - an observation layer for states recorded with error.
- Checking multi-state models - a bootstrap test that exposes the memory the model absorbs.
Space: where the animals live
- Spatial capture-recapture from scratch - a full-likelihood SCR model with latent activity centres, and why density needs one.
- Bayesian spatial capture-recapture - the same model by data augmentation, with posteriors for density.
- SCR sampling design and precision - trap spacing against sigma, and the precision curve it produces.
- Detection covariates and checking in SCR - effort on the detection function, and the fit test a constant-detection model fails.
Marks you do not recapture
- Mark resight abundance estimation - marked animals counted from a distance, where heterogeneity leaves the estimate alone and wrecks the interval.
Where this connects
- Removal and depletion sampling estimates a closed population from declining catches, with no marks at all.
- Integrated population models join capture-recapture with counts and productivity data in one likelihood.
- Kaplan-Meier survival curves and Cox proportional hazards are the time-to-event route to survival, for the cases where detection is not the problem.
- Occupancy modelling in R is the same detection logic when individuals are not marked.
- Movement ecology in R asks where the animal lives from a tag rather than from a trap array.
- Population models in R is where survival and recruitment estimates end up.