This function creates the list used as the input for the stan
model.
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.- init_data
an optional vector (of lengh n_ages - 1) to initialize the population dynamics.
- f_mort
an optional
matrixinforming the instantaneous fishing mortality rates at each age (columns) and timepoint (rows).- m
a
numericvalue corresponding to the instantaneous natural mortality rate. The default value for this is-log(.7), as it implies a survival rate of 0.70 between age classes.- x_t
a design
matrixof variables associated to the probability of absence at each site/time.- x_m
a design
matrixof variables associated to survival.- x_r
a design
matrixof variables associated to recruitment.- n_ages
an
integerindicating the number of ages for the underlying population dynamic model.- age_selectivity
an
numeric vectorwithn_ageselements, where each element indicates the selectivity of a respective age. All the elements of this vector must lie between 0 and 1.- ages_movement
An
integeror anumeric vectorspecifying the ages at which individuals of the focal species are assumed to move. Ifages_movementis an integer, individuals younger than this age are considered static (non-moving). Ifages_movementis a numeric vector of lengthn_ages, it indicates movement capability for each age group. A value of0indicates the corresponding age group is static, while1indicates movement is allowed. For example,c(0, 0, 1, 1, 0)specifies that age groups 1, 2, and 5 are static, while 3 and 4 are mobile.- 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:rho_mu: 1 to use explicitly relates rho to mu and 0 otherwise.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 mortality and 0 otherwise.est_init: 1 to estimate initial values for lambda and 0 otherwise.minit: 1 to use mortality to estimate initial age classes and 0 otherwise.ar_re: acharacter. It assumes one of the following values: "none" - no AR, "rec" AR(1) for recruitment, "surv" - AR(1) for survival (only works whenest_survis on), "dens" - AR(1) for density.iid_re: acharacter. It assumes one of the following values: "none" - no iid re, "rec" iid re for recruitment, "surv" - iir re for survival (only works whenest_survis on), "dens" - iid_re for density.sp_re: acharacter. It assumes one of the following values: "none" - no ICAR re, "rec" ICAR re for recruitment, "surv" - ICAR re for survival (only works whenest_survis on), "dens" - ICAR_re for density.
- .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.