Samplers
This module facilitates the definition of arbitrary Bayesian sampling criteria. In BayesBay, the specific actions undertaken by a Markov chain at each iteration are handled by a Sampler
instance. These actions encompass, for example, state initializations, management of Markov chain temperature, adjustment of the standard deviation of the Gaussians used to perturb the free parameters under inference, etc.
A Sampler
instance allows the user to insert callback functions at either the beginning or the end of a Markov chain iteration, and even to customize complex sampling behaviors such as those involving interactions between different Markov chains that are run in parallel. (This capability is leveraged in our implementation of parallel tempering.) Furthermore, through the insertion of callback functions, users can augment our predefined classes (listed below) with their own, integrating custom functionalities seamlessly.
graph TD; Sampler-->VanillaSampler; Sampler-->ParallelTempering; Sampler-->SimulatedAnnealing;
Low-level class for defining the sampling criterion of a Markov chain and/or modifying its attributes in-between iterations |
|
High-level class to be used to sample the posterior by means of reversible-jump Markov chain Monte Carlo. |
|
High-level class to be used to sample the posterior by means of reversible-jump Markov chain Monte Carlo accelerated with parallel tempering. |
|
High-level class to be used to sample the posterior by means of reversible-jump Markov chain Monte Carlo accelerated with simulated annealing. |
To use a specific Sampler
for sampling a posterior distribution, initialise it and pass it to the appropriate argument in BayesBay.BayesianInversion.run()
. Most examples in this documentation make use of VanillaSampler
, which is the default. Examples using SimulatedAnnealing
include: