markClosed {multimark} | R Documentation |
Fit closed population abundance models for “traditional” capture-mark-recapture data consisting of a single mark type
Description
This function fits closed population abundance models for “traditional” capture-mark-recapture data consisting of a single mark type using Bayesian analysis methods. Markov chain Monte Carlo (MCMC) is used to draw samples from the joint posterior distribution.
Usage
markClosed(
Enc.Mat,
covs = data.frame(),
mod.p = ~1,
parms = c("pbeta", "N"),
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,
npoints = 500,
a = 25,
mu0 = 0,
sigma2_mu0 = 1.75,
initial.values = NULL,
printlog = FALSE,
...
)
Arguments
Enc.Mat |
A matrix of observed encounter histories with rows corresponding to individuals and columns corresponding to sampling occasions. With a single mark type, encounter histories consist of only non-detections (0) and type 1 encounters (1). |
covs |
A data frame of temporal covariates for detection probabilities (ignored unless |
mod.p |
Model formula for detection probability. For example, |
parms |
A character vector giving the names of the parameters and latent variables to monitor. Possible parameters are logit-scale detection probability parameters (" |
nchains |
The number of parallel MCMC chains for the model. |
iter |
The number of MCMC iterations. |
adapt |
The number of iterations for proposal distribution adaptation. If |
bin |
Bin length for calculating acceptance rates during adaptive phase ( |
thin |
Thinning interval for monitored parameters. |
burnin |
Number of burn-in iterations ( |
taccept |
Target acceptance rate during adaptive phase ( |
tuneadjust |
Adjustment term during adaptive phase ( |
proppbeta |
Scaler or vector (of length k) specifying the initial standard deviation of the Normal(pbeta[j], proppbeta[j]) proposal distribution. If |
propzp |
Scaler or vector (of length M) specifying the initial standard deviation of the Normal(zp[i], propzp[i]) proposal distribution. If |
propsigmap |
Scaler specifying the initial Gamma(shape = 1/ |
npoints |
Number of Gauss-Hermite quadrature points to use for numerical integration. Accuracy increases with number of points, but so does computation time. |
a |
Scale parameter for [sigma_z] ~ half-Cauchy(a) prior for the individual hetegeneity term sigma_zp = sqrt(sigma2_zp). Default is “uninformative” |
mu0 |
Scaler or vector (of length k) specifying mean of pbeta[j] ~ Normal(mu0[j], sigma2_mu0[j]) prior. If |
sigma2_mu0 |
Scaler or vector (of length k) specifying variance of pbeta[j] ~ Normal(mu0[j], sigma2_mu0[j]) prior. If |
initial.values |
Optional list of |
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 markClosed
(or markCJS
) 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 markClosed
. Note that setting parms="all"
is required for any markClosed
model output to be used in multimodelClosed
.
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.delta |
Formula always |
DM |
A list of design matrices for detection probability generated for model |
initial.values |
A list containing the parameter and latent variable values at iteration |
mms |
An object of class |
Author(s)
Brett T. McClintock
See Also
Examples
# This example is excluded from testing to reduce package check time
# Example uses unrealistically low values for nchain, iter, and burnin
#Run single chain using the default model for simulated ``traditional'' data
data<-simdataClosed(delta_1=1,delta_2=0)$Enc.Mat
sim.dot<-markClosed(data)
#Posterior summary for monitored parameters
summary(sim.dot$mcmc)
plot(sim.dot$mcmc)