I am relatively new to Bayesian statistics so please be gentle.

I have just performed Approximate Bayesian Computation (ABC) for the inference of a multi-parameter model. Now I am looking to perform a posterior predictive check on the parameters that have been inferred.

What I am wanting to know is that, when sampling from the posterior to generate the summary statistics for the posterior predictive check, do I sample independently from the marginal posteriors for each parameters, or am I supposed to sample the parameter values jointly (i.e. sample from the exact parameter combinations that gave rise to the accepted summary statistics).

The model contains a lot of parameters (over 6) and I am interested in the marginal posteriors for each parameter. I hope this question makes sense.


1 Answer 1


Great question for a newcomer!!!

Your ABC algorithm provides you with a sample $\theta_1,\ldots,\theta_M$ from the ABC-posterior distribution. For each component of the vector $\theta$, you thus get a sample of size $M$ from the marginal ABC-posterior. For instance here is a toy example about the mean-variance normal posterior, when using median and mad as summaries:

#normal data with 100 observations 
#observed summaries

#normal x gamma prior


  prior=priori(N)  #reference table

  for (i in 1:N){
    summ[i,]=c(median(xi),mad(xi)) #summaries

  #normalisation factor for the distance




If you plot


you will get the marginal ABC-posterior for the normal mean.

However, if you want to do a posterior predictive check, you cannot generate one component of your posterior at a time to get pseudo-data and the corresponding summaries. You need both mean and variance to get a new normal sample! So my R code would then be


to draw a sample from the ABC-posterior and the pseudo-data would then be generated as previously:

  for (i in 1:M){
    summ[i,]=c(median(xi),mad(xi)) #summaries
  • 1
    $\begingroup$ Thank you very much for the thorough answer. Your example R script really made it clear to me. After I posted that question I thought more carefully about what I was asking and I was inching towards the conclusion that you gave, so it is great to have you confirm it for me :-) $\endgroup$
    – David
    Nov 18, 2014 at 22:04
  • 1
    $\begingroup$ @ Xi'an: Done. Thank you. I'm still new to this site! $\endgroup$
    – David
    Nov 29, 2014 at 15:49
  • $\begingroup$ (Also brand new to proba and ABC, I may be totally out of scope) From @Xi'an's answer, it is not really clear to me what $M$ is. I guess that it should be the number of posterior check you want to run, right? and if I am right it's then unrelated to the $M$ in $theta_M$ define in the first part, which is the number of particle selected by the ABC right? This brings me to another question: in your answer @ Xi'an you sample $10^3$ particle from the posteriors. Running your code the ABC returns me $5\times10^3$ particles. Is there some rule to choose how many posteriors check one should do? $\endgroup$
    – Simon C.
    Jan 17, 2019 at 14:18
  • $\begingroup$ Hi Robert, if you could answer this it would be greatly appreciated: stats.stackexchange.com/questions/468189/… $\endgroup$
    – user272422
    May 24, 2020 at 1:23

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.