R/posterior_predict.R
posterior_predict.epimodel.RdGenerate 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 class '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.
Draws from the posterior predictive for one outcome: a list giving the
group, time and draws (a matrix with a column for each
observation). If types names several outcomes (by default, all of them),
a list of these, named by outcome.