MultilevelChainSamplers.jl

Table of contents

Table of contents

MCMC Sampler for multilevel delayed acceptance.

Usage

Proposal generators

List of built-in proposals

MultilevelChainSampler.ComponentwiseProposalType
ComponentwiseProposal(p...)

Component-wise proposal that samples each component independently. The proposal is symmetric if all components are symmetric. Like StackedProposal` but with different change sizes for each component.

Custom Proposal generator

To define a custom proposal inherit from the abstract type

struct MyProposal <: AbstractProposal{issymmetric::Bool}
    # ... 
end 
MultilevelChainSampler.proposeFunction
propose(p, [x])

Propose a new state from the proposal distribution p. If x is given, propose a new state from the proposal distribution p conditioned on x.

Implement the sampling methods

  • initialization x₀ ~ p₀(⋅) by x₀ = propose(p)
  • and transition y ~ q(⋅|x) by y = propose(p, x)
propose(rng::AbstractRNG, p::MyProposal) = ...
propose(rng::AbstractRNG, p::MyProposal, x) = ...

For symmetric proposals q(x|y) = q(y|x) and the likelihood ratio can be neglected. For asymmetric proposals also implement method for calculating q(y|x)

logpdf(p::AbstractProposal{false},x,y) = ...

Sampling

Implements the AbstractMCMC sampling interface.

More information can be found on the AbstractMCMC.jl documentation page.

In a nutshell the sampling function takes the form

sample(t::LogDensity, mh::Sampler, N_or_isdone, options...)

The target t is a logarithmic unnormalized probability density

MultilevelChainSampler.LogDensityType
LogDensity(d::Distribution)

Wrap a distribution as a log density model using the logpdf function.

LogDensity(f::Function)

Wrap a function as a unnormalized log density model.

In particular the options includes thread and process parallel sampling.

Metropolis Hastings (MH)

MultilevelChainSampler.MHType
MH(p::AbstractProposal; save_logprob=false, save_reject=false)

Metropolis Hastings sampler with proposal p.

  • save_logprob : saves target evaluations

  • save_reject : saves rejection status

Published in [1].

Multilevel Delayed Acceptance (MLDA)

Construct a multilevel proposal as vector of simple proposals.

MultilevelChainSampler.MLDAType
MLDA(p::Vector{<:AbstractProposal}, n::Vector{<:Union{Integer,Distribution}}; 
    save_logprob=false, save_reject=false, save_subchain=false)

Construct a multilevel delayed acceptance sampler from proposal vector p and subchain length vector n. They can either be fixed integers or distributions that are sampled at each iteration.

  • save_logprob : saves target evaluations

  • save_reject : saves rejection status

  • save_subchain : saves subchain samples

Published in [1].

Reference

Index

Citations

[1] Hastings, W.K. (1970). "Monte Carlo Sampling Methods Using Markov Chains and Their Applications". Biometrika, Volume 57, Issue 1
[2] Mikkel B. Lykkegaard, T. Dodwell, C. Fox, Grigorios Mingas, Robert Scheichl (2022). "Multilevel Delayed Acceptance MCMC" SIAM/ASA J. Uncertain. Quantification