bilby.core.sampler.dynesty3_utils.ACTTrackingEnsembleWalk

class bilby.core.sampler.dynesty3_utils.ACTTrackingEnsembleWalk(**kwargs)[source]

Bases: BaseEnsembleSampler

Run the MCMC sampler for many iterations in order to reliably estimate the autocorrelation time.

This builds a cache of nact / thin points consistent with the likelihood constraint. While this approach is the most robust, it is not well optimized for parallelised sampling as the length of the MCMC will be different for each parallel process.

__init__(**kwargs)[source]

Initialize the internal sampler.

Importantely this sets up the sampler_kwargs that is being passed to each .sample() call

Parameters:
kwargsdict

A dictionary of additional method-specific parameters. This common keywords:

nonboundedarray

Array of boolean values indicating which dimensions are non-bounded.

periodicarray

Array of boolean values indicating which dimensions are periodic.

reflectivearray

Array of boolean values indicating which dimensions are reflective.

ndim: int

Number of dimensions.

__call__(*args, **kwargs)

Call self as a function.

Methods

__init__(**kwargs)

Initialize the internal sampler.

build_cache(args)

integer_act(act)

prepare_sampler([loglstar, points, axes, ...])

Prepare the list of arguments for sampling.

sample(args)

Sample a new live point.

tune(tuning_info[, update])

Update the proposal parameters based on the number of accepted steps and MCMC chain length.

Attributes

citations

update_bound_interval_ratio

How often to force updating the bounds The value is in units of ncall per nlive.

prepare_sampler(loglstar=None, points=None, axes=None, seeds=None, prior_transform=None, loglikelihood=None, nested_sampler=None)[source]

Prepare the list of arguments for sampling.

Parameters:
loglstarfloat

Ln(likelihood) bound.

points~numpy.ndarray with shape (n, ndim)

Initial sample points.

axes~numpy.ndarray with shape (ndim, ndim)

Axes used to propose new points.

seeds~numpy.ndarray with shape (n,)

Random number generator seeds.

prior_transformfunction

Function transforming a sample from the a unit cube to the parameter space of interest according to the prior.

loglikelihoodfunction

Function returning ln(likelihood) given parameters as a 1-d ~numpy array of length ndim.

nested_sampler~dynesty.samplers.Sampler

The nested sampler object used to sample.

Returns:
arglist:

List of SamplerArgument objects containing the parameters needed for sampling.

static sample(args)[source]

Sample a new live point.

Parameters:
argsSamplerArgument

The arguments needed for sampling.

Returns:
u~numpy.ndarray with shape (ndim,)

Position of the final proposed point within the unit cube.

v~numpy.ndarray with shape (ndim,)

Position of the final proposed point in the target parameter space.

loglfloat

Ln(likelihood) of the final proposed point.

ncint

Number of function calls used to generate the sample.

tuning_infodict

Collection of ancillary quantities used to tune scale.

tune(tuning_info, update=True)[source]

Update the proposal parameters based on the number of accepted steps and MCMC chain length.

The walks parameter to asymptotically approach the desired number of accepted steps.

property update_bound_interval_ratio

How often to force updating the bounds The value is in units of ncall per nlive. I.e. the value of 10 means for N live points, the bound will be updated every 10 * N calls