## GENCAPH1

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

## Gencaph1

### Overview

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:

• Calculate bias in estimated parameters for incorrectly specified models,
• Calculate confidence-interval coverage,
• Compute model goodness-of-fit
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

• N(i) = Number of new animals introduced into the population just before time i
• φ(i) = survival rate from time i to i+1,
• θ(i) = tag-retention rate from age or time i to i+1
• p(i) = capture probability for unmarked animals in time i
• c(i) = capture probability for marked animals in time i
• f(i) = number of new individuals in time i per old individual in time i-1

### Input

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:
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<-''
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

#  create data-frame with 2 fields: ch (capture-histories) and freq (frequencies)
data<-data.frame(ch=a[,1],freq=as.numeric(a[,2]))

# create RMark processed data object...
pd<-process.data(data,model='CJS')

#  create formula for constant survival/capture probs
f1<-list(formula=~1)

#  run mark model, phi(.)p(.) - constant survival and capture probs
m1<-mark(data=pd,model.parameters=list(Phi=f1,p=f1))

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