Skip to main content

Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

  • Primer
  • Published:

Nested sampling for physical scientists

An Author Correction to this article was published on 07 June 2022

This article has been updated

Abstract

This Primer examines Skilling’s nested sampling algorithm for Bayesian inference and, more broadly, multidimensional integration. The principles of nested sampling are summarized and recent developments using efficient nested sampling algorithms in high dimensions surveyed, including methods for sampling from the constrained prior. Different ways of applying nested sampling are outlined, with detailed examples from three scientific fields: cosmology, gravitational-wave astronomy and materials science. Finally, the Primer includes recommendations for best practices and a discussion of potential limitations and optimizations of nested sampling.

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

Access options

Rent or buy this article

Prices vary by article type

from$1.95

to$39.95

Prices may be subject to local taxes which are calculated during checkout

Fig. 1: Illustrations of nested sampling algorithm.
Fig. 2: Experimentation in nested sampling.
Fig. 3: Cosmological applications of nested sampling.
Fig. 4: Applications of nested sampling in gravitational-wave astronomy.
Fig. 5: Illustrations of materials science applications.

Similar content being viewed by others

Change history

References

  1. Skilling, J. Bayesian Inference and Maximum Entropy Methods in Science and Engineering MAXENT 2004 (eds Fischer, R., Dose, V., Preuss, R. & von Toussaint, U.) 395–405 (AIP, 2004). Nested sampling was first presented at MAXENT 2004 and appeared in these subsequent proceedings.

  2. Skilling, J. Nested sampling for general Bayesian computation. Bayesian. Analysis 1, 833–859 (2006). This landmark publication presents nested sampling and explains it in detail.

  3. Brooks, S., Gelman, A., Jones, G. & Meng, X. L. (eds) Handbooks of Modern Statistical Methods: Handbook of Markov Chain Monte Carlo (CRC Press, 2011).

  4. Hogg, D. W. & Foreman-Mackey, D. Data analysis recipes: using Markov chain Monte Carlo. Astrophys. J. 236, 11 (2018).

    Google Scholar 

  5. AbdusSalam, S. S. et al. Simple and statistically sound recommendations for analysing physical theories. Rep. Prog. Phys. 85, 052201 (2022).

    ADS  Google Scholar 

  6. Kass, R. E. & Raftery, A. E. Bayes factors. J. Am. Stat. Assoc. 90, 773–795 (1995). This work presents a classic modern reference for Bayes factors.

    MathSciNet  MATH  Google Scholar 

  7. Martin, G. M., Frazier, D. T. & Robert, C. P. Computing Bayes: Bayesian Computation from 1763 to the 21st Century. Preprint at https://arxiv.org/abs/2004.06425 (2020).

  8. Billingsley, P. Wiley Series in Probability and Statistics: Convergence of Probability Measures 3rd edn (Wiley, 2013).

  9. Chopin, N. & Robert, C. P. Properties of nested sampling. Biometrika 97, 741–755 (2010).

    MathSciNet  MATH  Google Scholar 

  10. Skilling, J. Bayesian Inference and Maximum Entropy Methods in Science and Engineering MAXENT 2009 (eds Goggans, P. M. & Chan, C.-Y.) 277–291 (AIP, 2009).

  11. Evans, M. in Bayesian Statistics Vol. 8 (eds Bernardo, J. M. et al.) 491–524 (Oxford Univ. Press, 2007).

  12. Salomone, R., South, L. F., Drovandi, C. C. & Kroese, D. P. Unbiased and consistent nested sampling via sequential Monte Carlo. Preprint at https://arxiv.org/abs/1805.03924 (2018). This work introduces connections between nested sampling and SMC.

  13. Au, S.-K. & Beck, J. L. Estimation of small failure probabilities in high dimensions by subset simulation. Probabilistic Eng. Mech. 16, 263–277 (2001).

    Google Scholar 

  14. Beck, J. L. & Zuev, K. M. in Handbook of Uncertainty Quantification (eds Ghanem, R., Higdon, D. & Owhadi, H.) 1–26 (Springer International, 2016).

  15. Walter, C. Point process-based Monte Carlo estimation. Stat. Comput. 27, 219–236 (2015).

    MathSciNet  MATH  Google Scholar 

  16. Birge, J. R., Chang, C. & Polson, N. G. Split sampling: expectations, normalisation and rare events. Preprint at https://arxiv.org/abs/1212.0534 (2013).

  17. Burrows, B. L. A new approach to numerical integration. IMA J. Appl. Math. 26, 151–173 (1980).

    MathSciNet  MATH  Google Scholar 

  18. McDonald, I. R. & Singer, K. Machine calculation of thermodynamic properties of a simple fluid at supercritical temperatures. J. Chem. Phys. 47, 4766–4772 (1967).

    ADS  Google Scholar 

  19. Thin, A. et al. NEO: non equilibrium sampling on the orbit of a deterministic transform. Adv. Neural Inf. Process. Syst. 34, 17060–17071 (2021).

    Google Scholar 

  20. Rotskoff, G. M. & Vanden-Eijnden, E. Dynamical computation of the density of states and Bayes factors using nonequilibrium importance sampling. Phys. Rev. Lett. 122, 150602 (2019).

    ADS  Google Scholar 

  21. Polson, N. G. & Scott, J. G. Vertical-likelihood Monte Carlo. Preprint at https://arxiv.org/abs/1409.3601 (2015).

  22. Robert, C. P. & Wraith, D. Computational methods for Bayesian model choice. AIP Conference Proceedings 1193, 251 (2009).

    ADS  Google Scholar 

  23. Knuth, K. H., Habeck, M., Malakar, N. K., Mubeen, A. M. & Placek, B. Bayesian evidence and model selection. Digital Signal. Process. 47, 50–67 (2015).

    MathSciNet  Google Scholar 

  24. Zhao, Z. & Severini, T. A. Integrated likelihood computation methods. Comput. Stat. 32, 281–313 (2016).

    MathSciNet  MATH  Google Scholar 

  25. Llorente, F., Martino, L., Delgado, D. & Lopez-Santiago, J. Marginal likelihood computation for model selection and hypothesis testing: an extensive review. Preprint at https://arxiv.org/abs/2005.08334 (2020).

  26. Tierney, L. & Kadane, J. B. Accurate approximations for posterior moments and marginal densities. J. Am. Stat. Assoc. 81, 82–86 (1986).

    MathSciNet  MATH  Google Scholar 

  27. Chib, S. Marginal likelihood from the Gibbs output. J. Am. Stat. Assoc. 90, 1313–1321 (1995).

    MathSciNet  MATH  Google Scholar 

  28. Kloek, T. & van Dijk, H. K. Bayesian estimates of equation system parameters: an application of integration by Monte Carlo. Econometrica 46, 1–19 (1978).

    MATH  Google Scholar 

  29. Newton, M. A. & Raftery, A. E. Approximate Bayesian inference with the weighted likelihood bootstrap. J. R. Stat. Society: Ser. B 56, 3–26 (1994).

    MathSciNet  MATH  Google Scholar 

  30. Gelman, A. & Meng, X.-L. Simulating normalizing constants: from importance sampling to bridge sampling to path sampling. Stat. Sci. 13, 163–185 (1998). This classic reference work introduces the notion of path sampling.

    MathSciNet  MATH  Google Scholar 

  31. Cameron, E. & Pettitt, A. N. Recursive pathways to marginal likelihood estimation with prior-sensitivity analysis. Stat. Sci. 29, 397–419 (2014).

    MathSciNet  MATH  Google Scholar 

  32. Shannon, C. E. A mathematical theory of communication. Bell Syst. Technical J. 27, 379–423 (1948).

    MathSciNet  MATH  Google Scholar 

  33. Jaynes, E. T. Prior probabilities. IEEE Trans. Syst. Sci. Cybern. 4, 227–241 (1968).

    MATH  Google Scholar 

  34. Keeton, C. R. On statistical uncertainty in nested sampling. Mon. Not. R. Astron. Soc. 414, 1418–1426 (2011).

    ADS  Google Scholar 

  35. Feroz, F. & Hobson, M. P. Multimodal nested sampling: an efficient and robust alternative to Markov Chain Monte Carlo methods for astronomical data analyses. Mon. Not. R. Astron. Soc. 384, 449–463 (2008). This work popularizes nested sampling in astrophysics and cosmology by introducing the MultiNest implementation.

    ADS  Google Scholar 

  36. Pártay, L. B., Bartók, A. P. & Csányi, G. Efficient sampling of atomic configurational spaces. J. Phys. Chem. B 114, 10502–10512 (2010). This work introduces nested sampling for atomistic modelling.

    Google Scholar 

  37. Sivia, D. & Skilling, J. Data Analysis: A Bayesian Tutorial (Oxford Univ. Press, 2006). This popular textbook includes a chapter on nested sampling.

  38. Higson, E., Handley, W., Hobson, M. & Lasenby, A. Dynamic nested sampling: an improved algorithm for parameter estimation and evidence calculation. Stat. Comput. 29, 891–913 (2018). This work introduces an important dynamic variant of nested sampling that speeds up parameter inference.

    MathSciNet  MATH  Google Scholar 

  39. Speagle, J. S. dynesty: a dynamic nested sampling package for estimating Bayesian posteriors and evidences. Mon. Not. R. Astron. Soc. 493, 3132–3158 (2020).

    ADS  Google Scholar 

  40. Higson, E. dyPolyChord: dynamic nested sampling with PolyChord. J. Open. Source Softw. 3, 965 (2018).

    ADS  Google Scholar 

  41. Buchner, J. Nested sampling methods. Preprint at https://arxiv.org/abs/2101.09675 (2021).

  42. Brewer, B. J., Pártay, L. B. & Csányi, G. Diffusive nested sampling. Stat. Comput. 21, 649–656 (2010).

    MathSciNet  MATH  Google Scholar 

  43. Buchner, J. A statistical test for nested sampling algorithms. Stat. Comput. 26, 383–392 (2016).

    MathSciNet  MATH  Google Scholar 

  44. Goodman, J. & Weare, J. Ensemble samplers with affine invariance. communications in applied mathematics and computational. Science 5, 65–80 (2010).

    MATH  Google Scholar 

  45. Allison, R. & Dunkley, J. Comparison of sampling techniques for Bayesian parameter estimation. Mon. Not. R. Astron. Soc. 437, 3918–3928 (2014).

    ADS  Google Scholar 

  46. Buchner, J. Collaborative nested sampling: big data versus complex physical models. PASP 131, 108005 (2019).

    ADS  Google Scholar 

  47. Mukherjee, P., Parkinson, D. & Liddle, A. R. A nested sampling algorithm for cosmological model selection. Ap. J. 638, L51–L54 (2006).

    ADS  Google Scholar 

  48. Parkinson, D., Mukherjee, P. & Liddle, A. R. Bayesian model selection analysis of WMAP3. Phys. Rev. D. 73, 123523 (2006).

    ADS  Google Scholar 

  49. Shaw, J. R., Bridges, M. & Hobson, M. P. Efficient Bayesian inference for multimodal problems in cosmology. Mon. Not. R. Astron. Soc. 378, 1365–1370 (2007).

    ADS  Google Scholar 

  50. Veitch, J. & Vecchio, A. Bayesian coherent analysis of in-spiral gravitational wave signals with a detector network. Phys. Rev. D. 81, 062003 (2010).

    ADS  Google Scholar 

  51. Ter Braak, C. J. F. A Markov chain Monte Carlo version of the genetic algorithm Differential Evolution: easy Bayesian computing for real parameter spaces. Stat. Comput. 16, 239–249 (2006).

    MathSciNet  Google Scholar 

  52. Jasa, T. & Xiang, N. Nested sampling applied in Bayesian room-acoustics decay analysis. Acoustical Soc. Am. J. 132, 3251 (2012).

    ADS  Google Scholar 

  53. Handley, W. J., Hobson, M. P. & Lasenby, A. N. PolyChord: next-generation nested sampling. Mon. Not. R. Astron. Soc. 453, 4384–4398 (2015).

    ADS  Google Scholar 

  54. Smith, R. L. Efficient Monte Carlo procedures for generating points uniformly distributed over bounded regions. Oper. Res. 32, 1296–1308 (1984).

    ADS  MathSciNet  MATH  Google Scholar 

  55. Zabinsky, Z. B. & Smith, R. L. Hit-and-Run Methods 721–729 (Springer US, 2013).

  56. Habeck, M. in Bayesian Inference and Maximum Entropy Methods in Science and Engineering MAXENT 2014 (eds Mohammad-Djafari, A. & Barbaresco, F.) 121–129 (AIP, 2015).

  57. Betancourt, M. in Bayesian Inference and Maximum Entropy Methods in Science and Engineering MAXENT 2010 (eds Mohammad-Djafari, A. & Bessiére, P.) 165–172 (AIP, 2011).

  58. Skilling, J. in Bayesian Inference and Maximum Entropy Methods in Science and Engineering MAXENT 2011 (eds Goyal, P., Giffin, A., Knuth, K. H. & Vrscay, E.) 145–156 (AIP, 2012).

  59. Griffiths, M. & Wales, D. J. Nested basin-sampling. J. Chem. Theory Comput. 15, 6865 (2019).

    Google Scholar 

  60. Olander, J. Constrained Space MCMC Methods for Nested Sampling Bayesian Computations. PhD Thesis, Chalmers Tekniska Högskola, Institutionen för Fysik (2020).

  61. Stokes, B., Tuyl, F. & Hudson, I. New prior sampling methods for nested sampling - development and testing. AIP Conference Proceedings 1853, 110003 (2017).

    Google Scholar 

  62. Higson, E., Handley, W., Hobson, M. & Lasenby, A. nestcheck: diagnostic tests for nested sampling calculations. Mon. Not. R. Astron. Soc. 483, 2044–2056 (2019).

    ADS  Google Scholar 

  63. Burkoff, N. S., Várnai, C., Wells, S. A. & Wild, D. L. Exploring the energy landscapes of protein folding simulations with Bayesian computation. Biophys. J. 102, 878–886 (2012).

    ADS  Google Scholar 

  64. Henderson, R. W. & Goggans, P. M. in Bayesian Inference and Maximum Entropy Methods in Science and Engineering MAXENT 2013 (eds Niven, R. K., Brewer, B., Paull, D., Shafi, K. & Stokes, B.) 100–105 (AIP, 2014).

  65. Baldock, R. J. N., Pártay, L. B., Bartók, A. P., Payne, M. C. & Csányi, G. Determining the pressure–temperature phase diagrams of materials. Phys. Rev. B 93, 174108 (2016). This work adapts nested sampling for material simulation with periodic boundary conditions.

    ADS  Google Scholar 

  66. Handley, W. anesthetic: nested sampling visualisation. J. Open Source Softw. 4, 1414 (2019).

    ADS  Google Scholar 

  67. Fowlie, A. & Bardsley, M. H. superplot: a graphical interface for plotting and analysing MultiNest output. Eur. Phys. J. Plus 131, 391 (2016).

    Google Scholar 

  68. Scott, P. pippi — painless parsing, post-processing and plotting of posterior and likelihood samples. Eur. Phys. J. Plus 127, 138 (2012).

    Google Scholar 

  69. Lewis, A. GetDist: a Python package for analysing Monte Carlo samples. Preprint at https://arxiv.org/abs/1910.13970 (2019).

  70. Foreman-Mackey, D. corner.py: scatterplot matrices in Python. J. Open. Source Softw. 1, 24 (2016).

    ADS  Google Scholar 

  71. Bocquet, S. & Carter, F. W. pygtc: beautiful parameter covariance plots (aka. giant triangle confusograms). J. Open Source Software https://doi.org/10.21105/joss.00046 (2016).

    Article  Google Scholar 

  72. Feroz, F., Hobson, M. P. & Bridges, M. MultiNest: an efficient and robust Bayesian inference tool for cosmology and particle physics. Mon. Not. R. Astron. Soc. 398, 1601–1614 (2009).

    ADS  Google Scholar 

  73. Feroz, F., Hobson, M. P., Cameron, E. & Pettitt, A. N. Importance nested sampling and the MultiNest algorithm. Open. J. Astrophys. 2, 10 (2019).

    Google Scholar 

  74. Beaujean, F. & Caldwell, A. Initializing adaptive importance sampling with Markov chains. Preprint at https://arxiv.org/abs/1304.7808 (2013).

  75. Rosenbrock, H. H. An automatic method for finding the greatest or least value of a function. Computer J. 3, 175–184 (1960).

    MathSciNet  Google Scholar 

  76. Higson, E. nestcheck: error analysis, diagnostic tests and plots for nested sampling calculations. J. Open. Source Softw. 3, 916 (2018).

    ADS  Google Scholar 

  77. Fowlie, A., Handley, W. & Su, L. Nested sampling cross-checks using order statistics. Mon. Not. R. Astron. Soc. 497, 5256–5263 (2020). This work identifies a previously unused property of nested sampling and shows how it can be used to test individual nested sampling runs.

    ADS  Google Scholar 

  78. Williams, M. J. nessai: nested sampling with artificial intelligence. zenodo https://doi.org/10.5281/zenodo.4550693 (2021).

    Article  Google Scholar 

  79. Williams, M. J., Veitch, J. & Messenger, C. Nested sampling with normalizing flows for gravitational-wave inference. Phys. Rev. D. 103, 103006 (2021).

    ADS  MathSciNet  Google Scholar 

  80. Stokes, B., Tuyl, F. & Hudson, I. in Bayesian Inference and Maximum Entropy Methods in Science and Engineering MAXENT 2015 (eds Goffin, A. & Knuth, K. H.) (AIP, 2016).

  81. Stokes, B. J. New Prior Sampling Methods and Equidistribution Testing for Nested Sampling. PhD thesis, Univ. Newcastle (2018).

  82. Romero-Shaw, I. M. et al. Bayesian inference for compact binary coalescences with BILBY: validation and application to the first LIGO–Virgo gravitational-wave transient catalogue. Mon. Not. R. Astron. Soc. 499, 3295–3319 (2020).

    ADS  Google Scholar 

  83. Henderson, R. W., Goggans, P. M. & Cao, L. Combined-chain nested sampling for efficient Bayesian model comparison. Digit. Signal. Process. 70, 84–93 (2017).

    Google Scholar 

  84. Russel, P. M., Brewer, B. J., Klaere, S. & Bouckaert, R. R. Model selection and parameter inference in phylogenetics using nested sampling. Syst. Biol. 68, 219–233 (2019).

    Google Scholar 

  85. Pullen, N. & Morris, R. J. Bayesian model comparison and parameter inference in systems biology using nested sampling. PLoS ONE 9, e88419 (2014).

    ADS  Google Scholar 

  86. Mikelson, J. & Khammash, M. Likelihood-free nested sampling for parameter inference of biochemical reaction networks. PLoS Comput. Biol. 16, e1008264 (2020).

    ADS  Google Scholar 

  87. Beaton, D. & Xiang, N. Room acoustic modal analysis using Bayesian inference. J. Acoust. Soc. Am. 141, 4480–4493 (2017).

    ADS  Google Scholar 

  88. Van Soom, M. & de Boer, B. Detrending the waveforms of steady-state vowels. Entropy 22, 331 (2020).

    ADS  MathSciNet  Google Scholar 

  89. Lewis, S., Ireland, D. & Vanderbauwhede, W. Development of Bayesian analysis program for extraction of polarisation observables at CLAS. J. Phys. Conf. Ser. 513, 022020 (2014).

    Google Scholar 

  90. Ozturk, F. C. et al. New test of modulated electron capture decay of hydrogen-like 142Pm ions: precision measurement of purely exponential decay. Phys. Lett. B 797, 134800 (2019).

    Google Scholar 

  91. Trassinelli, M. et al. Measurement of the charged pion mass using X-ray spectroscopy of exotic atoms. Phys. Lett. B 759, 583–588 (2016).

    ADS  Google Scholar 

  92. Trassinelli, M. Bayesian data analysis tools for atomic physics. Nucl. Instrum. Meth. B 408, 301–312 (2017).

    ADS  Google Scholar 

  93. Covita, D. S. et al. Line shape analysis of the Kβ transition in muonic hydrogen. Eur. Phys. J. D. 72, 72 (2018).

    ADS  Google Scholar 

  94. De Anda Villa, M. et al. Assessing the surface oxidation state of free-standing gold nanoparticles produced by laser ablation. Langmuir 35, 11859–11871 (2019).

    Google Scholar 

  95. Machado, J. et al. High-precision measurements of n = 2 → n = 1 transition energies and level widths in He- and Be-like argon ions. Phys. Rev. A 97, 032517 (2018).

    ADS  Google Scholar 

  96. Brewer, B. J. & Donovan, C. P. Fast Bayesian inference for exoplanet discovery in radial velocity data. Mon. Not. R. Astron. Soc. 448, 3206–3214 (2015).

    ADS  Google Scholar 

  97. Lavie, B. et al. HELIOS-RETRIEVAL: an open-source, nested sampling atmospheric retrieval code; application to the HR 8799 exoplanets and inferred constraints for planet formation. AJ 154, 91 (2017).

    ADS  Google Scholar 

  98. Hall, R. D., Thompson, S. J., Handley, W. & Queloz, D. On the feasibility of intense radial velocity surveys for earth-twin discoveries. Mon. Not. R. Astron. Soc. 479, 2968–2987 (2018).

    ADS  Google Scholar 

  99. Kitzmann, D. et al. Helios-r2: a new Bayesian, open-source retrieval model for brown dwarfs and exoplanet atmospheres. ApJ 890, 174 (2020).

    ADS  Google Scholar 

  100. Ahrer, E. et al. The HARPS search for southern extra-solar planets — XLV. Two Neptune mass planets orbiting HD 13808: a study of stellar activity modelling’s impact on planet detection. Mon. Not. R. Astron. Soc. 503, 1248–1263 (2021).

    ADS  Google Scholar 

  101. Elsheikh, A. H., Wheeler, M. F. & Hoteit, I. Nested sampling algorithm for subsurface flow model selection, uncertainty quantification, and nonlinear calibration. Water Resour. Res. 49, 8383–8399 (2013).

    Google Scholar 

  102. Trotta, R. Bayes in the sky: Bayesian inference and model selection in cosmology. Contemp. Phys. 49, 71–104 (2008).

    ADS  Google Scholar 

  103. Spergel, D. N. et al. First-year Wilkinson Microwave Anisotropy Probe (WMAP) observations: determination of cosmological parameters. Astrophys. J. Suppl. Ser. 148, 175–194 (2003).

    ADS  Google Scholar 

  104. Riess, A. G. et al. Observational evidence from supernovae for an accelerating universe and a cosmological constant. Astro. J. 116, 1009–1038 (1998).

    ADS  Google Scholar 

  105. Perlmutter, S. et al. Measurements of Ω and λ from 42 high-redshift supernovae. Ap. J. 517, 565–586 (1999).

    ADS  MATH  Google Scholar 

  106. Guth, A. H. Inflationary universe: a possible solution to the horizon and flatness problems. Phys. Rev. D. 23, 347–356 (1981).

    ADS  MATH  Google Scholar 

  107. Liddle, A. R., Parsons, P. & Barrow, J. D. Formalizing the slow-roll approximation in inflation. Phys. Rev. D. 50, 7222–7232 (1994).

    ADS  Google Scholar 

  108. Martin, J., Ringeval, C. & Trotta, R. Hunting down the best model of inflation with Bayesian evidence. Phys. Rev. D. 83, 063524 (2011).

    ADS  Google Scholar 

  109. Allen, S. W., Schmidt, R. W. & Fabian, A. C. Cosmological constraints from the X-ray gas mass fraction in relaxed lensing clusters observed with chandra. Mon. Not. R. Astron. Soc. 334, L11–L15 (2002).

    ADS  Google Scholar 

  110. Allen, S. W., Evrard, A. E. & Mantz, A. B. Cosmological parameters from observations of galaxy clusters. Annu. Rev. Astron. Astrophys. 49, 409–470 (2011).

    ADS  Google Scholar 

  111. Feroz, F., Hobson, M. P., Zwart, J. T. L., Saunders, R. D. E. & Grainge, K. J. B. Bayesian modelling of clusters of galaxies from multifrequency-pointed Sunyaev–Zel’dovich observations. Mon. Not. R. Astron. Soc. 398, 2049–2060 (2009).

    ADS  Google Scholar 

  112. Hurley-Walker, N. et al. Bayesian analysis of weak gravitational lensing and Sunyaev–Zel’dovich data for six galaxy clusters. Mon. Not. R. Astron. Soc. 419, 2921–2942 (2011).

    Google Scholar 

  113. Joudaki, S. et al. KiDS+VIKING-450 and DES-Y1 combined: cosmology with cosmic shear. AA 638, L1 (2020).

    ADS  Google Scholar 

  114. DES Collaboration. Dark Energy Survey year 1 results: cosmological constraints from galaxy clustering and weak lensing. Phys. Rev. D. 98, 043526 (2018).

    ADS  Google Scholar 

  115. Asgari, M. et al. KiDS-1000 cosmology: cosmic shear constraints and comparison between two point statistics. AA 645, A104 (2021).

    ADS  Google Scholar 

  116. Handley, W. & Lemos, P. Quantifying tensions in cosmological parameters: interpreting the DES evidence ratio. Phys. Rev. D 100, 043504 (2019).

    ADS  MathSciNet  Google Scholar 

  117. Conley, A. et al. Supernova constraints and systematic uncertainties from the first 3 years of the supernova legacy survey. Astrophys. J. 192, 1 (2011).

    Google Scholar 

  118. March, M. C., Trotta, R., Berkes, P., Starkman, G. D. & Vaudrevange, P. M. Improved constraints on cosmological parameters from type Ia supernova data. Mon. Not. R. Astron. Soc. 418, 2308–2329 (2011).

    ADS  Google Scholar 

  119. Planck Collaboration. Planck 2013 results. I. Overview of products and scientific results. AA 571, A1 (2014).

    ADS  Google Scholar 

  120. Handley, W. J., Hobson, M. P. & Lasenby, A. N. PolyChord: nested sampling for cosmology. Mon. Not. R. Astron. Soc. 450, L61–L65 (2015). This work opens up high-dimensional problems with slice-sampling implementation of nested sampling.

    ADS  Google Scholar 

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

    Google Scholar 

  122. Planck Collaboration. Planck 2015 results. XX. Constraints on inflation. AA 594, A20 (2016).

    ADS  Google Scholar 

  123. Handley, W. J., Lasenby, A. N., Peiris, H. V. & Hobson, M. P. Bayesian inflationary reconstructions from Planck 2018 data. Phys. Rev. D. 100, 103511 (2019).

    ADS  Google Scholar 

  124. Hergt, L. T., Handley, W. J., Hobson, M. P. & Lasenby, A. N. Constraining the kinetically dominated universe. Phys. Rev. D. 100, 023501 (2019).

    ADS  MathSciNet  Google Scholar 

  125. Gessey-Jones, T. & Handley, W. J. Constraining quantum initial conditions before inflation. Phys. Rev. D. 104, 063532 (2021).

    ADS  MathSciNet  Google Scholar 

  126. Zhao, G.-B. et al. Dynamical dark energy in light of the latest observations. Nat. Astron. 1, 627–632 (2017).

    ADS  Google Scholar 

  127. Hee, S., Vázquez, J. A., Handley, W. J., Hobson, M. P. & Lasenby, A. N. Constraining the dark energy equation of state using Bayes theorem and the Kullback–Leibler divergence. Mon. Not. R. Astron. Soc. 466, 369–377 (2017).

    ADS  Google Scholar 

  128. Higson, E., Handley, W., Hobson, M. & Lasenby, A. Bayesian sparse reconstruction: a brute-force approach to astronomical imaging and machine learning. Mon. Not. R. Astron. Soc. 483, 4828–4846 (2019).

    ADS  Google Scholar 

  129. Renk, J. J. et al. CosmoBit: a GAMBIT module for computing cosmological observables and likelihoods. J. Cosmology Astropart. Phys. https://doi.org/10.1088/1475-7516/2021/02/022 (2021).

    Article  Google Scholar 

  130. Stöcker, P. et al. Strengthening the bound on the mass of the lightest neutrino with terrestrial and cosmological experiments. Phys. Rev. D. 103, 123508 (2021).

    ADS  Google Scholar 

  131. Anstey, D., de Lera Acedo, E. & Handley, W. A general Bayesian framework for foreground modelling and chromaticity correction for global 21cm experiments. Mon. Not. R. Astron. Soc. 506, 2041–2058 (2021).

    ADS  Google Scholar 

  132. Martin, S. P. A supersymmetry primer. Adv. Ser. Direct. High. Energy Phys. 18, 1–98 (1998).

    ADS  MATH  Google Scholar 

  133. de Austri, R. R., Trotta, R. & Roszkowski, L. A Markov chain Monte Carlo analysis of the CMSSM. J. High Energy Phys. 05, 002 (2006).

    Google Scholar 

  134. Trotta, R., Feroz, F., Hobson, M. P., Roszkowski, L. & de Austri, R. R. The impact of priors and observables on parameter inferences in the constrained MSSM. J. High Energy Phys. 12, 024 (2008).

    ADS  Google Scholar 

  135. Feroz, F., Cranmer, K., Hobson, M., de Austri, R. R. & Trotta, R. Challenges of profile likelihood evaluation in multidimensional SUSY scans. J. High Energy Phys. 06, 042 (2011).

    ADS  MATH  Google Scholar 

  136. Trotta, R. et al. Constraints on cosmic-ray propagation models from a global Bayesian analysis. Astrophys. J. 729, 106 (2011).

    ADS  Google Scholar 

  137. AbdusSalam, S. S., Allanach, B. C., Quevedo, F., Feroz, F. & Hobson, M. Fitting the phenomenological MSSM. Phys. Rev. D. 81, 095012 (2010).

    ADS  Google Scholar 

  138. Strege, C. et al. Updated global fits of the cMSSM including the latest LHC SUSY and Higgs searches and XENON100 data. J. Cosmol. Astropart. Phys. 03, 030 (2012).

    ADS  Google Scholar 

  139. Buchmueller, O. et al. The CMSSM and NUHM1 after LHC run 1. Eur. Phys. J. C 74, 2922 (2014).

    ADS  Google Scholar 

  140. Fowlie, A. et al. The CMSSM favoring new territories: the impact of new LHC limits and a 125 GeV Higgs. Phys. Rev. D. 86, 075010 (2012).

    ADS  Google Scholar 

  141. Fowlie, A., Kowalska, K., Roszkowski, L., Sessolo, E. M. & Tsai, Y.-L. S. Dark matter and collider signatures of the MSSM. Phys. Rev. D. 88, 055012 (2013).

    ADS  Google Scholar 

  142. Catena, R. & Gondolo, P. Global fits of the dark matter–nucleon effective interactions. J. Cosmol. Astropart. Phys. 09, 045 (2014).

    ADS  Google Scholar 

  143. de Vries, K. J. et al. The pMSSM10 after LHC run 1. Eur. Phys. J. C. 75, 422 (2015).

    ADS  Google Scholar 

  144. Hernández, P., Kekic, M., López-Pavón, J., Racker, J. & Salvado, J. Testable baryogenesis in seesaw models. J. High Energy Phys. 08, 157 (2016).

    ADS  Google Scholar 

  145. Kreisch, C. D., Cyr-Racine, F.-Y. & Doré, O. Neutrino puzzle: anomalies, interactions, and cosmological tensions. Phys. Rev. D. 101, 123505 (2020).

    ADS  Google Scholar 

  146. Martinez, G. et al. Comparison of statistical sampling methods with scannerbit, the GAMBIT scanning module. Eur. Phys. J. C 77, 761 (2017).

    ADS  Google Scholar 

  147. Balázs, C. et al. A comparison of optimisation algorithms for high-dimensional particle and astrophysics applications. J. High Energy Phys. 05, 108 (2021).

    ADS  Google Scholar 

  148. Fowlie, A., Hoof, S. & Handley, W. Nested sampling for frequentist computation: fast estimation of small p-values. Phys. Rev. Lett. 128, 021801 (2022).

    ADS  MathSciNet  Google Scholar 

  149. Abbott, B. P. et al. Observation of gravitational waves from a binary black hole merger. Phys. Rev. Lett. 116, 061102 (2016).

    ADS  MathSciNet  Google Scholar 

  150. Aasi, J. et al. Advanced LIGO. Class. Quant. Grav. 32, 074001 (2015).

    ADS  Google Scholar 

  151. Acernese, F. et al. Advanced Virgo: a second-generation interferometric gravitational wave detector. Class. Quant. Grav. 32, 024001 (2015).

    ADS  Google Scholar 

  152. Abbott, R. et al. GWTC-3: compact binary coalescences observed by LIGO and Virgo during the second part of the third observing run. Preprint at https://arxiv.org/abs/2111.03606 (2021).

  153. Veitch, J. & Vecchio, A. A Bayesian approach to the follow-up of candidate gravitational wave signals. Phys. Rev. D. 78, 022001 (2008).

    ADS  Google Scholar 

  154. Abbott, B. P. et al. Model comparison from LIGO–Virgo data on GW170817’s binary components and consequences for the merger remnant. Class. Quant. Grav. 37, 045006 (2020).

    ADS  Google Scholar 

  155. Smith, R. J. E., Ashton, G., Vajpeyi, A. & Talbot, C. Massively parallel Bayesian inference for transient gravitational-wave astronomy. Mon. Not. R. Astron. Soc. 498, 4492–4502 (2020).

    ADS  Google Scholar 

  156. Pitkin, M., Isi, M., Veitch, J. & Woan, G. A nested sampling code for targeted searches for continuous gravitational waves from pulsars. Preprint at https://arxiv.org/abs/1705.08978 (2017).

  157. Abbott, B. P. et al. Searches for gravitational waves from known pulsars at two harmonics in 2015–2017 LIGO data. Ap. J. 879, 10 (2019).

    ADS  Google Scholar 

  158. Lynch, R., Vitale, S., Essick, R., Katsavounidis, E. & Robinet, F. Information-theoretic approach to the gravitational-wave burst detection problem. Phys. Rev. D. 95, 104046 (2017).

    ADS  Google Scholar 

  159. Powell, J., Gossan, S. E., Logue, J. & Heng, I. S. Inferring the core-collapse supernova explosion mechanism with gravitational waves. Phys. Rev. D. 94, 123012 (2016).

    ADS  Google Scholar 

  160. Smith, R. & Thrane, E. Optimal search for an astrophysical gravitational-wave background. Phys. Rev. X 8, 021019 (2018).

    Google Scholar 

  161. Futamase, T. & Itoh, Y. The post-Newtonian approximation for relativistic compact binaries. Living Rev. Relativ. 10, 2 (2007).

    ADS  MATH  Google Scholar 

  162. Blanchet, L. Gravitational radiation from post-Newtonian sources and inspiralling compact binaries. Living Rev. Relativ. 17, 2 (2014).

    ADS  MATH  Google Scholar 

  163. Hannam, M. Modelling gravitational waves from precessing black-hole binaries: progress, challenges and prospects. Gen. Relativ. Gravit. 46, 1767 (2014).

    ADS  MathSciNet  MATH  Google Scholar 

  164. Bishop, N. T. & Rezzolla, L. Extraction of gravitational waves in numerical relativity. Living Rev. Relativ. 19, 2 (2016).

    ADS  MATH  Google Scholar 

  165. Baiotti, L. Gravitational waves from neutron star mergers and their relation to the nuclear equation of state. Prog. Part. Nucl. Phys. 109, 103714 (2019).

    Google Scholar 

  166. Veitch, J. et al. Parameter estimation for compact binaries with ground-based gravitational-wave observations using the LALInference software library. Phys. Rev. D 91, 042003 (2015).

    ADS  Google Scholar 

  167. Cornish, N. J. et al. BayesWave analysis pipeline in the era of gravitational wave observations. Phys. Rev. D 103, 044006 (2021).

    ADS  MathSciNet  Google Scholar 

  168. Whittle, P. Curve and periodogram smoothing. J. R. Stat. Society: Ser. B 19, 38–63 (1957).

  169. Vitale, S. et al. Effect of calibration errors on Bayesian parameter estimation for gravitational wave signals from inspiral binary systems in the advanced detectors era. Phys. Rev. D 85, 064034 (2012).

    ADS  Google Scholar 

  170. Thrane, E. & Talbot, C. An introduction to Bayesian inference in gravitational-wave astronomy: parameter estimation, model selection, and hierarchical models. PASA 36, e010 (2019).

    ADS  Google Scholar 

  171. Callister, T. A. A thesaurus for common priors in gravitational-wave astronomy. Preprint at https://arxiv.org/abs/2104.09508 (2021).

  172. Szekeres, B., Pártay, L. B. & Mátyus, E. Direct computation of the quantum partition function by path-integral nested sampling. J. Chem. Theory Comput. 14, 4353–4359 (2018).

    Google Scholar 

  173. Sciortino, F., Kob, W. & Tartaglia, P. Thermodynamics of supercooled liquids in the inherent-structure formalism: a case study. J. Phys. Condens. Matt. 12, 6525–6534 (2000).

    ADS  Google Scholar 

  174. Wales, D. J. Surveying a complex potential energy landscape: overcoming broken ergodicity using basin-sampling. Chem. Phys. Lett. 584, 1–9 (2013).

    ADS  Google Scholar 

  175. Wales, D. J. Energy Landscapes (Cambridge Univ. Press, 2003).

  176. Wales, D. J. & Bogdan, T. V. Potential energy and free energy landscapes. J. Phys. Chem. B 110, 20765–20776 (2006).

    Google Scholar 

  177. Becker, O. M. & Karplus, M. The topology of multidimensional potential energy surfaces: theory and application to peptide structure and kinetics. J. Chem. Phys. 106, 1495–1517 (1997).

    ADS  Google Scholar 

  178. Wales, D. J., Miller, M. A. & Walsh, T. R. Archetypal energy landscapes. Nature 394, 758–760 (1998).

    ADS  Google Scholar 

  179. Krivov, S. V. & Karplus, M. Free energy disconnectivity graphs: application to peptide models. J. Chem. Phys. 117, 10894–10903 (2002).

    ADS  Google Scholar 

  180. Evans, D. A. & Wales, D. J. Free energy landscapes of model peptides and proteins. J. Chem. Phys. 118, 3891–3897 (2003).

    ADS  Google Scholar 

  181. Li, Z. & Scheraga, H. A. Monte Carlo-minimization approach to the multiple-minima problem in protein folding. Proc. Natl Acad. Sci. USA 84, 6611–6615 (1987).

    ADS  MathSciNet  Google Scholar 

  182. Wales, D. J. & Doye, J. P. K. Global optimization by basin-hopping and the lowest energy structures of lennard-jones clusters containing up to 110 atoms. J. Phys. Chem. A 101, 5111–5116 (1997).

    Google Scholar 

  183. Wales, D. J. & Scheraga, H. A. Global optimization of clusters, crystals and biomolecules. Science 285, 1368–1372 (1999).

    Google Scholar 

  184. Martiniani, S., Stevenson, J. D., Wales, D. J. & Frenkel, D. Superposition enhanced nested sampling. Phys. Rev. X 4, 031034 (2014).

    Google Scholar 

  185. Bolhuis, P. G. & Csányi, G. Nested transition path sampling. Phys. Rev. Lett. 120, 250601 (2018).

    ADS  MathSciNet  Google Scholar 

  186. Murray, I., MacKay, D. J. C., Ghahramani, Z. & Skilling, J. in Proc. 18th Int. Conf. Neural Information Processing Systems (eds Weiss, Y., Schölkopf, B. & Platt, J.) 947–954 (MIT Press, 2005).

  187. Pfeifenberger, M. J., Rumetshofer, M. & von der Linden, W. Nested sampling, statistical physics and the Potts model. J. Comput. Phys. 375, 368–392 (2018).

    ADS  MathSciNet  MATH  Google Scholar 

  188. Pártay, L. B., Bartók, A. P. & Csányi, G. Nested sampling for materials: the case of hard spheres. Phys. Rev. E 89, 022302 (2014).

    ADS  Google Scholar 

  189. Wilson, B. A., Gelb, L. D. & Nielsen, S. O. Nested sampling of isobaric phase space for the direct evaluation of the isothermal–isobaric partition function of atomic systems. J. Chem. Phys. 143, 154108 (2015).

    ADS  Google Scholar 

  190. Bartók, A. P., Hantal, G. & Pártay, L. B. Insight into liquid polymorphism from the complex phase behavior of a simple model. Phys. Rev. Lett. 127, 015701 (2021).

    ADS  Google Scholar 

  191. Baldock, R. J. N., Bernstein, N., Salerno, K. M., Pártay, L. B. & Csányi, G. Constant-pressure nested sampling with atomistic dynamics. Phys. Rev. E 96, 43311–43324 (2017).

    ADS  Google Scholar 

  192. Dorrell, J. & Pártay, L. B. Pressure–temperature phase diagram of lithium, predicted by embedded atom model potentials. J. Phys. Chem. B 124, 6015–6023 (2020).

    Google Scholar 

  193. Pártay, L. B. On the performance of interatomic potential models of iron: comparison of the phase diagrams. Comput. Mater. Sci. 149, 153–157 (2018).

    Google Scholar 

  194. Deringer, V. L. et al. Gaussian process regression for materials and molecules. Chem. Rev. 121, 10073–10141 (2021). PMID: 34398616.

    Google Scholar 

  195. Rosenbrock, C. W. et al. Machine-learned interatomic potentials for alloys and alloy phase diagrams. npj Comp. Mat 7, 24 (2021).

    Google Scholar 

  196. Pártay, L. B., Csányi, G. & Bernstein, N. Nested sampling for materials. Eur. Phys. J. B 94, 159 (2021).

    ADS  Google Scholar 

  197. Wilkinson, M. D. et al. The FAIR guiding principles for scientific data management and stewardship. Sci. Data 3, 160018 (2016).

    Google Scholar 

  198. Hergt, L. T., Handley, W. J., Hobson, M. P. & Lasenby, A. N. Bayesian evidence for the tensor-to-scalar ratio r and neutrino masses mν: effects of uniform vs logarithmic priors. Phys. Rev. D 103, 123511 (2021).

    ADS  Google Scholar 

  199. Alsing, J. & Handley, W. Nested sampling with any prior you like. Mon. Not. R. Astron. Soc. 505, L95–L99 (2021).

    ADS  Google Scholar 

  200. Murray, I. Advances in Markov Chain Monte Carlo Methods. PhD Thesis, Univ. College London (2007).

  201. Riley, T. E. Neutron Star Parameter Estimation from a NICER Perspective. PhD Thesis, Anton Pannekoek Institute for Astronomy (2019).

  202. Schittenhelm, D. & Wacker, P. Nested sampling and likelihood plateaus. Preprint at https://arxiv.org/abs/2005.08602 (2020).

  203. Fowlie, A., Handley, W. & Su, L. Nested sampling with plateaus. Mon. Not. R. Astron. Soc. 503, 1199–1205 (2021).

    ADS  Google Scholar 

  204. Lewis, A. Efficient sampling of fast and slow cosmological parameters. Phys. Rev. D. 87, 103529 (2013).

    ADS  Google Scholar 

  205. Lewis, A. & Bridle, S. Cosmological parameters from CMB and other data: a Monte Carlo approach. Phys. Rev. D. 66, 103511 (2002).

    ADS  Google Scholar 

  206. Chen, X., Hobson, M., Das, S. & Gelderblom, P. Improving the efficiency and robustness of nested sampling using posterior repartitioning. Stat. Comput. 29, 835–850 (2019).

    MathSciNet  MATH  Google Scholar 

  207. Chen, X., Feroz, F. & Hobson, M. Bayesian automated posterior repartitioning for nested sampling. Preprint at https://arxiv.org/abs/1908.04655 (2019).

  208. Akrami, Y., Scott, P., Edsjo, J., Conrad, J. & Bergstrom, L. A profile likelihood analysis of the constrained MSSM with genetic algorithms. J. High Energy Phys. 04, 057 (2010).

    ADS  MATH  Google Scholar 

  209. Brewer, B. J. & Foreman-Mackey, D. DNest4: diffusive nested sampling in C++ and Python. J. Stat. Softw. 86, 1–33 (2018).

    Google Scholar 

  210. Corsaro, E. & De Ridder, J. DIAMONDS: a new Bayesian nested sampling tool. European Physical Journal Web of Conferences https://doi.org/10.1051/epjconf/201510106019 (2015).

  211. Barbary, K. Nestle: pure Python, MIT-licensed implementation of nested sampling algorithms for evaluating Bayesian evidence. GitHub https://github.com/kbarbary/nestle (2018).

  212. Trassinelli, M. The Nested_fit data analysis program. MDPI Proc. 33, 14 (2019).

    Google Scholar 

  213. Trassinelli, M. & Ciccodicola, P. Mean shift cluster recognition method implementation in the nested sampling algorithm. Entropy 22, 185 (2020).

    ADS  MathSciNet  Google Scholar 

  214. Veitch, J. et al. johnveitch/cpnest: release 0.10.2. zenodo https://doi.org/10.5281/zenodo.592884 (2017).

    Article  Google Scholar 

  215. Moss, A. Accelerated Bayesian inference using deep learning. Mon. Not. R. Astron. Soc. 496, 328–338 (2020).

    ADS  Google Scholar 

  216. Kester, D. & Mueller, M. BayesicFitting, a PYTHON toolbox for Bayesian fitting and evidence calculation: including a nested sampling implementation. Astronomy and Computing 37, 100503 (2021).

    Google Scholar 

  217. Buchner, J. UltraNest — a robust, general purpose Bayesian inference engine. J. Open. Source Softw. 6, 3001 (2021).

    ADS  Google Scholar 

  218. Albert, J. G. JAXNS: a high-performance nested sampling package based on JAX. Preprint at https://arxiv.org/abs/2012.15286 (2020).

  219. Handley, W. Curvature tension: evidence for a closed universe. Phys. Rev. D 103, L041301 (2021).

    ADS  MathSciNet  Google Scholar 

  220. Abbott, B. P. et al. GW151226: observation of gravitational waves from a 22-solar-mass binary black hole coalescence. Phys. Rev. Lett. 116, 241103 (2016).

    ADS  Google Scholar 

  221. Wales, D. J. The energy landscape as a unifying theme in molecular science. Phil. Trans. R. Soc. A 363, 357–377 (2005).

    ADS  Google Scholar 

  222. van de Schoot, R. et al. Bayesian statistics and modelling. Nat. Rev. Methods Primers 1, 1 (2021).

    Google Scholar 

  223. D’Agostini, G. Bayesian Reasoning In Data Analysis: A Critical Introduction (World Scientific, 2003).

  224. Gregory, P. Bayesian Logical Data Analysis for the Physical Sciences (Cambridge Univ. Press, 2005).

  225. von der Linden, W., Dose, V. & von Toussaint, U. Bayesian Probability Theory: Applications in the Physical Sciences (Cambridge University Press, 2014).

  226. Bailer-Jones, C. A. L. Practical Bayesian Inference: A Primer for Physical Scientists (Cambridge Univ. Press, 2017).

  227. Embrechts, P. & Hofert, M. A note on generalized inverses. Math. Methods Oper. Res. 77, 423–432 (2013).

    MathSciNet  MATH  Google Scholar 

  228. de la Fortelle, A. A study on generalized inverses and increasing functions Part I: generalized inverses. HAL https://hal.archives-ouvertes.fr/hal-01255512 (2015).

  229. Cérou, F., Moral, P., Furon, T. & Guyader, A. Sequential Monte Carlo for rare event estimation. Stat. Comput. 22, 795–808 (2012).

    MathSciNet  MATH  Google Scholar 

  230. Creutz, M. Microcanonical Monte Carlo simulation. Phys. Rev. Lett. 50, 1411 (1983).

    ADS  MathSciNet  Google Scholar 

  231. Wang, F. & Landau, D. P. Efficient, multiple-range random walk algorithm to calculate the density of states. Phys. Rev. Lett. 86, 2050–2053 (2001).

    ADS  Google Scholar 

Download references

Acknowledgements

The authors thank J. Skilling for his wonderful algorithm. The success of nested sampling may be that simple beats clever; but the beauty of nested sampling is that it is both simple and clever. They thank K. Barbary for discussions. A.F. was supported by a National Natural Science Foundation of China (NSFC) Research Fund for International Young Scientists (grant 11950410509). L.B.P. acknowledges support from the Engineering and Physical Sciences Research Council (EPSRC) through an Early Career Fellowship (EP/T000163/1). M. Habeck acknowledges support from the Carl Zeiss Foundation. N.B. was funded by the US Naval Research Laboratory’s base 6.1 research program, and CPU time from the US Department of Defence (DoD) High Performance Computing Modernization Program Office (HPCMPO) at the Air Force Research Laboratory (AFRL) and Army Research Laboratory (ARL) DoD Supercomputing Research Centers (DSRCs). M.P. acknowledges support from the Science and Technology Facilities Council (STFC) (ST/V001213/1 and ST/V005707/1). W.H. was supported by a Royal Society University Research Fellowship.

Author information

Authors and Affiliations

Authors

Contributions

Introduction (A.F., M. Habeck, D.S., L.S. and P.W.); Experimentation (J.B., E.H. and J.S.S.); Results (A.F.); Applications (G.A., N.B., X.C., G.C., F.a.F., M.G., M. Habeck, M. Hobson, W.H., A.L., L.B.P., M.P., D.P., J. V., D.J.W. and D.Y.); Reproducibility and data deposition (A.F.); Limitations and optimizations (A.F.); Outlook (A.F.); Overview of the Primer (A.F.).

Corresponding author

Correspondence to Andrew Fowlie.

Ethics declarations

Competing interests

The authors declare no competing interests.

Peer review

Peer review information

Nature Reviews Methods Primers thanks Roberto Trotta and the other, anonymous, reviewer(s) for their contribution to the peer review of this work.

Additional information

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Related links

anesthetic: https://github.com/williamjameshandley/anesthetic

dynesty: https://github.com/joshspeagle/dynesty

dyPolyChord: https://github.com/ejhigson/dyPolyChord

MultiNest: https://github.com/farhanferoz/MultiNest

nestcheck: https://github.com/ejhigson/nestcheck

nessai: https://github.com/mj-will/nessai

PolyChord: https://github.com/PolyChord/PolyChordLite

Supplementary information

Glossary

Markov chain Monte Carlo

A class of algorithms for drawing a correlated sequence of samples from a distribution using the states of a Markov chain.

Multimodal

Refers to problems in which the integrand contains more than one mode. In inference problems, modes may correspond to distinct ways in which the model could predict the observed data.

Integrands

Functions that are being integrated.

Prior

A probability density that is not yet conditioned on observed data. In nested sampling, it is a measure in our integral.

Likelihood

The probability of the observed data as a function of a model’s parameters.

Evidence

A factor in Bayes’ theorem that may be written as an integral and that plays an important role in Bayesian model comparison. In nested sampling, this is the multidimensional integral we wish to compute.

Posterior

A probability density conditioned on the observed data found by updating a prior using Bayes’ theorem. In nested sampling, it describes the shape of our integrand.

Bayesian model comparison

A method for comparing models based on computing the change in their relative plausibility in light of data using Bayes’ theorem.

Curse of dimensionality

The phenomenon that the difficulty of a problem often increases dramatically with dimension.

Unimodal

Problems in which the integrand contains only one mode.

Constrained prior

The prior for the parameters restricted to the region in which the likelihood exceeds a threshold.

Bulk

A region with size of order eH, where H is the Kullback–Leibler divergence, that contains the overwhelming majority of the posterior mass. Closely related to typical sets. Usually, the bulk will not lie near the mode of the posterior, especially in high dimensions.

Tractable

An adjective used to describe problems that are feasible to solve under computational, monetary or time constraints.

Markov chain

A sequence of random states for which the probability of a state depends only on the previous state.

Measure

A probability measure is a function assigning probabilities to events.

Kullback–Leibler divergence

(H). A measure of difference between two distributions that may be interpreted as the information gained by switching from one to the other.

Modes

Peaks in a probability distribution.

Parameter domain

The set of a priori possible parameters, usually the reals Rn or a subset thereof.

Overloaded

A function with a definition that depends on the type of its argument. In nested sampling, the likelihood L is an overloaded function as we consider separate functions L(θ) and L(X).

Survival function

A function F(x) associated with a distribution that returns the probability of obtaining a sample greater than x.

Super-level sets

A λ-super-level set of any function contains all points for which the function value exceeds λ.

Push-forward measure

(Also known as image measure). The distribution of a random variable under a probability measure.

Transition kernels

Functions that describe the likely steps of a Markov chain.

Iso-likelihood contour

The set of points for which the likelihood is equal to a particular constant; in two dimensions, this set forms a contour line.

Bootstrapping

Refers to techniques that estimate statistical variation by repeatedly drawing samples from the true data set with replacement.

Indicator function

A function that takes the value one if a condition holds, and zero otherwise.

Partition function

A normalizing constant that fully characterizes a physical system, because many important thermodynamic variables can be derived from it.

Insertion indexes

The indexes at which the elements of a list must be inserted into an ordered list to maintain ordering.

Simulation-based calibration

Techniques that use simulations from the model to check the correctness of Bayesian computation.

Microstate

The state of all degrees of freedom in a physical system; for example, the microstate of a multi-particle system includes the positions and momenta of all particles.

Microcanonical ensemble

Assigns equal probability to states Θ with E(Θ) = ε and zero probability otherwise, such that the energy level ε rather than the inverse temperature β characterizes a thermodynamic state.

Pseudo-importance sampling

Using algorithms in which an importance sampling density is defined a posteriori.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Ashton, G., Bernstein, N., Buchner, J. et al. Nested sampling for physical scientists. Nat Rev Methods Primers 2, 39 (2022). https://doi.org/10.1038/s43586-022-00121-x

Download citation

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1038/s43586-022-00121-x

This article is cited by

Search

Quick links

Nature Briefing

Sign up for the Nature Briefing newsletter — what matters in science, free to your inbox daily.

Get the most important science stories of the day, free in your inbox. Sign up for Nature Briefing