Papers
Topics
Authors
Recent
Assistant
AI Research Assistant
Well-researched responses based on relevant abstracts and paper content.
Custom Instructions Pro
Preferences or requirements that you'd like Emergent Mind to consider when generating responses.
GPT-5.1
GPT-5.1 104 tok/s
Gemini 3.0 Pro 36 tok/s Pro
Gemini 2.5 Flash 133 tok/s Pro
Kimi K2 216 tok/s Pro
Claude Sonnet 4.5 37 tok/s Pro
2000 character limit reached

Dynamic Nested Sampling for Bayesian Inference

Updated 15 November 2025
  • Dynamic Nested Sampling is an adaptive Bayesian technique that varies the number of live points to optimally balance evidence and posterior estimation.
  • It employs importance functions and iterative batch strategies, such as snowballing, to focus computational effort on high-impact regions in the parameter space.
  • This approach enhances statistical efficiency and reduces likelihood evaluations, often achieving significant speedups and improved diagnostic stability.

Dynamic Nested Sampling (DNS) is a class of algorithms that generalize the classic nested sampling approach for Bayesian evidence computation and posterior inference by adaptively varying the number of live points (“particles”) during sampling. DNS optimally allocates computational resources to regions of the parameter space where they most reduce uncertainty in the evidence or posterior estimates. Unlike classic (static) nested sampling, which uses a fixed number of live points throughout a run, DNS dynamically increases or redistributes live points during the calculation, leading to improved statistical efficiency and, in some formulations such as snowballing nested sampling, more stable diagnostics and simplified calibration.

1. Principles of Nested Sampling and the Motivation for Dynamic Variants

Standard nested sampling, as introduced by Skilling (2004), is designed to estimate the Bayesian evidence

Z=ΘL(θ)π(θ)dθZ = \int_{\Theta} L(\theta)\,\pi(\theta)\,\mathrm{d}\theta

where π(θ)\pi(\theta) is the prior and L(θ)L(\theta) the likelihood. The algorithm maintains KK live points sampled under the likelihood constraint L>LminL > L_{\min}, and at each iteration removes the lowest-likelihood point and replaces it with a new sample satisfying the constraint. Evidence and posterior samples are then constructed from the sequence of “dead” points, with weights determined by prior volume shrinkage, Xi=exp(i/K)X_i = \exp(-i/K).

In static NS, the number of live points KK is fixed throughout the run. However, posterior mass L(X)X\propto L(X) X concentrates sharply in log-prior volume, causing static NS to distribute dead points inefficiently—over-sampling regions that are largely irrelevant for either evidence or posterior estimation. Increasing KK improves evidence accuracy but at the cost of exponentially more likelihood evaluations before reaching posterior-dominated regions. Conversely, small KK accelerates reaching the posterior peak but sacrifices evidence accuracy, creating an unavoidable trade-off. DNS was introduced to resolve this inefficiency by reactively or proactively altering KK during the run (Higson et al., 2017, Buchner, 2021, Speagle, 2019, Buchner, 2023).

2. Dynamic Allocation Strategies

DNS operates by allocating live points where they are most informative for the statistical quantity of interest, which may be Bayesian evidence, posterior moments, or a user-defined composite objective. This is typically realized as follows:

  • Importance Functions: Live point allocation is guided by an importance or utility function I(X)I(X), such as

I(X)=fIpost(X)+(1f)Iev(X)I(X) = f I_{\rm post}(X) + (1-f) I_{\rm ev}(X)

with Ipost(X)=p(θ)L(X)X/ZI_{\rm post}(X) = p(\theta)\propto L(X)X/Z for posterior accuracy, and Iev(X)I_{\rm ev}(X) for evidence. Parameter f[0,1]f\in[0,1] trades off between posterior and evidence accuracy (Speagle, 2019, Higson et al., 2017, Buchner, 2021). Dead points (removed samples) are ranked by their importance, and intervals in XX or likelihood space with high II are targeted for increased live point density.

  • Iterative Batch Growth: After an initial static NS run with a minimal KbaseK_{\rm base}, the importance profile is estimated; new static NS “batches” with higher KbatchK_{\rm batch} are launched targeting specific likelihood intervals, and their dead points merged with the global run, updating the volume and weight estimates. This process is repeated until stopping criteria are met (Speagle, 2019, Higson et al., 2017).
  • Incremental and Uniform Growth (Snowballing): Snowballing nested sampling (SNS) (Buchner, 2023) eschews local reallocation and instead uniformly and incrementally increases KK over all levels (“snowballing”). The method fixes the MCMC chain length MM and adds batches of ΔK\Delta K new live points at each extension, resuming the NS run while memoizing any repeated MCMC likelihood-restricted prior sampling (LRPS) to maximize efficiency.

The table below contrasts core strategies in DNS implementations:

Variant Live Point Allocation Targeted Region
DNS (Higson et al.) I(X)I(X) adaptive Posterior/evidence
SNS Uniform ΔK\Delta K increments All levels (global)

3. Algorithmic Formulations and Pseudocode

DNS frameworks can be formalized as agents operating on the breadth-first search (BFS) formulation of nested sampling, in which each node represents a sample with likelihood LL, and branches correspond to replacement operations (Buchner, 2021). The difference between static and dynamic versions is the live point spawning rule—static agents always replace each dead node with one child, while dynamic agents add children adaptively.

Canonical iterative batch-based DNS pseudocode (in the style of (Speagle, 2019, Higson et al., 2017)):

1
2
3
4
5
6
7
run static NS (K_base); record {θ_i, L_i, X_i, w_i}
while not converged:
    Compute importance I_i for all dead points
    For indices with I_i > threshold:
        Run static NS batch with K_batch in corresponding L-interval
        Merge batch dead points into global {θ_i, L_i, X_i, w_i}
    Update convergence/termination criteria

The SNS pseudocode (Buchner, 2023) is conceptually even simpler:

1
2
3
4
5
K = K0; run NS(K, M) # initial run with K0 live points, M MCMC steps
while not converged:
    K = K + ΔK
    resume NS(K, M), memoizing LRPS(L_min) calls
    output updated Z, posterior samples

Theoretical properties ensure that, under exact LRPS sampling, both adaptive and uniform-KK growth asymptotically recover unbiased evidence and posterior estimates as KK\to\infty or MM\to\infty (Buchner, 2023).

4. Implementation, Diagnostics, and Error Estimation

Efficient DNS implementations address two key challenges: (1) accurate and efficient LRPS and (2) robust convergence monitoring. Popular approaches for LRPS include multi-ellipsoid decomposition (Speagle, 2019), overlapping balls (Speagle, 2019), multivariate slice sampling (Buchner, 2023, Speagle, 2019), and Hamiltonian slice (Speagle, 2019). For high-dimensional or degenerate targets, Hamiltonian slice or adaptation-free multivariate slice sampling is preferred due to robustness and scaling properties.

Monitoring and error estimation utilize standard NS variance theory, augmented with the following:

  • Standard Error Estimates: Posterior and evidence error estimates are derived from the variance of log-volumes and resampling replicates, as in Skilling (2006) and its generalizations (Speagle, 2019, Higson et al., 2017).
  • Bootstrapped Volumes: Randomized shrinkage, e.g., XiBeta(1,K)X_i \sim \text{Beta}(1, K), allows bootstrap estimation of uncertainties (Buchner, 2021).
  • K-fold Subsampling: Removing root branches and re-estimating ZZ for ensemble error bars (Buchner, 2021).
  • MCMC Diagnostics: Acceptance fraction and effective sample size (ESS) per LRPS chain (Buchner, 2023). If diagnostics indicate poor mixing, practitioners may pause snowballing and increase MM.
  • Insertion Rank Test: Statistical test (Wilcoxon–Mann–Whitney U or KS-test) on insertion ranks detects non-uniformity in LRPS, providing real-time guarantee of sample independence (Buchner, 2021).

A summary of recommended, data-based parameter choices is given below:

Parameter Guideline
K0K_0 (init. live points) max(10,d)\max(10, d); check mode discovery
MM (MCMC steps) 10×d10\times d
ΔK\Delta K (SNS) K0\sim K_0 per increment
ff (DNS, post/evidence) $0.8$ for balanced runs

5. Theoretical and Practical Performance

DNS achieves superior efficiency by concentrating sampling effort in posterior-dominated regions or intervals where evidence error is largest. Theoretical error analysis shows that with adaptive live point allocation, the variance in log-evidence scales as

Err[lnZ]iΔHiKi\mathrm{Err}[\ln Z] \approx \sqrt{\sum_i \frac{\Delta H_i}{K_i}}

where KiK_i is the live point number in bin ii and ΔHi\Delta H_i the partial relative Shannon information (Speagle, 2019, Higson et al., 2017). When KiK_i is increased in regions of large contribution to Var(Z)\mathrm{Var}(Z) or posterior moments, the overall variance is minimized for a given computational budget (Higson et al., 2017).

Empirical results include:

  • Speedup factors up to 72\sim 72 for parameter estimation and 7\sim 7 for evidence in high-dimensional Gaussian-like models, compared to static NS (Higson et al., 2017).
  • In practical astronomy problems, order-of-magnitude improvements in effective sample size (ESS) per likelihood call over vanilla MCMC and static NS (Speagle, 2019).
  • SNS provides monotonic improvement in evidence and posterior accuracy as KK grows, enabling continuous refinement without the need for KK or MM pre-tuning (Buchner, 2023).

DNS achieves significant reductions in the total number of likelihood evaluations required for a target precision, typically halving or thirding the evaluation count for moderate dimensions and high-information problems (Buchner, 2021).

6. Comparison of Dynamic Nested Sampling Variants

DNS encompasses several algorithmic formulations. Notable examples include:

  • Dynamic Nested Sampling (Higson et al.): Adapts KiK_i based on local importance, targeting evidence or posterior. Extensible to user-weighted objectives. Implemented in dynesty, dyPolyChord, and others (Higson et al., 2017, Speagle, 2019).
  • Snowballing Nested Sampling (SNS): Adds live points uniformly in batches, preserving standard NS diagnostics and error bars. No need for pre-tuned KK or MM. Easily overlays existing NS code. MCMC diagnostics guide adaptation of MM as needed (Buchner, 2023).
  • Diffusive Nested Sampling: Moves chains up and down in likelihood, accumulating samples across levels. Lacks built-in evidence error estimates (Buchner, 2023).

The main distinctions are summarized below:

Method Allocation Diagnostics Error Bars Suitability
DNS Local, importance-based Generalized (ESS, etc) Variance, bootstrap Posterior/evidence targeting
SNS Uniform increments Standard NS + MCMC Classic NS General, no pre-tuning, robust updates
Diffusive NS Level-spanning chains No ZZ error bars N/A Model exploration, not ZZ estimation

7. Implementation Guidance and Practical Considerations

DNS and SNS can be straightforwardly wrapped around or incorporated into existing NS codes with minimal overhead. Key points for successful application are:

  • Start with a small K0K_0 and moderate MM for rapid initial feedback; adapt as necessary based on convergence diagnostics.
  • For batch-incremental approaches, memoization of repeated LRPS calls efficiently reuses prior calculations (Buchner, 2023).
  • Always monitor chain mixing and ESS, especially as KK or MM are changed, to avoid bias in LRPS-derived samples.
  • SNS’s convergence can be monitored by stability of evidence estimates within Monte Carlo error bars; DNS by convergence of posterior/evidence stopping metrics.
  • Error estimation should involve both internal (bootstrap, volume resampling) and external (K-fold root branch removal) checks to ensure robust uncertainty quantification (Buchner, 2021).

While DNS approaches introduce more hyperparameters compared to static NS (e.g., batch size, importance weights, allocation strategy), their datadriven adjustability and extensibility enable practitioners to optimize performance for a wide array of Bayesian model inference tasks. DNS advances the field by allowing computational effort to be focused precisely where statistical uncertainty is greatest, rather than wasted in regions of negligible posterior or evidence contribution.

Forward Email Streamline Icon: https://streamlinehq.com

Follow Topic

Get notified by email when new papers are published related to Dynamic Nested Sampling.