Generate data from the posterior predictive distribution. This is useful for assessing the fit of a model. Alternatively this can be used for assessing counterfactuals or for prediction using the newdata argument.
# S3 method for epimodel
posterior_predict(
object,
newdata = NULL,
draws = NULL,
types = NULL,
seed = NULL,
posterior_mean = FALSE,
...
)
A fitted model object returned by epim
.
See epimodel-objects
.
If provided, the original data
used
in object
is overridden. Useful both for counterfactual
and prediction analysis
Number of posterior draws to use. Defaults to the number of parameter draws in the fitted model.
A character vector specifying the names of the outcome variables to consider. If unspecified, uses all.
An optional seed.
If TRUE, return samples of posterior means rather than from the posterior predictive.
Not used.
A named list of draws from the posterior predictive. Each element corresponds to a specific outcome.