initialize_params()
View source ↗On this page
Create the biological, fishing and survey settings of an operating-model simulation from a species preset, for sim_cal() and sim_data().
Usage
initialize_params(
nyear = NULL,
rec.age = NULL,
first.year = NULL,
nage = NULL,
M = NULL,
init_Z = NULL,
vbk = NULL,
Linf = NULL,
t0 = NULL,
len_mid = NULL,
len_border = NULL,
a = NULL,
b = NULL,
mat_L50 = NULL,
mat_L95 = NULL,
cv_L = NULL,
cv_inc = NULL,
std_logR = NULL,
std_logN0 = NULL,
alpha = NULL,
beta = NULL,
std_SN = NULL,
q_surv_L50 = NULL,
q_surv_L95 = NULL,
R_init = NULL,
F_mean = NULL,
F_ar = NULL,
F_sd = NULL,
R_ar = NULL,
species = NULL,
growth_step = NULL,
burn_in = NULL,
observation_error = c("independent", "shared_time"),
random_numbers = c("sequential", "by_process")
)
Arguments
| Argument | Default | Description |
|---|---|---|
nyear | NULL | Integer. Total simulation years including the burn-in (default 100). |
rec.age | NULL | Numeric. Age of recruitment in years (default 1; use 0.25 for quarterly simulations). |
first.year | NULL | Numeric. Year of the first retained observation (default 2020); fractional years are allowed. |
nage | NULL | Integer. Number of age classes including the plus group (default 15). |
M | NULL | Numeric. Natural mortality rate per model time step (default 0.2). |
init_Z | NULL | Numeric. Total mortality per model time step used to construct the initial age distribution (default 0.5). |
vbk | NULL | Numeric. Von Bertalanffy k per year (default 0.2). |
Linf | NULL | Numeric. Asymptotic length, in the unit of the length bins (default 60). |
t0 | NULL | Numeric. Von Bertalanffy t0 in years (default 1/60). |
len_mid | NULL | Numeric vector. Finite, positive and increasing midpoints of the length bins; each midpoint lies strictly inside its bin (default |
len_border | NULL | Numeric vector. Increasing borders of the length bins, one more than the number of midpoints (default |
a | NULL | Numeric. Coefficient a of the length-weight relationship W = a * L^b, matching the units of length and weight (default exp(-12)). |
b | NULL | Numeric. Exponent b of the length-weight relationship W = a * L^b (default 3). |
mat_L50 | NULL | Numeric. Length at 50 percent maturity (default 35). |
mat_L95 | NULL | Numeric. Length at 95 percent maturity (default 40), distinct from mat_L50. An increasing maturity curve uses mat_L95 > mat_L50. |
cv_L | NULL | Numeric. Coefficient of variation of length at age (default 0.2). |
cv_inc | NULL | Numeric. Coefficient of variation of the growth increment (default 0.2). |
std_logR | NULL | Numeric. Innovation SD of the first-order autoregressive (AR(1)) log-recruitment deviations (default 0.3); the stationary marginal SD is std_logR / sqrt(1 - R_ar^2). |
std_logN0 | NULL | Numeric. SD of the normal deviations of the initial log numbers at age (default 0.2). With the default form the deviations are increments between neighbouring ages, so the total log deviation at each age accumulates them. Set |
alpha | NULL | Numeric. Coefficient alpha of the Beverton-Holt stock-recruitment relationship (default 400); its units depend on those of abundance and biomass. |
beta | NULL | Numeric. Coefficient beta of the Beverton-Holt stock-recruitment relationship (default 10); its units depend on those of abundance and biomass. |
std_SN | NULL | Numeric. SD of the log observation errors of the survey index (default 0.2). |
q_surv_L50 | NULL | Numeric. Length at survey catchability 0.5 (default 15). |
q_surv_L95 | NULL | Numeric. Length at survey catchability 0.95 (default 20), greater than q_surv_L50. |
R_init | NULL | Numeric. Initial recruitment in numbers (default 500). |
F_mean | NULL | Numeric. Baseline fishing mortality per model time step (default 0.3), the median of the F process before selectivity, not the arithmetic mean of the generated F. |
F_ar | NULL | Numeric. AR(1) coefficient of the log-F deviations (default 0.75). |
F_sd | NULL | Numeric. Innovation SD of the AR(1) log-F deviations (default 0.2); their stationary SD is F_sd / sqrt(1 - F_ar^2). |
R_ar | NULL | Numeric. AR(1) coefficient of the recruitment deviations (default 0.1). |
species | NULL | Character or NULL. Species preset, one of "flatfish", "tuna" and "krill", or "?" to list the presets. NULL (default) uses the same settings as flatfish. Letter case does not matter. |
growth_step | NULL | Numeric. Length of a time step in years (default 1; 0.25 in the tuna preset). |
burn_in | NULL | Numeric. Simulation years discarded before the observations are returned (default 80; 95 in the tuna preset); a whole multiple of growth_step and smaller than nyear. |
observation_error | c("independent", "shared_time") | "independent" (default) gives each length bin and time step an independent lognormal error; "shared_time" gives all length bins of a time step one shared error, a deliberately misspecified scenario with perfectly correlated errors. Letter case does not matter. |
random_numbers | c("sequential", "by_process") | How |
Value
A named parameter list with the species, the age, time and length grids, and the growth, mortality, recruitment, observation and process settings. years ends at the last time step with observations. To simulate with an optional model structure, set structure on the returned list (for example pa$structure <- list(initial_plus_group = "equilibrium")), with the same values as the structure argument of run_acl() and run_alscl(); sim_cal() and sim_data() read it.
Details
Every argument defaults to NULL, which takes the value of the selected species preset; species = NULL uses the flatfish preset. The defaults in parentheses in the argument table are those of the flatfish preset. The quarterly tuna preset differs, for example alpha 15000, beta 150, nage 20 and growth_step 0.25; run str(initialize_params(species = "tuna")) to see all its values.
The species preset selects the structure of the operating model. flatfish and krill are age_based, and tuna is length_based. These names describe the dynamics of the operating model and are not the estimation models ACL and ALSCL; the recruitment process of the simulator also differs from that of both estimation models.
nyear and burn_in are durations in years and must each be a whole number of growth_step intervals, so a half-year burn-in is valid with quarterly steps but not with annual steps.
In the full simulator, F_mean is a multiplicative baseline per model time step, F_t = F_mean * exp(u_t), which is then multiplied by fishery selectivity. F_sd is the innovation SD of the AR(1) process u_t on the log-F scale, and its stationary SD is F_sd / sqrt(1 - F_ar^2). F_mean is therefore the median of F, not the arithmetic mean of a generated F trajectory. In simulate_example_data(), mean_F is the arithmetic mean of the generated F.
Additional details from R help
F_mean of this simulator is the median of the F process, whereas
simulate_example_data() rescales its F trajectory so that its mean_F is
the arithmetic mean over the returned years; the two arguments have
similar names but different definitions.
The species presets and their main parameters are listed below. The
list printed by initialize_params(species = "?") names the
flatfish and tuna operating models M7 and M6.
flatfish: nage 15, Linf 60, vbk 0.2, M 0.2, annual time steps
tuna: nage 20, Linf 152, vbk 0.38, M 0.2, quarterly time steps
krill: nage 5, Linf 60, vbk 0.3, M 0.3, annual time steps
Examples
Run the setup before the example. Fitting examples require an R-compatible C++ toolchain; simulation and export examples may write files.
Example setup
library(ALSCL)
# Use objects defined above
pa <- initialize_params(species = "flatfish", nyear = 100, burn_in = 80)