pub fn metropolis_hastings<F, U>(
log_density: F,
initial: Vec<f64>,
options: MetropolisOptions,
rng: &mut U,
) -> Result<MarkovChain, ErrorsJSL>Expand description
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.