pymecht.MCMC module

class pymecht.MCMC.MCMC(prob_func, params)[source]

Bases: object

A class for performing MCMC sampling of a given probability function based on SampleExperiment class object

Parameters:
  • prob_func (function) – A function that takes in a dictionary of parameters and returns a tuple of (probability, value)

  • params (ParamDict) – A dictionary of parameters to be varied

run(n)[source]

Run the MCMC sampling

Parameters:

n (int) – Number of MCMC iterations to perform (number of samples will be less than n due to rejection sampling)

Return type:

None

get_samples()[source]

Return the samples

get_samples_pandas()[source]

Return the samples as a pandas dataframe

get_probs()[source]

Return the probabilities

get_values()[source]

Return the values