multimarkCJS {multimark} | R Documentation |
Fit open population survival models for capture-mark-recapture data consisting of multiple non-invasive marks
Description
This function fits Cormack-Jolly-Seber (CJS) open population models for survival probability (\phi
) and capture probability (p
) from capture-mark-recapture data consisting of multiple non-invasive marks. Using Bayesian analysis methods, Markov chain Monte Carlo (MCMC) is used to draw samples from the joint posterior distribution.
Usage
multimarkCJS(
Enc.Mat,
data.type = "never",
covs = data.frame(),
mms = NULL,
mod.p = ~1,
mod.phi = ~1,
mod.delta = ~type,
parms = c("pbeta", "phibeta", "delta"),
nchains = 1,
iter = 12000,
adapt = 1000,
bin = 50,
thin = 1,
burnin = 2000,
taccept = 0.44,
tuneadjust = 0.95,
proppbeta = 0.1,
propzp = 1,
propsigmap = 1,
propphibeta = 0.1,
propzphi = 1,
propsigmaphi = 1,
maxnumbasis = 1,
pbeta0 = 0,
pSigma0 = 1,
phibeta0 = 0,
phiSigma0 = 1,
l0p = 1,
d0p = 0.01,
l0phi = 1,
d0phi = 0.01,
a0delta = 1,
a0alpha = 1,
b0alpha = 1,
a0psi = 1,
b0psi = 1,
initial.values = NULL,
known = integer(),
link = "probit",
printlog = FALSE,
...
)
Arguments
Enc.Mat |
A matrix of observed encounter histories with rows corresponding to individuals and columns corresponding to sampling occasions (ignored unless |
data.type |
Specifies the encounter history data type. All data types include non-detections (type 0 encounter), type 1 encounter (e.g., left-side), and type 2 encounters (e.g., right-side). When both type 1 and type 2 encounters occur for the same individual within a sampling occasion, these can either be "non-simultaneous" (type 3 encounter) or "simultaneous" (type 4 encounter). Three data types are currently permitted:
|
covs |
A data frame of temporal covariates for detection probabilities (ignored unless |
mms |
An optional object of class |
mod.p |
Model formula for detection probability ( |
mod.phi |
Model formula for survival probability ( |
mod.delta |
Model formula for conditional probabilities of type 1 (delta_1) and type 2 (delta_2) encounters, given detection. Currently only |
parms |
A character vector giving the names of the parameters and latent variables to monitor. Possible parameters are probit-scale detection probability parameters (" |
nchains |
The number of parallel MCMC chains for the model. |
iter |
The number of MCMC iterations. |
adapt |
Ignored; no adaptive phase is needed for "probit" link. |
bin |
Ignored; no adaptive phase is needed for "probit" link. |
thin |
Thinning interval for monitored parameters. |
burnin |
Number of burn-in iterations ( |
taccept |
Ignored; no adaptive phase is needed for "probit" link. |
tuneadjust |
Ignored; no adaptive phase is needed for "probit" link. |
proppbeta |
Ignored; no adaptive phase is needed for "probit" link. |
propzp |
Ignored; no adaptive phase is needed for "probit" link. |
propsigmap |
Ignored; no adaptive phase is needed for "probit" link. |
propphibeta |
Ignored; no adaptive phase is needed for "probit" link. |
propzphi |
Ignored; no adaptive phase is needed for "probit" link. |
propsigmaphi |
Ignored; no adaptive phase is needed for "probit" link. |
maxnumbasis |
Maximum number of basis vectors to use when proposing latent history frequency updates. Default is |
pbeta0 |
Scaler or vector (of length k) specifying mean of pbeta ~ multivariateNormal(pbeta0, pSigma0) prior. If |
pSigma0 |
Scaler or k x k matrix specifying covariance matrix of pbeta ~ multivariateNormal(pbeta0, pSigma0) prior. If |
phibeta0 |
Scaler or vector (of length k) specifying mean of phibeta ~ multivariateNormal(phibeta0, phiSigma0) prior. If |
phiSigma0 |
Scaler or k x k matrix specifying covariance matrix of phibeta ~ multivariateNormal(phibeta0, phiSigma0) prior. If |
l0p |
Specifies "shape" parameter for [sigma2_zp] ~ invGamma(l0p,d0p) prior. Default is |
d0p |
Specifies "scale" parameter for [sigma2_zp] ~ invGamma(l0p,d0p) prior. Default is |
l0phi |
Specifies "shape" parameter for [sigma2_zphi] ~ invGamma(l0phi,d0phi) prior. Default is |
d0phi |
Specifies "scale" parameter for [sigma2_zphi] ~ invGamma(l0phi,d0phi) prior. Default is |
a0delta |
Scaler or vector (of length d) specifying the prior for the conditional (on detection) probability of type 1 (delta_1), type 2 (delta_2), and both type 1 and type 2 encounters (1-delta_1-delta_2). If |
a0alpha |
Specifies "shape1" parameter for [alpha] ~ Beta(a0alpha, b0alpha) prior. Only applicable when |
b0alpha |
Specifies "shape2" parameter for [alpha] ~ Beta(a0alpha, b0alpha) prior. Only applicable when |
a0psi |
Specifies "shape1" parameter for [psi] ~ Beta(a0psi,b0psi) prior. Default is |
b0psi |
Specifies "shape2" parameter for [psi] ~ Beta(a0psi,b0psi) prior. Default is |
initial.values |
Optional list of |
known |
Optional integer vector indicating whether the encounter history of an individual is known with certainty (i.e., the observed encounter history is the true encounter history). Encounter histories with at least one type 4 encounter are automatically assumed to be known, and |
link |
Link function for survival and capture probabilities. Only probit link is currently implemented. |
printlog |
Logical indicating whether to print the progress of chains and any errors to a log file in the working directory. Ignored when |
... |
Additional " |
Details
The first time multimarkCJS
(or multimarkClosed
) is called, it will likely produce a firewall warning alerting users that R has requested the ability to accept incoming network connections. Incoming network connections are required to use parallel processing as implemented in multimarkCJS
. Note that setting parms="all"
is required for any multimarkCJS
model output to be used in multimodelCJS
.
Value
A list containing the following:
mcmc |
Markov chain Monte Carlo object of class |
mod.p |
Model formula for detection probability (as specified by |
mod.phi |
Model formula for survival probability (as specified by |
mod.delta |
Formula always |
DM |
A list of design matrices for detection and survival probability respectively generated by |
initial.values |
A list containing the parameter and latent variable values at iteration |
mms |
An object of class |
Author(s)
Brett T. McClintock
References
Bonner, S. J., and Holmberg J. 2013. Mark-recapture with multiple, non-invasive marks. Biometrics 69: 766-775.
McClintock, B. T., Conn, P. B., Alonso, R. S., and Crooks, K. R. 2013. Integrated modeling of bilateral photo-identification data in mark-recapture analyses. Ecology 94: 1464-1471.
McClintock, B. T., Bailey, L. L., Dreher, B. P., and Link, W. A. 2014. Probit models for capture-recapture data subject to imperfect detection, individual heterogeneity and misidentification. The Annals of Applied Statistics 8: 2461-2484.
See Also
Examples
# This example is excluded from testing to reduce package check time
# Example uses unrealistically low values for nchain, iter, and burnin
#Simulate open population data using defaults
data <- simdataCJS()
#Fit default open population model
sim.dot <- multimarkCJS(data$Enc.Mat)
#Posterior summary for monitored parameters
summary(sim.dot$mcmc)
plot(sim.dot$mcmc)
#' #Fit ``age'' model with 2 age classes (e.g., juvenile and adult) for survival
#using 'parameters' and 'right' arguments from RMark::make.design.data
sim.age <- multimarkCJS(data$Enc.Mat,mod.phi=~age,
parameters=list(Phi=list(age.bins=c(0,1,4))),right=FALSE)
summary(getprobsCJS(sim.age))