API
Temper samplers
MCMCTempering.tempered
— Functiontempered(sampler, inverse_temperatures; kwargs...)
+API · MCMCTempering
+
+
+
+
+
+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 generated inverse_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:
sourceMCMCTempering.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 distributions
chain_to_beta
: collection of inverse temperatures β; β[i] correponds i-th tempered model
swapstrategy
: strategy to use for swapping
adapt
: boolean flag specifying whether or not to adapt
adaptation_states
: adaptation parameters
sourceUnder 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.
multimodel = MultiModel([make_tempered_model(model, β) for β in tempered_sampler.chain_to_beta])
@@ -13,3 +471,4 @@
multi_sampler = sampler1 × sampler2 × sampler3 # or `MultiSampler((sampler1, sampler2, sampler3))`
# Target the joint model.
AbstractMCMC.step(rng, multi_model, multi_sampler)
sourcewhere the tempered models are represented using a MCMCTempering.MultiModel
MCMCTempering.MultiModel
— TypeMultiModel <: AbstractMCMC.AbstractModel
A MultiModel
is a container for multiple models.
See also: MultiSampler
.
Fields
models
: The models
sourceThe step
for a MCMCTempering.MultiSampler
and a [MCMCTempering.MultiModel
] is a transition of type MCMCTempering.MultipleTransitions
and a state of type MCMCTempering.MultipleStates
MCMCTempering.MultipleTransitions
— TypeMultipleTransitions
A container for multiple transitions.
See also: MultipleStates
.
Fields
transitions
: The transitions
sourceMCMCTempering.MultipleStates
— TypeMultipleStates
A container for multiple states.
See also: MultipleTransitions
.
Fields
states
: The states
source- SYED19Syed, S., Bouchard-Côté, Alexandre, Deligiannidis, G., & Doucet, A., Non-reversible Parallel Tempering: A Scalable Highly Parallel MCMC Scheme, arXiv:1905.02939, (2019).
- SYED19Syed, S., Bouchard-Côté, Alexandre, Deligiannidis, G., & Doucet, A., Non-reversible Parallel Tempering: A Scalable Highly Parallel MCMC Scheme, arXiv:1905.02939, (2019).
- PTPH05Earl, D. J., & Deem, M. W., Parallel tempering: theory, applications, and new perspectives, Physical Chemistry Chemical Physics, 7(23), 3910–3916 (2005).
- 1Malcolm Sambridge, A Parallel Tempering algorithm for probabilistic sampling and multimodal optimization, Geophysical Journal International, Volume 196, Issue 1, January 2014, Pages 357–374, https://doi.org/10.1093/gji/ggt342
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.11.0.
Getting started: a simple Mixture of Gaussians example
Suppose we have a mixture of Gaussians, e.g. something like
using Distributions
+Getting started: a simple Mixture of Gaussians example · MCMCTempering
+
+
+
+
+
+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,
[(-3, 1.5), (3, 1.5), (20, 1.5)], # parameters
@@ -184,3 +642,4 @@
end
density!(chain_tempered_all[1], color="green", size=figsize)
plot!(size=figsize)
Settings
This document was generated with Documenter.jl version 1.7.0 on Tuesday 8 October 2024. Using Julia version 1.11.0.
+
diff --git a/dev/index.html b/dev/index.html
index 7f3ad1b..eaf1610 100644
--- a/dev/index.html
+++ b/dev/index.html
@@ -1,2 +1,461 @@
-Home · MCMCTempering 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.
+Home · MCMCTempering
+
+
+
+
+
+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.
+
diff --git a/index.html b/index.html
index 1a6cc11..83aa121 100644
--- a/index.html
+++ b/index.html
@@ -1,2 +1,3 @@
+