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.
diff --git a/dev/getting-started/index.html b/dev/getting-started/index.html
index 1d972cb..993e917 100644
--- a/dev/getting-started/index.html
+++ b/dev/getting-started/index.html
@@ -457,6 +457,7 @@
});
+
Getting started: a simple Mixture of Gaussians example
Suppose we have a mixture of Gaussians, e.g. something like
using Distributions
target_distribution = MixtureModel(
Normal,
diff --git a/dev/index.html b/dev/index.html
index eaf1610..8b6705a 100644
--- a/dev/index.html
+++ b/dev/index.html
@@ -457,5 +457,6 @@
});
+
MCMCTempering.jl
Tempering methods and more for Markov chain Monte Carlo methods.
MCMCTempering provides implementations of different ways to define tempered samplers and models, in addition to other ways of composing and mixing samplers.
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.11.0.