I'm a frequentist but have been exploring Bayesian techniques lately. One thing that bothers me is that I'm never completely sure that I've implemented them correctly. To be specific, I'm not talking about convergence, burn-in time, or autocorrelation. I'm talking about, 'did I code the formulas correctly?'.

What I do now is to jack up the sample size and watch for the posterior to hug the true parameter values (with simulated data). But that's completely ignoring the power of the prior and the great small sample properties that Bayesians love to talk about.

Frequentist techniques make testable predictions in the form of relative frequencies. But in the Bayesian context, we lose the relative frequency-based interpretation of probability. So how does one programmatically test a Bayesian method's software implementation?


1 Answer 1


Bayesians don't lose the relative frequency-based interpretation of probability. In particular, if you define this procedure:

  1. simulate from the prior,
  2. then simulate from the model using those values from the prior, and
  3. estimate the parameters using the same prior.

Then your credible intervals should have the appropriate frequentist coverage, i.e. 95% intervals should include the true parameter in 95% of your analyses, over repeated replicates of the procedure.

  • $\begingroup$ Okay, so you if you treat the prior as part of the data generating process, and the posterior makes testable frequency-based predictions. I'll keep this question open for a few more days, but I like this answer. $\endgroup$
    – Ben Ogorek
    Commented May 7, 2014 at 5:07
  • 1
    $\begingroup$ For further information on this procedure see the references at stats.stackexchange.com/questions/513100/… $\endgroup$ Commented Sep 4, 2021 at 22:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.