Blog: The right way to do predictive checks with observation-level random effects

I’ve released a short blog about performing posterior predictive checks for models with observation-level random effects (OLREs) (e.g., for over-dispersed counts). This has come up a few times for me while consulting, so I figured I should write it up. The basic idea is that one should do mixed replication, generating new levels of the observation-level random effect using the posterior draws of the hyperparameter but not re-using the fitted OLRE parameters.

I give examples in both PyMC and brms. Critical feedback is welcome!

5 Likes

The blog (and layout) is very neat. Btw you could simply pass nu_z to var_names for it to be resampled in the posterior predictive function. No need to extend the model with a new variable or move the sigma into it.

Your example is a great use case of this functionality.

2 Likes

Hi Ricardo,

Thanks for checking it out! I have just updated the PyMC code as you suggest.

Best,
Erik

1 Like