huggins91UC {VGAM} | R Documentation |
Density, and random generation for the Huggins (1991) capture-recapture model.
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)
x |
response vector or matrix. Should have values of 0s or 1s. |
nTimePts |
Number of sampling occasions.
Called T in |
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 |
pvars |
Number of other numeric covariates that make up
the linear predictor.
Labelled |
xcoeff |
The regression coefficients of the linear predictor.
These correspond to |
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 caught before. |
log |
Logical. Return the logarithm of the answer? |
The form of the conditional likelihood is
described in huggins91
.
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.
These functions are experimental and do not follow the
usual conventions of d
- and r
-type R functions.
Thomas W. Yee
set.seed(123); rhuggins91(n = 10) set.seed(123); rhuggins91(n = 10, double.ch = TRUE) attributes(rhuggins91(n = 10))