Trait nuts_rs::SampleStats

source ·
pub trait SampleStats: Send + Debug {
    // Required methods
    fn depth(&self) -> u64;
    fn maxdepth_reached(&self) -> bool;
    fn index_in_trajectory(&self) -> i64;
    fn logp(&self) -> f64;
    fn energy(&self) -> f64;
    fn divergence_info(&self) -> Option<&DivergenceInfo>;
    fn chain(&self) -> u64;
    fn draw(&self) -> u64;
    fn gradient(&self) -> Option<&[f64]>;
    fn unconstrained(&self) -> Option<&[f64]>;
}
Expand description

Diagnostic information about draws and the state of the sampler for each draw

Required Methods§

source

fn depth(&self) -> u64

The depth of the NUTS tree that the draw was sampled from

source

fn maxdepth_reached(&self) -> bool

Whether the trajectory was stopped because the maximum size was reached.

source

fn index_in_trajectory(&self) -> i64

The index of the accepted sample in the trajectory

source

fn logp(&self) -> f64

The unnormalized posterior density at the draw

source

fn energy(&self) -> f64

The value of the hamiltonian of the draw

source

fn divergence_info(&self) -> Option<&DivergenceInfo>

More detailed information if the draw came from a diverging trajectory.

source

fn chain(&self) -> u64

An ID for the chain that the sample produce the draw.

source

fn draw(&self) -> u64

The draw number

source

fn gradient(&self) -> Option<&[f64]>

The logp gradient at the location of the draw. This is only stored if NutsOptions.store_gradient is true.

source

fn unconstrained(&self) -> Option<&[f64]>

The draw in the unconstrained space.

Implementors§