likelihood_random {gadget3} | R Documentation |
Gadget3 random effects likelihood actions
Description
Add likelihood components for random effects
Usage
g3l_random_dnorm(
nll_name,
param_f,
mean_f = 0,
sigma_f = 1,
log_f = TRUE,
period = 'auto',
nll_breakdown = FALSE,
weight = substitute(
g3_param(n, optimise = FALSE, value = 1),
list(n = paste0(nll_name, "_weight"))),
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 = substitute(
g3_param(n, optimise = FALSE, value = 1),
list(n = paste0(nll_name, "_weight"))),
run_at = g3_action_order$likelihood)
Arguments
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 |
|
sigma_f |
|
log_f |
|
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 |
Details
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.
Value
g3l_random_dnorm
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
g3l_random_walk
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.
Examples
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))
)