API
Temper samplers
MCMCTempering.tempered
— Functiontempered(sampler, inverse_temperatures; kwargs...)
OR
-tempered(sampler, num_temps; swap_strategy=ReversibleSwap(), kwargs...)
Return a tempered version of sampler
using the provided inverse_temperatures
or inverse temperatures generated from num_temps
and the swap_strategy
.
Arguments
sampler
is an algorithm or sampler object to be used for underlying sampling and to apply tempering to- The temperature schedule can be defined either explicitly or just as an integer number of temperatures, i.e. as:
inverse_temperatures
containing a sequence of 'inverse temperatures' {β₀, ..., βₙ} where 0 ≤ βₙ < ... < β₁ < β₀ = 1 ORnum_temps
, specifying the integer number of inverse temperatures to include in a generatedinverse_temperatures
Keyword arguments
swap_strategy::AbstractSwapStrategy
specifies the method for swapping inverse temperatures between chainssteps_per_swap::Integer
steps are carried out between each attempt at a swap
See also
TemperedSampler
- For more on the swap strategies:
MCMCTempering.TemperedSampler
— TypeTemperedSampler <: AbstractMCMC.AbstractSampler
A TemperedSampler
struct wraps a sampler upon which to apply the Parallel Tempering algorithm.
Fields
sampler
: sampler(s) used to target the tempered distributionschain_to_beta
: collection of inverse temperatures β; β[i] correponds i-th tempered modelswapstrategy
: strategy to use for swappingadapt
: boolean flag specifying whether or not to adaptadaptation_states
: adaptation parameters
Under the hood, MCMCTempering.TemperedSampler
is actually just a "fancy" representation of a composition (represented using a MCMCTempering.CompositionSampler
) of a MCMCTempering.MultiSampler
and a MCMCTempering.SwapSampler
.
Roughly speaking, the implementation of AbstractMCMC.step
for MCMCTempering.TemperedSampler
is basically
# 1. Construct the tempered models.
+tempered(sampler, num_temps; swap_strategy=ReversibleSwap(), kwargs...)
Return a tempered version of sampler
using the provided inverse_temperatures
or inverse temperatures generated from num_temps
and the swap_strategy
.
Arguments
sampler
is an algorithm or sampler object to be used for underlying sampling and to apply tempering to- The temperature schedule can be defined either explicitly or just as an integer number of temperatures, i.e. as:
inverse_temperatures
containing a sequence of 'inverse temperatures' {β₀, ..., βₙ} where 0 ≤ βₙ < ... < β₁ < β₀ = 1 ORnum_temps
, specifying the integer number of inverse temperatures to include in a generatedinverse_temperatures
Keyword arguments
swap_strategy::AbstractSwapStrategy
specifies the method for swapping inverse temperatures between chainssteps_per_swap::Integer
steps are carried out between each attempt at a swap
See also
TemperedSampler
- For more on the swap strategies: