Plot the density of the observed data over the densities of replicate datasets simulated from the fitted model, to check that the model reproduces its data.
Value
A ggplot object from bayesplot::ppc_dens_overlay().
Details
Each replicate is simulated at the observed rows from one random posterior
draw, so set a seed with set.seed() for a reproducible plot. For a fit made
with prior_only = TRUE, the plot is a prior predictive check. See the
Advanced article
for how to read it.
See also
posterior_predict() for the replicates themselves.
Other diagnostics:
kb_converged(),
kb_influence(),
kb_plot_trace(),
kb_sensitivity(),
loo.kb_fit()

