Description Usage Arguments Details Value Examples
View source: R/occ_functions.R
This function simulates data from the single species, single season occupancy model first developed by MacKenzie et al. (2002).
| 1 2 3 4 5 6 7 8 | 
| M | number of sites | 
| max_j | maximum number of visits to each site. If  | 
| beta_psi | vector of regression coefficients used to generate psi | 
| beta_p | vector of regression coefficients used to generate p | 
| 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 vanilla single season, single
species occupancy model using the logit link function. 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_p 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_p vector of regression coefficients used to generate p
psi_cov matrix of site level covariates
p_cov array of detection level covariates; each slice represents a
single covariate
psi vector of derived site level occupancy probabilities
p matrix of derived visit level detection probabilities
z vector of latent occupancy states for each site
Y matrix of observed Bernoulli responses
n_visits vector of number of visits to each site
data a data frame containing all information necessary to fit the
model
| 1 2 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.