prepare_predictions.brmsfit {brms} | R Documentation |
Prepare Predictions
Description
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.
Usage
## 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,
ndraws = NULL,
draw_ids = NULL,
nsamples = NULL,
subset = NULL,
nug = NULL,
smooths_only = FALSE,
offset = TRUE,
newdata2 = NULL,
new_objects = NULL,
point_estimate = NULL,
ndraws_point_estimate = 1,
...
)
prepare_predictions(x, ...)
Arguments
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. |
ndraws |
Positive integer indicating how many posterior draws should
be used. If |
draw_ids |
An integer vector specifying the posterior draws to be used.
If |
nsamples |
Deprecated alias of |
subset |
Deprecated alias of |
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 draws? Defaults to
|
ndraws_point_estimate |
Only used if |
... |
Further arguments passed to |
Value
An object of class 'brmsprep'
or 'mvbrmsprep'
,
depending on whether a univariate or multivariate model is passed.