- occ.formula
a symbolic description of the model to be fit
for the occurrence portion of the model using R's model syntax. Only
right-hand side of formula is specified. See example below. Random intercepts
are allowed using lme4 syntax (Bates et al. 2015).
- det.formula
a symbolic description of the model to be fit
for the detection portion of the model using R's model syntax. Only
right-hand side of formula is specified. See example below. Random intercepts
are allowed using lme4 syntax (Bates et al. 2015).
- data
a list containing data necessary for model fitting.
Valid tags are y
, occ.covs
, and det.covs
. y
is a matrix or data frame with first dimension equal to the number of
sites (\(J\)) and second dimension equal to the maximum number of
replicates at a given site. occ.covs
is a matrix or data frame
containing the variables used in the occurrence portion of the model, with
\(J\) rows for each column (variable). det.covs
is a list of
variables included in the detection portion of the model. Each list element
is a different detection covariate, which can be site-level or
observational-level. Site-level covariates are specified as a vector
of length \(J\) while observation-level covariates are specified
as a matrix or data frame with the number of rows equal to \(J\) and
number of columns equal to the maximum number of replicates at a given site.
- inits
a list with each tag corresponding to a parameter name.
Valid tags are z
, beta
, alpha
, sigma.sq.psi
,
and sigma.sq.p
. The value portion of each tag is the
parameter's initial value. sigma.sq.psi
and sigma.sq.p
are
only relevant when including random effects in the occurrence and
detection portion of the occupancy model, respectively. See priors
description for definition of each parameter name.
Additionally, the tag fix
can be set to TRUE
to fix the starting values across all chains. If fix
is not specified
(the default), starting values are varied randomly across chains.
- priors
a list with each tag corresponding to a parameter name.
Valid tags are beta.normal
, alpha.normal
, sigma.sq.psi.ig
,
and sigma.sq.p.ig
. Occupancy (beta
) and detection (alpha
)
regression coefficients are assumed to follow a normal distribution.
The hyperparameters of the normal distribution are passed as a list of
length two with the first and second elements corresponding to the mean
and variance of the normal distribution, which are each specified as vectors of
length equal to the number of coefficients to be estimated or of length one
if priors are the same for all coefficients. If not specified, prior means
are set to 0 and prior variances set to 2.72. sigma.sq.psi
and
sigma.sq.p
are the random effect variances for any occurrence or
detection random effects, respectively, and are assumed to follow an inverse
Gamma distribution. The hyperparameters of the inverse-Gamma distribution
are passed as a list of length two with first and second elements corresponding
to the shape and scale parameters, respectively, which are each specified as
vectors of length equal to the number of random intercepts or of length one
if priors are the same for all random effect variances.
- n.samples
the number of posterior samples to collect in each chain.
- n.omp.threads
a positive integer indicating the number of threads
to use for SMP parallel processing within-chains. This will have no impact
on model run time for non-spatial models. The package must be compiled for
OpenMP support. For most Intel-based machines, we recommend setting
n.omp.threads
up to the number of hypterthreaded cores. Note,
n.omp.threads
> 1 might not work on some systems. Currently only
relevant for spatial models.
- verbose
if TRUE
, messages about data preparation,
model specification, and progress of the sampler are printed to the screen.
Otherwise, no messages are printed.
- n.report
the interval to report MCMC progress.
- n.burn
the number of samples out of the total n.samples
to
discard as burn-in for each chain. By default, the first 10% of samples is discarded.
- n.thin
the thinning interval for collection of MCMC samples. The
thinning occurs after the n.burn
samples are discarded. Default
value is set to 1.
- n.chains
the number of chains to run.
- k.fold
specifies the number of k folds for cross-validation.
If not specified as an argument, then cross-validation is not performed
and k.fold.threads
and k.fold.seed
are ignored. In k-fold
cross-validation, the data specified in data
is randomly
partitioned into k equal sized subsamples. Of the k subsamples,
k - 1 subsamples are used to fit the model and the remaining k
samples are used for prediction. The cross-validation process is repeated
k times (the folds). As a scoring rule, we use the model deviance
as described in Hooten and Hobbs (2015). Cross-validation is performed
after the full model is fit using all the data. Cross-validation results
are reported in the k.fold.deviance
object in the return list.
- k.fold.threads
number of threads to use for cross-validation. If
k.fold.threads > 1
parallel processing is accomplished using the
foreach and doParallel packages. Ignored if k.fold
is not specified.
- k.fold.seed
seed used to split data set into k.fold
parts
for k-fold cross-validation. Ignored if k.fold
is not specified.
- k.fold.only
a logical value indicating whether to only perform
cross-validation (TRUE
) or perform cross-validation after fitting
the full model (FALSE
). Default value is FALSE
.
- ...
currently no additional arguments