Skip to main content

Module mcmc

Module mcmc 

Source
Expand description

Markov chain Monte Carlo: random-walk Metropolis-Hastings.

See the book entry Markov chain Monte Carlo.

Structs§

MarkovChain
A Markov chain.
MetropolisOptions
Settings for metropolis_hastings.

Functions§

metropolis_hastings
Samples from the density proportional to exp(log_density(x)) by random-walk Metropolis-Hastings: propose x' = x + σ ⊙ z with z standard normal, accept with probability min(1, p(x')/p(x)). Only an unnormalised log-density is needed; returning −∞ marks points outside the support.