Skip to main content

metropolis_hastings

Function metropolis_hastings 

Source
pub fn metropolis_hastings<F>(
    log_density: F,
    initial: &[f64],
    proposal_std: f64,
    n_samples: usize,
    burn_in: usize,
    seed: u64,
) -> McmcResult
where F: Fn(&[f64]) -> f64,
Expand description

Random-walk Metropolis-Hastings. log_density(x) returns the target’s log-density (up to a constant) at a dim-vector; initial is the starting point; proposal_std the per-dimension Gaussian step; n_samples post-burn-in draws; burn_in discarded warm-up steps. Deterministic given seed.