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§
type AdaptStrategy: AdaptStrategy<M>
Required Methods§
Sourcefn set_position(&mut self, position: &[f64]) -> Result<()>
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.
Sourcefn draw(&mut self) -> Result<(Box<[f64]>, Progress)>
fn draw(&mut self) -> Result<(Box<[f64]>, Progress)>
Draw a new sample and return the position and some diagnosic information.