![]() |
EpiNow2 Stan Functions
|
Functions for parameter management. More...
Functions | |
vector | get_param (int id, array[] int params_fixed_lookup, array[] int params_variable_lookup, vector params_value, matrix params) |
real | get_param (int id, array[] int params_fixed_lookup, array[] int params_variable_lookup, vector params_value, vector params) |
void | params_lp (vector params, array[] int prior_dist, vector prior_dist_params, vector params_lower, vector params_upper) |
Functions for parameter management.
Functions from params.stan for accessing, manipulating, and applying priors to model parameters.
vector get_param | ( | int | id, |
array[]int | params_fixed_lookup, | ||
array[]int | params_variable_lookup, | ||
vector | params_value, | ||
matrix | params ) |
#include </github/workspace/inst/stan/functions/params.stan>
Get a parameter value from either fixed or variable parameters (matrix version)
This function is an overloaded version of get_param that works with a matrix of parameter values, returning a vector of parameter values for multiple samples.
id | Parameter ID |
params_fixed_lookup | Array of fixed parameter lookup indices |
params_variable_lookup | Array of variable parameter lookup indices |
params_value | Vector of fixed parameter values |
params | Matrix of variable parameter values (rows are samples) |
Definition at line 52 of file params.stan.
real get_param | ( | int | id, |
array[]int | params_fixed_lookup, | ||
array[]int | params_variable_lookup, | ||
vector | params_value, | ||
vector | params ) |
#include </github/workspace/inst/stan/functions/params.stan>
Parameter Handlers
This group of functions handles parameter access, retrieval, and prior specification in the model. Parameters can be either fixed (specified in advance) or variable (estimated during inference). Get a parameter value from either fixed or variable parameters
This function retrieves a parameter value based on its ID, checking first if it's a fixed parameter and then if it's a variable parameter.
id | Parameter ID |
params_fixed_lookup | Array of fixed parameter lookup indices |
params_variable_lookup | Array of variable parameter lookup indices |
params_value | Vector of fixed parameter values |
params | Vector of variable parameter values |
Definition at line 24 of file params.stan.
void params_lp | ( | vector | params, |
array[]int | prior_dist, | ||
vector | prior_dist_params, | ||
vector | params_lower, | ||
vector | params_upper ) |
#include </github/workspace/inst/stan/functions/params.stan>
Update log density for parameter priors
This function adds the log density contributions from parameter priors to the target, supporting multiple prior distribution types.
params | Vector of parameter values |
prior_dist | Array of prior distribution types (0: lognormal, 1: gamma, 2: normal) |
prior_dist_params | Vector of prior distribution parameters |
params_lower | Vector of lower bounds for parameters |
params_upper | Vector of upper bounds for parameters |
Definition at line 80 of file params.stan.