Simulation-efficient shortest probability intervals


Bayesian highest posterior density (HPD) intervals can be estimated directly from simulations via empirical shortest intervals. Unfortunately, these can be noisy (that is, have a high Monte Carlo error). We derive an optimal weighting strategy using bootstrap and quadratic programming to obtain a more computationally stable HPD, or in general, shortest probability interval (Spin). We prove the consistency of our method. Simulation studies on a range of theoretical and real-data examples, some with symmetric and some with asymmetric posterior densities, show that intervals constructed using Spin have better coverage (relative to the posterior distribution) and lower Monte Carlo error than empirical shortest intervals. We implement the new method in an R package (SPIn) so it can be routinely used in post-processing of Bayesian simulations.

This is a preview of subscription content, access via your institution.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14


  1. Box, G.E.P., Tiao, G.C.: Bayesian Inference in Statistical Analysis. Wiley, New York (1973)

    MATH  Google Scholar 

  2. Chen, M.H., Shao, Q.M.: Monte Carlo estimation of Bayesian credible and HPD intervals. J. Comput. Gr. Stat. 8, 69–92 (1999)

    MathSciNet  Google Scholar 

  3. David, H.A., Nagaraja, H.N.: Order Statistics, 3rd edn. Wiley, New York (2003)

    MATH  Book  Google Scholar 

  4. Efron, B.: Bootstrap methods: another look at the jackknife. Ann. Stat. 7, 1–26 (1979)

    MATH  MathSciNet  Article  Google Scholar 

  5. Gelman, A., Carlin, J.B., Stern, H.S., Rubin, D.B.: Bayesian Data Analysis. CRC Press, London (1995)

    Google Scholar 

  6. Gelman, A., Shirley, K.: Inference from simulations and monitoring convergence. In: Brooks, S., Gelman, A., Jones, G., Meng, X.L. (eds.) Handbook of Markov Chain Monte Carlo, pp. 163–174. CRC Press, London (2011)

    Google Scholar 

  7. R Development Core Team: R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, Vienna (2011)

  8. Rubin, D.B.: Estimation in parallel randomized experiments. J. Educ. Stat. 6, 377–401 (1981)

    Google Scholar 

  9. Spiegelhalter, D., Thomas, A., Best, N., Gilks, W., Lunn, D.: BUGS: Bayesian Inference Using Gibbs Sampling. MRC Biostatistics Unit, Cambridge. (1994, 2002). Accessed 15 Nov 2014

  10. Stan Development Team: RStan: the R interface to Stan, Version 2.5. (2014). Accessed 15 Nov 2014

  11. van der Vaart, A.W.: Asymptotic Statistics. Cambridge University Press, Cambridge (1998)

    MATH  Book  Google Scholar 

  12. Zheng, T., Salganik, M.J., Gelman, A.: How many people do you know in prison?: using overdispersion in count data to estimate social structure in networks. J. Am. Stat. Assoc. 101, 409–423 (2006)

    MATH  MathSciNet  Article  Google Scholar 

Download references


We thank Chia-Hui Huang, Daniel Lee, and Matt Hoffman for research assistance and the National Science Foundation (Grant CNS-1205516), Institute of Education Sciences (Grant DE R305D140059), and Department of Energy (Grant DE-SC0002099) for partial support of this work.

Author information



Corresponding author

Correspondence to Andrew Gelman.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Liu, Y., Gelman, A. & Zheng, T. Simulation-efficient shortest probability intervals. Stat Comput 25, 809–819 (2015).

Download citation


  • Bayesian computation
  • Highest posterior density
  • Bootstrap