cuqi.testproblem.Poisson1D.sample_posterior#
- Poisson1D.sample_posterior(Ns, Nb=None, callback=None, experimental=False)#
Sample the posterior. Sampler choice and tuning is handled automatically.
- Parameters:
Ns (int) – Number of samples to draw.
Nb (int or None, Optional) – Number of burn-in samples. If not provided, 20% of the samples will be used for burn-in.
callback (callable, Optional) – If set this function will be called after every sample. The signature of the callback function is callback(sample, sample_index), where sample is the current sample and sample_index is the index of the sample. An example is shown in demos/demo31_callback.py. Note: if the parameter experimental is set to True, the callback function should take three arguments: the sampler object, the index of the current sampling step, the total number of requested samples. The last two arguments are integers. An example of the callback function signature in the case is: callback(sampler, sample_index, num_of_samples).
experimental (bool, Optional) – If set to True, the sampler selection will use the samplers from the
cuqi.experimental.mcmc
module.
- Returns:
samples – Samples from the posterior.
- Return type: