Skip to contents

The prediction methods of brms, such as brms::log_lik(), brms::posterior_predict(), brms::posterior_epred(), brms::predict.brmsfit(), brms::fitted.brmsfit() and brms::loo(), turn newdata into Stan data through standata(). For a bmmfit, newdata can be in the layout of the data you gave to bmm(): the columns bmm built from those data when it fitted the model are built again. Rows of the fit's model frame, fit$data, are used as they are.

Usage

# S3 method for class 'bmmfit'
standata(object, newdata = NULL, ...)

Arguments

object

A bmmfit object

newdata

An optional data frame, in the layout of the data given to bmm() or a subset of the rows of object$data. Its rows keep their order. When newdata is in the layout given to bmm(), the columns bmm builds itself are built again, and a column of newdata with one of those names is replaced.

...

Further arguments passed to brms::standata()

Value

A named list of objects containing the data to evaluate the model with Stan.