threeML.bayesian.sampler_base module

class threeML.bayesian.sampler_base.MCMCSampler(likelihood_model, data_list, **kwargs)[source]

Bases: threeML.bayesian.sampler_base.SamplerBase

class threeML.bayesian.sampler_base.SamplerBase(likelihood_model: astromodels.core.model.Model, data_list: threeML.data_list.DataList, **kwargs)[source]

Bases: object

get_posterior(trial_values)[source]

Compute the posterior for the normal sampler

property log_like_values

Returns the value of the log_likelihood found by the bayesian sampler while samplin g from the posterior. If you need to find the values of the parameters which generated a given value of the log. likelihood, remember that the samples accessible through the property .raw_samples are ordered in the same way as the vector returned by this method.

Returns

a vector of log. like values

property log_marginal_likelihood

Return the log marginal likelihood (evidence) if computed :return:

property log_probability_values

Returns the value of the log_probability (posterior) found by the bayesian sampler while sampling from the posterior. If you need to find the values of the parameters which generated a given value of the log. likelihood, remember that the samples accessible through the property .raw_samples are ordered in the same way as the vector returned by this method.

Returns

a vector of log probabilty values

property raw_samples

Access the samples from the posterior distribution generated by the selected sampler in raw form (i.e., in the format returned by the sampler)

Returns

the samples as returned by the sampler

restore_median_fit()[source]

Sets the model parameters to the mean of the marginal distributions

property results
abstract sample()[source]
property samples

Access the samples from the posterior distribution generated by the selected sampler

Returns

a dictionary with the samples from the posterior distribution for each parameter

abstract setup()[source]
class threeML.bayesian.sampler_base.UnitCubeSampler(likelihood_model, data_list, **kwargs)[source]

Bases: threeML.bayesian.sampler_base.SamplerBase