bilby.core.sampler.dynesty3_utils.BaseEnsembleSampler
- class bilby.core.sampler.dynesty3_utils.BaseEnsembleSampler(**kwargs)[source]
Bases:
InternalSampler
- __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)Sample a new live point.
tune
(tuning_info[, update])Accumulate sampling info and optionally update the proposal scale and other tuning parameters.
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]
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=False)[source]
Accumulate sampling info and optionally update the proposal scale and other tuning parameters.
- Parameters:
- tuning_infodict
Dictionary containing the sampling information.
- updatebool
Whether to update the proposal scale or not (default: False).
- 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