bilby.bilby_mcmc.sampler.BilbyPTMCMCSampler

class bilby.bilby_mcmc.sampler.BilbyPTMCMCSampler(convergence_inputs, pt_inputs, proposal_cycle, pt_rejection_sample, pool, use_ratio, evidence_method, initial_sample_method, initial_sample_dict, normalize_prior=True)[source]

Bases: object

__init__(convergence_inputs, pt_inputs, proposal_cycle, pt_rejection_sample, pool, use_ratio, evidence_method, initial_sample_method, initial_sample_dict, normalize_prior=True)[source]
__call__(*args, **kwargs)

Call self as a function.

Methods

__init__(convergence_inputs, pt_inputs, ...)

adapt_temperatures()

Adapt the temperature of the chains

compute_evidence(outdir, label[, make_plots])

compute_evidence_per_ensemble(method, kwargs)

ensemble_step()

get_initial_betas()

sampler_list_by_column(column)

set_convergence_inputs(convergence_inputs)

set_pt_inputs(pt_inputs)

setup_sampler_dictionary(convergence_inputs, ...)

step_all_chains()

stepping_stone_evidence(ptchain, outdir, label)

Compute the evidence using the stepping stone approximation.

swap_tempered_chains()

thermodynamic_integration_evidence(ptchain, ...)

Computes the evidence using thermodynamic integration

Attributes

evaluations

ln_z

ln_z_err

minimum_index

nsamples

nsamples_last

nsamples_nocache

position

primary_sampler

rejection_sampling_count

sampler_list

A list of all individual samplers

sampler_list_of_tempered_lists

samples

tau

tempered_sampler_list

zerotemp_sampler_list

adapt_temperatures()[source]

Adapt the temperature of the chains

Using the dynamic temperature selection described in arXiv:1501.05823, adapt the chains to target a constant swap ratio. This method is based on github.com/willvousden/ptemcee/tree/master/ptemcee

property sampler_list

A list of all individual samplers

stepping_stone_evidence(ptchain, outdir, label, make_plots=True)[source]

Compute the evidence using the stepping stone approximation.

See https://arxiv.org/abs/1810.04488 and https://pubmed.ncbi.nlm.nih.gov/21187451/ for details.

The uncertainty calculation is hopefully combining the evidence in each of the steps.

Returns:
ln_z: float

Estimate of the natural log evidence

ln_z_err: float

Estimate of the uncertainty in the evidence

thermodynamic_integration_evidence(ptchain, outdir, label, make_plots=True)[source]

Computes the evidence using thermodynamic integration

We compute the evidence without the burnin samples, no thinning