This function creates the list used as the input for the stan
model.
Usage
make_data_sdm(
y,
time,
site,
z,
x,
adj_mat = matrix(0, ncol = 1, nrow = 1),
.toggles,
.priors,
family = "gamma",
reorder = TRUE,
phi_hat = FALSE
)Arguments
- y
a
numeric vectorof species' densities.- time
a
vectorindicating the time point associated to each element ofy.- site
a
vectorindicating the sites associated to each element ofy.- z
a design
matrixof variables associated to the probability of absence at each site/time.- x
a design
matrixof variables associated to the non-zero densities.- adj_mat
an adjacency
matrixof dimensionssites\(\times\)sites. Its elements are 1 if two sites are neighbors and zero otherwise.- .toggles
a
listof toggles for model components. The components are:cloglog: 1 to use the complementary log-log and 0 for the logit link function for the absence probabilities.ar_re: 1 to incorporate an AR(1) process to density and 0 otherwise.iid_re: 1 to incorporate a site specific IID random effect to density and 0 otherwise.sp_re: 1 to incorporate a site specific ICAR random effect to density and 0 otherwise.
- .priors
a
listof priors hyperparameters.- family
a
characterspecifying the family of the probability distribution assumed for density. The options are:"gamma"(default): gamma parametrized in terms of its mean;"lognormal": log-normal parametrized in terms of its mean;"loglogistic": log-logistic parametrized in terms of its median (usual parametrization);"lognormal_legacy": log-normal with its usual parametrization;
- reorder
a
booleantelling whether the data needs to be reordered. The default is TRUE and means the data points will be ordered by site and time, respectively.- phi_hat
a
booleanindicating whether the prior onphishould be determined through the data (usingget_phi_hat()).
