Plot posterior (default) or prior (prior = TRUE) predictive checks. This is convenience wrapper
around the bayesplot::ppc_*() methods.
Usage
pp_check(
object,
type = "dens_overlay",
facet_by = NULL,
newdata = NULL,
prior = FALSE,
varying = TRUE,
arma = TRUE,
ndraws = 100,
nsamples = lifecycle::deprecated(),
...
)Arguments
- object
An
mcpfitobject.- type
One of
bayesplot::available_ppc("grouped", invert = TRUE) %>% stringr::str_remove("ppc_")- facet_by
Name of a column in data modeled as varying effect(s).
- newdata
A
tibbleor adata.framecontaining predictors in the model. Weighted Gaussian predictions and log-likelihoods also require the weights column. IfNULL(default), the original data is used.- prior
TRUE/FALSE. Plot using prior samples? Useful for
mcp(..., sample = "both")- varying
One of:
TRUEAll varying effects (fit$pars$varying).FALSENo varying effects (c())."cp"or"predictor": All varying effects belonging to that part of the model.Character vector: Only include specified varying parameters - see
fit$pars$varying.
- arma
Whether to include AR and MA effects.
TRUECompute the GARMA residual recurrence. Requires the response variable innewdata.FALSEDisregard AR and MA effects. Forfamily = gaussian(),predict()uses onlysigmafor residuals.
- ndraws
Number of posterior draws. Note that you may want to use all draws for summary geoms, e.g.,
pp_check(fit, type = "ribbon", ndraws = NULL). LOO checks always evaluate all posterior draws to preserve their PSIS weights; where supported,ndrawsis passed to bayesplot to control the number of plotted samples.- nsamples
Deprecated. Use
ndrawsinstead.- ...
Further arguments passed to
bayesplot::ppc_type(y, yrep, ...)
Details
Missing responses are omitted from the observed-data check. LOO
predictive checks use posterior draws and the original fitted data, so
they do not support prior = TRUE or newdata.
Author
Jonas Kristoffer Lindeløv jonas@lindeloev.dk


