likelihood_random | R Documentation |
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)
param_f |
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. |
mean_f |
A formula representing mean in dnorm. |
sigma_f |
A formula representing sigma in dnorm. |
log_f |
A formula representing log in dnorm. |
period |
When dnorm should be recalculated. Once per |
nll_name |
Character string, used to define the variable name for dnorm output. |
nll_breakdown |
Should the nll report be broken down by time? |
weight |
Weighting applied to this likelihood component. |
run_at |
Integer order that actions will be run within model, see |
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.
An action (i.e. list of formula objects) that will...
On the final model step, calculate dnorm(param_f, mean_f, sigma_f)
& add to nll
An action (i.e. list of formula objects) that will...
Calculate dnorm(param_f, previous param_f, sigma_f)
(at final year if period = year)
Add to nll.
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))
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.