Skip to contents

Generate new live points by evolving a current live point through a random walk with a fixed number of steps and an adaptive step size.

Usage

rwmh_cube(steps = 25, target_acceptance = 0.5)

Arguments

steps

Positive integer. Number of steps to take when generating a proposal point.

target_acceptance

Double between 1 / steps and 1.0. The target acceptance rate for the proposed points.

Value

A list with class c("rwmh_cube", "ernest_lrps"). Can be used with ernest_sampler() to specify the sampling behaviour of a nested sampling run.

Details

Calling update_lrps() builds a new proposal distribution based on the acceptance rate of the previous run. The step size \(\epsilon\) is updated using a Newton-like method, where the current acceptance rate \(a_{cur}\) is used to target the acceptance rate \(a^*\): $$\epsilon_{new} = \epsilon_{old} * \exp((a_{cur} - a^*)/(n_{dim} * a^*))$$

References

  • Skilling, J. (2006). Nested Sampling for General Bayesian Computation. Bayesian Analysis, 1(4), 833–859. https://doi.org/10.1214/06-BA127

  • Speagle, J. S. (2020). Dynesty: A Dynamic Nested Sampling Package for Estimating Bayesian Posteriors and Evidences. Monthly Notices of the Royal Astronomical Society, 493, 3132–3158. https://doi.org/10.1093/mnras/staa278

Examples

data(example_run)
lrps <- rwmh_cube()

ernest_sampler(example_run$log_lik_fn, example_run$prior, sampler = lrps)
#> Nested sampling specification <ernest_sampler>
#> No. Points: 500
#> 
#> ── Sampling Method 
#> • Random Walk in Unit Cube LRPS <rwmh_cube/ernest_lrps>
#> • No. Dimensions: 3
#> • No. Calls Since Update: 0
#> • No. Accepted Since Update: 0
#> • Current Step Size: 1

# Change the default behaviour of the sampler:
rwmh_cube(steps = 20, target_acceptance = 0.4)
#> Random Walk in Unit Cube LRPS <rwmh_cube/ernest_lrps>
#> No. Dimensions: Uninitialized
#> No. Calls Since Update: 0
#> No. Accepted Since Update: 0
#> Current Step Size: 1