Chain

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;
    fn expanded_draw(
        &mut self,
    ) -> Result<(Box<[f64]>, M::ExpandedVector, Self::Stats, Progress)>;
    fn math(&self) -> Ref<'_, M>;
}
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.

Source

fn expanded_draw( &mut self, ) -> Result<(Box<[f64]>, M::ExpandedVector, Self::Stats, Progress)>

Source

fn math(&self) -> Ref<'_, M>

Implementors§