Bayesian SCR {wiqid} | R Documentation |
Spatially explicit capture-recapture (secr) density estimation using MCMC
Description
Functions to estimate density from mark-recapture data using MCMC methods and JAGS.
Usage
Bsecr0(capthist, buffer = 100, start = NULL, nAug = NA, maxSig = 2*buffer,
chains=3, draws=1e4, burnin=0, thin=1, adapt=1000,
priorOnly=FALSE, parallel=NULL, seed=NULL, ...)
Arguments
capthist |
a |
buffer |
scalar mask buffer radius (default 100 m) |
start |
an optional object of class |
nAug |
number of individuals in the augmented population; if NA, a suitable default is chosen based on the object passed to |
maxSig |
maximum value for the scale parameter of the detection function: the prior is Uniform(0, maxSig). |
chains |
the number of Markov chains to run. |
draws |
the total number of values to return. The number of values calculated per chain is |
burnin |
the number of values to discard at the beginning of each chain. |
thin |
the thinning rate. If set to n > 1, n values are calculated for each value returned. |
adapt |
the number of iterations to run in the JAGS adaptive phase. |
priorOnly |
if TRUE, the function produces random draws from the appropriate prior distributions, with a warning. |
seed |
set a seed for the random number generators. |
parallel |
if TRUE or NULL and sufficient cores are available, the MCMC chains are run in parallel; if TRUE and insufficient cores are available, a warning is given. |
... |
other arguments to pass to the function. |
Details
Bsecr0
implements an intercept-only model (D ~ 1, g0 ~ 1, sigma ~ 1).
Value
Returns an object of class Bwiqid
, data frame with one column for each parameter, ie. D, lam0 and sigma.
There are print, plot, and window methods for Bwiqid
.
Author(s)
Mike Meredith
References
Borchers & Efford (2008) Spatially explicit maximum likelihood methods for capture-recapture studies Biometrics 64, 377-385
Royle & Dorazio (2008) Hierarchical Modeling and Inference in Ecology. Academic Press
See Also
The function secr.fit
in package secr
.
Examples
if(requireNamespace("secr") && requireNamespace("rjags")) {
# The stoats data set in 'secr'
data(stoatDNA, package="secr")
# This takes ca 10 mins on a multicore machine:
Bout <- Bsecr0(stoatCH, buffer=1000, chains=2) # 2 chains for testing
summary(Bout)
plot(Bout)
# look at diagnostic plots to see if D is constrained by nAug:
diagPlot(Bout) # Upper values of D doesn't look constrained.
plotACs(Bout, 1:20) # Plot the ACs for captured animals
}