Description Usage Arguments Details Value Examples
View source: R/MSMocc_functions.R
This function simulates data from he multi-species, misclassification count occupancy model first developed by Wright et al. (2020).
1 2 3 4 5 6 7 8 9 10 11 |
K |
number of species |
M |
number of sites |
M.conf |
number of sites that have confirmed observations |
max_j |
maximum number of visits to each site. If |
beta_psi |
vector of regression coefficients used to generate psi |
beta_lambda |
vector of regression coefficients used to generate lambda |
theta |
confusion matrix for automatic call classifications. Rows of theta should sum to one, diagonal elements are correct identification probabilities, first row corresponds to probabilities for calls truly from species 1. |
seed |
optional seed for reproducibility |
rand_visits |
logical; should each site be visited a random number of times? See details. |
This function simulates data from the single season, multiple
species occupancy model to estimate occupancy and relative activity for multiple species simultaneously. If rand_visits = TRUE
, each site is visited a random number of times between two and
max_j
. Covariates are drawn from the uniform(0, 1.5) distribution so
that the effect of the direction of each regression coefficient is
intuitive. Note that if covariates are not desired, beta_psi
and
beta_lambda
can be set to intercepts that generate the desired derived
probabilities.
object of class list
containing the following elements:
beta_psi
vector of regression coefficients used to generate psi
beta_lambda
vector of regression coefficients used to generate lambda
psi_cov
matrix of site level covariates
lambda_cov
array of detection level covariates; each slice represents a
single covariate
psi
vector of derived site level occupancy probabilities
lambda
matrix of derived visit level expected count detection parameter
z
matrix of latent occupancy states for each site/species
Y
array of observed Bernoulli responses for site/visit/species
n_visits
vector of number of visits to each site
c.conf
how calls confirmed to species K were classified for confirmed visits
c.sum.a
and c.sum.b
unconfirmed calls classified TO species K from sites with some confirmations ("a") or no confirmations ("b")
sites.conf
site locations with confirmations
sites.unconf.a
and sites.unconf.b
site locations without confirmations ("a" indecates some observations at these sites were confirmed, "b" sites had no confirmations)
data
a data frame containing all information necessary to fit the
model
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | n.species <- 4
sim <- sim_MSMocc(K = n.species, M = 100, M.conf = 10, max_j = 20,
beta_psi = matrix(c(0, 1,
0, 1.1,
0, 1.2,
0, 1.3),
ncol = n.species),
beta_lambda = matrix(c(0, 1, 1,
0, 1, 1,
0, 1, 1.2,
0, 1, 1.4),
ncol = n.species),
theta = matrix(c(0.7, 0.1, 0.1, 0.1,
0.1, 0.7, 0.1, 0.1,
0.1, 0.1, 0.7, 0.1,
0.1, 0.1, 0.1, 0.7), nrow = n.species),
rand_visits = TRUE)
sim$Y
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.