Simulate a multi-species co-occurrence occupancy data set
Source:R/occu_multi.R
simulate_occu_multi.RdDraws from the occu_multi() model: a joint occupancy state for S species
from the log-linear (first + second order) occupancy model, then per-species
site-level detections at the observed visit pattern.
Usage
simulate_occu_multi(
S = 2,
N = 300,
J = 4,
n_state_covs = 1,
beta_first = NULL,
beta_second = NULL,
beta_p = NULL,
seed = NULL
)Arguments
- S
Number of species (default 2).
- N
Number of sites (default 300).
- J
Number of replicate visits (default 4).
- n_state_covs
Number of shared occupancy covariates (default 1).
- beta_first
Length-
Slist of first-order natural-parameter coefficientsc(intercept, slopes...). Default moderate occupancy.- beta_second
Length-
choose(S, 2)list of second-order (interaction) coefficients (incombn(S, 2)order). Default a single positive interaction forS = 2, else 0.- beta_p
Length-
Slist of detection coefficients (logit). Defaultc(qlogis(0.5), ...).- seed
Optional random seed.
Examples
sim <- simulate_occu_multi(S = 2, N = 50, J = 3, seed = 1)
length(sim$y)