eval_init | R Documentation |
How brms models can be initialized depends on the backend.
The method that all backends supports is as a list (one for each chain) of
lists (one for each variable) with numeric values. Since this requires
knowing how many chains are being run, which may not be available when the
model is being defined, and to support random initialization, the rstan
backend also supports initialization as a function returning a list of
functions (one for each parameter) returning a numeric array of length 1.
Also, to support the common use-case of initializing everything to zero or
randomly in the range (-2, 2) on the unconstrained scale, rstan also
supports initializing with 0
and "random"
.
To make BayesPharma more backend agnostic, this helper function takes the an init and the number of chains and reduces it to the list of list format.
eval_init(init, sdata = NULL, algorithm = "sampling", chains = 4)
init |
One of
|
sdata |
result of running |
algorithm |
|
chains |
|
list
of list
form of model initialization
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.