Expand description
Markov-Chain Monte Carlo (PRML ch 11) — random-walk Metropolis-Hastings over an
arbitrary (unnormalized) log-density. This is the general inference engine the
Bayesian methods lean on: give it log p(x) (up to a constant) and it returns
samples from p. Kernel-class Divergent (the accept/reject branch).
The target need only be specified up to a normalizing constant — the Metropolis
acceptance ratio exp(log p(x') − log p(x)) cancels it.
Structs§
- Mcmc
Result - Result of an MCMC run.
Functions§
- metropolis_
hastings - Random-walk Metropolis-Hastings.
log_density(x)returns the target’s log-density (up to a constant) at adim-vector;initialis the starting point;proposal_stdthe per-dimension Gaussian step;n_samplespost-burn-in draws;burn_indiscarded warm-up steps. Deterministic givenseed.