Posterior predictive check (source code)

= Posterior predictive check

A <posterior predictive check> compares a summary of the observed data with the same summary in replicated data drawn from a model's <posterior predictive distribution>. The replication must match the target: replicating an existing group's observations conditional on its effect differs from predicting a new group with a newly drawn effect. Such checks expose mismatches in dispersion, tails or other features; using the observations to fit and check the model means they are not automatically calibrated frequentist tests.