This function creates the list used as the input for the stan
model.
Usage
make_data_sdm(
y,
time,
site,
z,
x,
.toggles,
.priors,
family = "gamma",
reorder = TRUE,
phi_hat = FALSE
)Arguments
- y
a
numeric vectorof species' densities.- time
an
vectorindicating the time point associated to each element ofy.- site
an
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.- .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.movement: 1 to allow for (adjacent) moviment; 0 for static.est_surv: 1 to estimate survival rates and 0 otherwise.ar_re: "rec" to incorporate an AR(1) process density. The only other accepted option is "none"
- .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 mean."lognormal_legacy"(default): 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.