Trait nuts_rs::Chain

source ·
pub trait Chain {
    type Hamiltonian: Hamiltonian;
    type AdaptStrategy: AdaptStrategy;
    type Stats: SampleStats;

    fn set_position(&mut self, position: &[f64]) -> Result<(), NutsError>;
    fn draw(&mut self) -> Result<(Box<[f64]>, Self::Stats), NutsError>;
    fn dim(&self) -> usize;
}
Expand description

Draw samples from the posterior distribution using Hamiltonian MCMC.

Required Associated Types§

Required Methods§

Initialize the sampler to a position. This should be called before calling draw.

This fails if the logp function returns an error.

Draw a new sample and return the position and some diagnosic information.

The dimensionality of the posterior.

Implementors§