Generates capture-history data for given survival rates and capture probabilities.

Run GENCAPH1 online



This program generates capture-histories of a virtual population of animals with given survival and capture probabilities. Output from this program includes all observable capture-histories, along with the number of animals which exhibited each history. This output may be used as input to other programs (like MARK, CAPTURE, JOLLY) to compute estimates of survival, capture probabilities, or population size.

Uses of this program include:

Here's how it works:
The expected numbers of animals exhibiting each capture history are computed using a recursive algorithm. The algorithm follows a population of animals, exposing them to capture and survival until death or the end of the study, while saving a vector of codes (0=not captured, 1=captured) indicating capture history. The process is repeated for each cohort of injected animals in capture occasions after the first.

There are two modes of operation of the program - Deterministic and Stochastic. Under deterministic mode, the number of animals is retained throughout the process as a fractional number and is multiplied by the parameters to get the final number of animals with each capture-history. This results in two things: capture-history frequencies are not integers, and parameter estimates will match input parameters exactly (almost). In stochastic mode, the number of animals is achieved via a simulation function (binomial) on the parameters. In this mode, the number of animals with each capture-history will be integers, and the data (and resulting estimates) will be different for each program run.

Terminology and Notation for Input Data


Enter input parameters in boxes below. Not all boxes need to be filled in. See the example buttons at the bottom of the page for minimum input for various cases.

number of years(K):
number new animals N(i):
survival rates φ(i):
capture rates p(i):
recapture rates c(i):
tag retention rate θ(i):
theta age-specific
theta time-specific

Capture-history generation options: Determinsitic(expected values) Stochastic(simulated values)
Recruitment options: In addition to (or instead of) adding new animals using the N(i)'s above, new animals may be added before each sampling occasion using one of the following functions: None binomial normal

Sample R/RMark code to analyze generated data

#  load output from gencaph1 into char variable, 'a'
a<-unlist(strsplit(unlist(strsplit(a,'\n')),' ')) #  split into separate fields
a<-matrix(a,ncol=2,byrow=T)  #  format as a matrix with 2 columns

library(RMark)        #  Load RMark package

#  create data-frame with 2 fields: ch (capture-histories) and freq (frequencies)

# create RMark processed data object...

#  create formula for constant survival/capture probs

#  run mark model, phi(.)p(.) - constant survival and capture probs

#  output of phi and p should match Gencaph1 input parameters if 
#   expected values option was selected