Skip to contents

Called by bmm() to create an initfun for models that require initial values to properly start sampling

Usage

create_initfun(model, data, formula, prior = NULL, ...)

Arguments

model

The bmmodel object for with an initfun should be created

data

The user supplied data.frame used to fit the model

formula

The brmsformula generated by configure_model including the family for the bmmodel to be estimated.

prior

The brmsprior the model will be fitted with. Parameters it holds constant are absent from the Stan code and get no initial value.

...

The arguments of brms::brm() besides formula, data and prior that change the Stan data or code (data2, knots, drop_unused_levels), passed on to brms::standata() and brms::stancode().

Value

An initfun with no arguments that generates inital values suitable for the STAN parameters generated by the respective model call