likelihood_random.Rd
Add likelihood components for random effects
g3l_random_dnorm(
nll_name,
param_f,
mean_f = 0,
sigma_f = 1,
log_f = TRUE,
period = 'auto',
nll_breakdown = FALSE,
weight = g3_parameterized(paste0(nll_name, "_weight"),
optimise = FALSE, value = 1),
run_at = g3_action_order$likelihood)
g3l_random_walk(
nll_name,
param_f,
sigma_f = 1,
log_f = TRUE,
period = 'auto',
nll_breakdown = FALSE,
weight = g3_parameterized(paste0(nll_name, "_weight"),
optimise = FALSE, value = 1),
run_at = g3_action_order$likelihood)
A formula representing the value to apply dnorm to. Invariably a g3_param for g3l_random_dnorm, a g3_param_table with cur_year for g3l_random_walk.
When dnorm should be recalculated. Once per year
every step
, or single
for once.
The default, auto
, will assume the input is generated by g3_parameterized
and will
derive the most appropriate option.
Character string, used to define the variable name for dnorm output.
Should the nll report be broken down by time? TRUE
/ FALSE
Weighting applied to this likelihood component.
Integer order that actions will be run within model, see g3_action_order
.
The model report will contain nll_random_dnorm_dnorm_lin__dnorm
, the results of applying dnorm.
If nll_breakdown is TRUE
, this will be an array with one entry per timestep.
likelihood_actions <- list(
# Calculate dnorm() for the dnorm_log parameter
g3l_random_dnorm('dnorm_log',
g3_parameterized('dnorm_log', value = 0, random = TRUE),
mean_f = 0),
# Treat the walk_year.xxxx parameters as a random walk
g3l_random_walk('walk_year',
g3_parameterized('walk_year', by_year = TRUE, value = 0, random = TRUE))
)