create_parameters()
View source ↗On this page
Return the starting values and the lower and upper bounds of the ACL or ALSCL parameters, from the generic defaults or a species preset, with your own values replacing single entries.
Usage
create_parameters(
model_type = c("acl", "alscl"),
species = NULL,
parameters = NULL,
parameters.L = NULL,
parameters.U = NULL,
bounds = c("default", "wide")
)
Arguments
| Argument | Default | Description |
|---|---|---|
model_type | c("acl", "alscl") | Character. "acl" or "alscl", which determines the parameter names and the default values. Letter case does not matter. |
species | NULL | Character or NULL. Species preset, "flatfish" (an annual operating model like yellowtail flounder, Linf start 60), "tuna" (a quarterly operating model like a tuna, Linf start 152) or "krill" (like Antarctic krill, Linf start 90 for ACL and 60 for ALSCL); "?" lists the presets. Each preset supplies starting values and bounds taken from a simulation operating model; inspect them before fitting another stock. NULL (default) uses the generic starting values and bounds. Letter case does not matter. |
parameters | NULL | Named list of starting values on the optimizer scale. Only the parameters named replace the default (or preset) values. |
parameters.L | NULL | Named list of lower bounds on the optimizer scale; only the parameters named are replaced. |
parameters.U | NULL | Named list of upper bounds on the optimizer scale; only the parameters named are replaced. |
bounds | c("default", "wide") | Character. "default" uses the standard bounds of each model. "wide" gives ACL the bounds that ALSCL has for five parameters (see the table after the return value). It has no effect for |
Value
A list with parameters (starts), parameters.L (lower bounds) and parameters.U (upper bounds). Each is a named list on the optimizer scale, with names matching the selected TMB model.
Details
A species preset sets only starting values and bounds; it does not change the data, the natural mortality rate, the age classes or the survey catchability. create_parameters_alscl() selects the ALSCL parameterization. ACL uses t0; ALSCL uses log_t0. Use named arguments and pass the resulting lists to the fitting function.
create_parameters(species = "krill", model_type = "acl") supplies a Linf start of 90 and bounds, but does not fix Linf or change M, nage or the time step. To fix it, explicitly pass map = list(log_Linf = factor(NA)) with the chosen starting value. Biological settings still belong in the fitting arguments.
Without a species preset, the default upper bounds of ACL are lower than those of ALSCL for five parameters, and ACL fits to other stocks than the yellowtail flounder example often stop at them. bounds = "wide" gives ACL the ALSCL bounds of these parameters (natural scale; rates are per model time step, k is per year). The wide bounds are 0.01 to 10 for the initial total mortality rate (default 0.01 to 1), 0.01 to 2 for the median fishing mortality rate (0.01 to 1), 0 to 10 for the standard deviation of the initial numbers at age on the log scale (0 to 1), 0.01 to 10 for the standard deviation of recruitment on the log scale (0.01 to 1) and 0.05 to 2 for the von Bertalanffy growth rate k (0.1 to 1). With a species preset the ACL and ALSCL bounds of these parameters are equal, so bounds changes nothing. Starting values are not changed.
Additional details from R help
Species presets
A species preset returns the starting values and bounds listed below. They come from simulation operating models and are not settings checked for a stock; whether a fit converges depends on the data, the model assumptions and the optimizer, and must be checked for each fit.
| Preset | Linf | vbk | nage | M | growth_step | Notes |
| flatfish | 60 | 0.2 | 15 | 0.2 | 1 | annual flatfish operating model |
| tuna | 152 | 0.38 | 20 | 0.2 | 0.25 | quarterly tuna operating model |
| krill | 90/60 | 0.3 | 5/7 | 0.3/0 | 1 | starting Linf 90 (ACL) or 60 (ALSCL) |
The nage, M and growth_step columns describe the workflows that the
presets come from; this function does not set them. Presets return only
starting values and bounds, so supply the biology to run_acl() or
run_alscl(). The krill ACL start of Linf is 90, and Linf is estimated
unless map = list(log_Linf = factor(NA)) fixes it. No preset
creates a map. The list printed by create_parameters("acl",
species = "?") names the flatfish and tuna operating models M7 and M6.
Parameter names in ACL and ALSCL
| Concept | ACL name | ALSCL name |
| SD of N0 deviations | log_std_log_N0 | log_sigma_log_N0 |
| SD of R deviations | log_std_log_R | log_sigma_log_R |
| SD of F deviations | log_std_log_F | log_sigma_log_F |
| F correlation (age/length) | logit_log_F_a | logit_log_F_l |
| t0 parameter | t0 (raw scale) | log_t0 (log scale) |
| Observation error SD | log_std_index | log_sigma_index |
ALSCL has one more parameter, log_cv_grow, the logarithm of the
coefficient of variation of the growth increment, which sets the spread
of the growth transition matrix.
Wide bounds for ACL
Without a species preset, the default upper bounds of ACL are lower than
those of ALSCL for five parameters, and ACL fits to other stocks than the
yellowtail flounder example often stop at them. bounds = "wide"
gives ACL the ALSCL bounds of these parameters, listed below on the
natural scale (rates per time step, k per year).
| Parameter | Quantity | Default bounds | Wide bounds |
| log_init_Z | initial total mortality rate | 0.01 to 1 | 0.01 to 10 |
| mean_log_F | median fishing mortality rate | 0.01 to 1 | 0.01 to 2 |
| log_std_log_N0 | standard deviation of the initial numbers at age (log scale) | 0 to 1 | 0 to 10 |
| log_std_log_R | standard deviation of recruitment (log scale) | 0.01 to 1 | 0.01 to 10 |
| log_vbk | von Bertalanffy growth rate k | 0.1 to 1 | 0.05 to 2 |
With a species preset the ACL and ALSCL bounds of these parameters are
equal, so bounds changes nothing. Starting values are not changed.
create_parameters_alscl() is a convenience wrapper that calls
create_parameters("alscl", ...).
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
create_parameters(model_type = "acl", species = "flatfish")
# ACL with the bounds of ALSCL for five parameters
wide <- create_parameters(model_type = "acl", bounds = "wide")
exp(unlist(wide$parameters.U[c("log_init_Z", "mean_log_F", "log_std_log_N0",
"log_std_log_R", "log_vbk")]))