bilby.core.sampler.dynesty3_utils.EnsembleWalkSampler
- class bilby.core.sampler.dynesty3_utils.EnsembleWalkSampler(**kwargs)[source]
Bases:
BaseEnsembleSampler
- __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.
prepare_sampler
([loglstar, points, axes, ...])Prepare the list of arguments for sampling.
sample
(args)Return a new live point proposed by random walking away from an existing live point.
tune
(tuning_info[, update])Update the proposal parameters based on the number of accepted steps and MCMC chain length.
Attributes
citations
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]
Return a new live point proposed by random walking away from an existing live point.
- Parameters:
- u~numpy.ndarray with shape (ndim,)
Position of the initial sample. This is a copy of an existing live point.
- loglstarfloat
Ln(likelihood) bound.
- axes~numpy.ndarray with shape (ndim, ndim)
Axes used to propose new points. For random walks new positions are proposed using the
Ellipsoid
whose shape is defined by axes.- scalefloat
Value used to scale the provided axes.
- 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.
- kwargsdict
A dictionary of additional method-specific parameters.
- 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.
- sampling_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