Skip to contents

By default, rstan will initialize parameters uniformly at random in the range (-2, 2), on the unconstrained scale. Description of how stan transforms parameters to satisfy constraints is described in the stan documentation

This helper is especially useful for running models using the cmdstanr backend, which requires all parameters (including distributional) parameters to be initialized.

Usage

rstan_default_init(lb = NULL, ub = NULL, dim = 0)

Arguments

lb

numeric lower bound for parameter

ub

numeric upper bound for parameter

dim

numeric dimension of parameter.

Value

function that return the default brms initial value for a parameter. If dim=0, then it will be a numeric scalar, if dim=1 or greater, than return an array with the given dimension.

See also

Examples

if (FALSE) { # \dontrun{

# Explicitly set the default initialization for the distributional parameter
# 'sigma' when family=gaussian().
init <- BayesPharma::sigmoid_antagonist_init(
  sigma = BayesPharma::rstan_default_scalar_init(lb = 0))

} # }