Trait Chain

Source
pub trait Chain<M: Math>: SamplerStats<M> {
    type AdaptStrategy: AdaptStrategy<M>;

    // Required methods
    fn set_position(&mut self, position: &[f64]) -> Result<()>;
    fn draw(&mut self) -> Result<(Box<[f64]>, Progress)>;
    fn dim(&self) -> usize;
}
Expand description

Draw samples from the posterior distribution using Hamiltonian MCMC.

Required Associated Types§

Source

type AdaptStrategy: AdaptStrategy<M>

Required Methods§

Source

fn set_position(&mut self, position: &[f64]) -> Result<()>

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

This fails if the logp function returns an error.

Source

fn draw(&mut self) -> Result<(Box<[f64]>, Progress)>

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

Source

fn dim(&self) -> usize

The dimensionality of the posterior.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§