markClosedSCR {multimark} | R Documentation |
Fit spatial population abundance models for “traditional” capture-mark-recapture data consisting of a single mark type
Description
This function fits spatial 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
markClosedSCR(
Enc.Mat,
trapCoords,
studyArea = NULL,
buffer = NULL,
ncells = 1024,
covs = data.frame(),
mod.p = ~1,
detection = "half-normal",
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,
propsigma = 1,
propcenter = NULL,
sigma_bounds = NULL,
mu0 = 0,
sigma2_mu0 = 1.75,
initial.values = NULL,
scalemax = 10,
printlog = FALSE,
...
)
Arguments
Enc.Mat |
A matrix containing the observed encounter histories with rows corresponding to individuals and ( |
trapCoords |
A matrix of dimension |
studyArea |
is a 3-column matrix containing the coordinates for the centroids a contiguous grid of cells that define the study area and available habitat. Each row corresponds to a grid cell. The first 2 columns (“x” and “y”) indicate the Cartesian x- and y-coordinate for the centroid of each grid cell, and the third column (“avail”) indicates whether the cell is available habitat (=1) or not (=0). All cells must have the same resolution. If |
buffer |
A scaler in same units as |
ncells |
The number of grid cells in the study area when |
covs |
A data frame of time- and/or trap-dependent covariates for detection probabilities (ignored unless |
mod.p |
Model formula for detection probability. For example, |
detection |
Model for detection probability as a function of distance from activity centers . Must be " |
parms |
A character vector giving the names of the parameters and latent variables to monitor. Possible parameters are cloglog-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 |
propsigma |
Scaler specifying the initial Gamma(shape = 1/ |
propcenter |
Scaler specifying the neighborhood distance when proposing updates to activity centers. When |
sigma_bounds |
Positive vector of length 2 for the lower and upper bounds for the [sigma_scr] ~ Uniform(sigma_bounds[1], sigma_bounds[2]) (or [sqrt(lambda)] when |
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 |
scalemax |
Upper bound for internal re-scaling of grid cell centroid coordinates. Default is |
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 markClosedSCR
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 |
mod.det |
Model formula for detection function (as specified by |
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
References
Gopalaswamy, A.M., Royle, J.A., Hines, J.E., Singh, P., Jathanna, D., Kumar, N. and Karanth, K.U. 2012. Program SPACECAP: software for estimating animal density using spatially explicit capture-recapture models. Methods in Ecology and Evolution 3:1067-1072.
King, R., McClintock, B. T., Kidney, D., and Borchers, D. L. 2016. Capture-recapture abundance estimation using a semi-complete data likelihood approach. The Annals of Applied Statistics 10: 264-285
Royle, J.A., Karanth, K.U., Gopalaswamy, A.M. and Kumar, N.S. 2009. Bayesian inference in camera trapping studies for a class of spatial capture-recapture models. Ecology 90: 3233-3244.
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 ``traditional'' tiger data of Royle et al (2009)
Enc.Mat<-tiger$Enc.Mat
trapCoords<-tiger$trapCoords
studyArea<-tiger$studyArea
tiger.dot<-markClosedSCR(Enc.Mat,trapCoords,studyArea,iter=100,adapt=50,burnin=50)
#Posterior summary for monitored parameters
summary(tiger.dot$mcmc)
plot(tiger.dot$mcmc)