Simulate a three-level occupancy + cover hurdle data set
Source:R/occu_multiscale_cover.R
simulate_occu_multiscale_cover.RdDraws cell occupancy z_c ~ Bernoulli(psi_c), plot availability
a_cj | z_c=1 ~ Bernoulli(theta_cj), visit detection
y_cjv | a_cj=1 ~ Bernoulli(p_cjv), and the cover hurdle
cover_cjv | y_cjv=1 ~ f_pos, with a shared areal ICAR field on the
occupancy (sigma) and cover (alpha * sigma) arms. The data-generating
process for occu_multiscale_cover() recovery tests.
Usage
simulate_occu_multiscale_cover(
n_cells = 60L,
plots_per_cell = 4L,
visits_per_plot = 2L,
beta_psi = c(0.4, 0.6),
beta_theta = c(0.2, 0.5),
beta_p = c(0, 0.5),
beta_pos = c(log(0.1), -0.4),
positive = c("lognormal", "beta", "gaussian"),
phi = 0.35,
adj = NULL,
sigma = 0.7,
alpha = 1,
trend = FALSE,
sigma_trend = 0.7,
alpha_trend = 1,
seed = NULL
)Arguments
- n_cells
number of areal cells (graph nodes).
- plots_per_cell
plots (the availability units) per cell.
- visits_per_plot
detection replicate visits per plot.
- beta_psi, beta_theta, beta_p, beta_pos
length-2
c(intercept, slope)coefficients for the four arms (one covariate each).- positive
"lognormal"or"beta"cover arm.- phi
cover dispersion (lognormal log-scale SD, or beta precision).
- adj
n_cells x n_cellsadjacency; default a 1-D chain.- sigma
areal-field marginal SD on the occupancy arm.
- alpha
cover-arm field scaling (
alpha * sigmaon the cover arm).- trend
add a second, spatially-varying-coefficient (SVC) areal field weighted per cell by a cell-level covariate
tcov(added todata):tcov_c * sigma_trend * f_trend[c]on occupancy andtcov_c * alpha_trend * sigma_trend * f_trend[c]on cover. DefaultFALSE.- sigma_trend, alpha_trend
trend-field marginal SD and its cover-arm scaling (used only when
trend = TRUE).- seed
optional RNG seed.
Value
A list with y, y_pos ([n_plots x visits_per_plot]), the
plot-level data (cell id cell, covariates), adj, and truth.
Examples
sim <- simulate_occu_multiscale_cover(n_cells = 10, plots_per_cell = 2,
visits_per_plot = 2, seed = 1)
dim(sim$y)