generate_map()
View source ↗On this page
Return the default ACL map with custom fixes and releases merged into it.
Usage
generate_map(map = NULL)
Arguments
| Argument | Default | Description |
|---|---|---|
map | NULL | Named list of custom map entries, or NULL. factor(NA) fixes a parameter at its starting value; a named NULL entry releases a parameter that ACL fixes by default. ACL fixes log_std_log_F, logit_log_F_y, logit_log_F_a and t0 by default and estimates log_vbk and log_Linf; entries not named keep their default. |
Value
A named TMB map list that combines the ACL defaults with the supplied entries. factor(NA) fixes a parameter; a named NULL entry releases that default fix and is removed from the result.
Details
factor(NA) fixes a parameter at the supplied starting value. A named NULL entry releases a parameter that is fixed by default, and default entries not named are kept. The function uses the ACL defaults and parameter names; an ALSCL map, given to run_alscl() or stored in x$fit_config$alscl$map, uses the ALSCL names. An unknown name is an error; to release a parameter, copy its exact name from inspect_parameters(x, model). When you subset a map factor, unused levels are dropped and the remaining entries keep their fixed or estimated status.
The returned list has no NULL entries, so do not use run_acl(x, map = generate_map(list(t0 = NULL))) to release t0; the fitting function would add the missing default again. Pass run_acl(x, map = list(t0 = NULL)) directly. Both map = NULL and list() use the defaults of the model; neither releases every parameter.
Additional details from R help
The function uses the ACL defaults and drops named NULL entries from its result. To release default fixes in run_acl(), pass the list with named NULL entries directly as map, not through generate_map(), because the fit would otherwise apply the defaults of the dropped entries again.
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
generate_map(list(log_Linf = factor(NA), logit_log_F_y = NULL))