A statistical test for Nested Sampling algorithms


Nested sampling is an iterative integration procedure that shrinks the prior volume towards higher likelihoods by removing a “live” point at a time. A replacement point is drawn uniformly from the prior above an ever-increasing likelihood threshold. Thus, the problem of drawing from a space above a certain likelihood value arises naturally in nested sampling, making algorithms that solve this problem a key ingredient to the nested sampling framework. If the drawn points are distributed uniformly, the removal of a point shrinks the volume in a well-understood way, and the integration of nested sampling is unbiased. In this work, I develop a statistical test to check whether this is the case. This “Shrinkage Test” is useful to verify nested sampling algorithms in a controlled environment. I apply the shrinkage test to a test-problem, and show that some existing algorithms fail to pass it due to over-optimisation. I then demonstrate that a simple algorithm can be constructed which is robust against this type of problem. This RADFRIENDS algorithm is, however, inefficient in comparison to MULTINEST.

This is a preview of subscription content, log in to check access.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7


  1. 1.

    Skilling (2004) uses the estimator \(\left\langle \ln S\right\rangle =-1/N\), which is better behaved at small N. For this introduction the simpler, intuitive formula is sufficient.


  1. Aitken, S., Akman, O.E.: Nested sampling for parameter inference in systems biology: application to an exemplar circadian model. BMC Syst. Biol. 7(1), 72 (2013)

    Article  Google Scholar 

  2. Beaujean, F., Caldwell, A.: Initializing adaptive importance sampling with Markov chains. ArXiv (e-prints) (2013)

  3. Betancourt, M.: Nested sampling with constrained Hamiltonian Monte Carlo. In Mohammad-Djafari, A., Bercher, J.-F., & Bessiére, P. (eds.) American Institute of Physics Conference Series, vol. 1305, pp. 165–172. American Institute of Physics Conference Series (2011)

  4. Cameron, E., Pettitt, A.: Recursive pathways to marginal likelihood estimation with prior-sensitivity analysis. ArXiv e-prints (2013)

  5. Chopin, N., Robert, C.: Comments on nested sampling by john skilling. Bayesian Stat. 8, 491–524 (2007)

    Google Scholar 

  6. Chopin, N., Robert, C.P.: Properties of nested sampling. Biometrika. (2010)

  7. Evans, M.: Discussion of nested sampling for bayesian computations by john skilling. Bayesian Stat. 8, 491–524 (2007)

    Google Scholar 

  8. Feroz, F., Hobson, M.P.: Multimodal nested sampling: an efficient and robust alternative to Markov Chain Monte Carlo methods for astronomical data analyses. MNRAS 384, 449–463 (2008)

    Article  Google Scholar 

  9. Feroz, F., Hobson, M.P., Bridges, M.: MULTINEST: an efficient and robust Bayesian inference tool for cosmology and particle physics. MNRAS 398, 1601–1614 (2009)

    Article  Google Scholar 

  10. Feroz, F., Hobson, M. P., Cameron, E., Pettitt, A. N.: Importance nested sampling and the MultiNest algorithm. ArXiv e-prints. (2013)

  11. Mukherjee, P., Parkinson, D., Liddle, A.R.: A nested sampling algorithm for cosmological model selection. ApJ 638, L51–L54 (2006)

    Article  Google Scholar 

  12. Sivia, D., Skilling, J.: Data Analysis: A Bayesian Tutorial. Oxford science publications. Oxford University Press, Oxford (2006)

    Google Scholar 

  13. Skilling, J.: Nested sampling. In: AIP Conference Proceedings, vol. 735, p. 395. (2004)

  14. Skilling, J.: Nested sampling’s convergence. In: BAYESIAN INFERENCE AND MAXIMUM ENTROPY METHODS IN SCIENCE ANDENGINEERING. The 29th International Workshop on Bayesian Inference andMaximum Entropy Methods in Science and Engineering, vol. 1193, pp. 277–291. AIP Publishing, New York (2009)

  15. Skilling, J.: Bayesian computation in big spaces-nested sampling and galilean monte carlo. AIP Conf. Proc. 1443(1), 145–156 (2012)

    Article  Google Scholar 

Download references


I would like to thank Frederik Beaujean and Udo von Toussaint for reading the initial manuscript. I acknowledge funding through a doctoral stipend by the Max Planck Society. This manuscript has greatly benefited from the comments of the two anonymous referees, whom I would also like to thank. I acknowledge financial support through a Max Planck society stipend.

Author information



Corresponding author

Correspondence to Johannes Buchner.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Buchner, J. A statistical test for Nested Sampling algorithms. Stat Comput 26, 383–392 (2016). https://doi.org/10.1007/s11222-014-9512-y

Download citation


  • Nested sampling
  • MCMC
  • Bayesian inference
  • Evidence
  • Test
  • Marginal likelihood