Prepare Predictions
This method helps in preparing brms models for certin post-processing
tasks most notably various forms of predictions. Unless you are a package
developer, you will rarely need to call prepare_predictions
directly.
## S3 method for class 'brmsfit' prepare_predictions( x, newdata = NULL, re_formula = NULL, allow_new_levels = FALSE, sample_new_levels = "uncertainty", incl_autocor = TRUE, oos = NULL, resp = NULL, nsamples = NULL, subset = NULL, nug = NULL, smooths_only = FALSE, offset = TRUE, newdata2 = NULL, new_objects = NULL, point_estimate = NULL, ... ) prepare_predictions(x, ...)
x |
An R object typically of class |
newdata |
An optional data.frame for which to evaluate predictions. If
|
re_formula |
formula containing group-level effects to be considered in
the prediction. If |
allow_new_levels |
A flag indicating if new levels of group-level
effects are allowed (defaults to |
sample_new_levels |
Indicates how to sample new levels for grouping
factors specified in |
incl_autocor |
A flag indicating if correlation structures originally
specified via |
oos |
Optional indices of observations for which to compute out-of-sample rather than in-sample predictions. Only required in models that make use of response values to make predictions, that is currently only ARMA models. |
resp |
Optional names of response variables. If specified, predictions are performed only for the specified response variables. |
nsamples |
Positive integer indicating how many posterior samples should
be used. If |
subset |
A numeric vector specifying the posterior samples to be used.
If |
nug |
Small positive number for Gaussian process terms only. For
numerical reasons, the covariance matrix of a Gaussian process might not be
positive definite. Adding a very small number to the matrix's diagonal
often solves this problem. If |
smooths_only |
Logical; If |
offset |
Logical; Indicates if offsets should be included in the
predictions. Defaults to |
newdata2 |
A named |
new_objects |
Deprecated alias of |
point_estimate |
Shall the returned object contain only point estimates
of the parameters instead of their posterior samples? Defaults to
|
... |
Further arguments passed to |
An object of class 'brmsprep'
or 'mvbrmsprep'
,
depending on whether a univariate or multivariate model is passed.
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.