Learn R Programming

VGAM (version 0.8-3)

huggins91UC: Huggins (1991) Capture-recapture Model

Description

Density, and random generation for the Huggins (1991) capture-recapture model.

Usage

rhuggins91(n, nTimePts = 5, pvars = length(xcoeff), xcoeff = c(-2, 1, 2),
           capeffect = -1, double.ch = FALSE,
           link = "logit", earg = list())
dhuggins91(x, prob, prob0 = prob, log = FALSE)

Arguments

x
response vector or matrix. Should have values of 0s or 1s.
nTimePts
Number of sampling occasions. Called $T$ in huggins91.
n
number of observations. Usually a single positive integer, else the length of the vector is used.
capeffect
Numeric, the capture effect. Added to the linear predictor if captured previously. A positive or negative value corresponds to a trap-happy and trap-shy effect respectively.
double.ch
Logical. If TRUE then the values of ch0, ch1, ...are 2 or 0, else 1 or 0. Setting this argument TRUE means that a model can be fitted with half the capture history in both denominator and numerat
pvars
Number of other numeric covariates that make up the linear predictor. Labelled x1, x2, ..., where the first is an intercept, and the others are independent standard runif<
xcoeff
The regression coefficients of the linear predictor. These correspond to x1, x2, ..., and the first is for the intercept. The length of xcoeff must be at least pvars.
link, earg
Used to generate the probabilities for capture at each occasion.
prob, prob0
Matrix of probabilities for the numerator and denominators respectively. The default does not correspond to the Huggins (1991) model since the denominator should be free of any capture history, i.e., as if it had never been ca
log
Logical. Return the logarithm of the answer?

Value

  • dhuggins91 gives the density, rhuggins91 returns a data frame with some attributes. The function generates random deviates ($T$ columns labelled y1, y2, ...) for the response. Some indicator columns are also included (those starting with ch are for previous capture history, and those starting with z are zero), and these are useful for the xij argument.

Details

The form of the conditional likelihood is described in huggins91.

See Also

huggins91.

Examples

Run this code
set.seed(123); rhuggins91(n = 10)
set.seed(123); rhuggins91(n = 10, double.ch = TRUE)
attributes(rhuggins91(n = 10))

Run the code above in your browser using DataLab