params {gadget3} | R Documentation |
Gadget3 parameter helpers
Description
Shortcuts to parameterise a model with g3_param
Usage
g3_parameterized(
name,
by_stock = FALSE,
by_predator = FALSE,
by_year = FALSE,
by_step = FALSE,
by_age = FALSE,
exponentiate = FALSE,
avoid_zero = FALSE,
scale = 1,
offset = 0,
...)
Arguments
name |
Suffix for parameter name. |
by_stock |
Should there be individual parameters per-stock?
|
by_predator |
Should there be individual parameters per-predator (read: per-fleet) stock?
|
by_year |
Should there be individual parameters per model year?
|
by_step |
Should there be individual parameters per step within years?
|
by_age |
Should there be individual parameters per stock age?
|
exponentiate |
Use |
avoid_zero |
If TRUE, wrap parameter with |
scale |
Use |
offset |
Use |
... |
Additional parameters passed through to |
Details
The function provides shortcuts to common formulas used when parameterising a model.
Value
A formula object defining the given parameters
See Also
g3_param
,
g3_param_table
,
stock_prepend
Examples
stock_a <- g3_stock(c(species = 'stock', 'aaa'), seq(10, 35, 5)) %>% g3s_age(1, 10)
stock_b <- g3_stock(c(species = 'stock', 'bbb'), seq(10, 35, 5)) %>% g3s_age(1, 10)
# Not by anything, so just a regular parameter
g3_parameterized('K')
# by_stock, so will use stock_prepend() to rename variables
g3_parameterized('K', by_stock = TRUE)
# Adding by_year or by_age turns it into a table
g3_parameterized('K', by_stock = TRUE, by_year = TRUE, by_age = TRUE)
# Can specify the name parts you want
g3_parameterized('K', by_stock = 'species', by_year = TRUE)
# Can give a list of stocks, in which case it works out name parts for you
g3_parameterized('K', by_stock = list(stock_a, stock_b))
g3_parameterized('K', by_stock = list(stock_a, stock_b), by_age = TRUE)