pub trait SampleStats: Send + Debug {
    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<&dyn DivergenceInfo>;
    fn chain(&self) -> u64;
    fn draw(&self) -> u64;
    fn gradient(&self) -> Option<&[f64]>;
    fn to_vec(&self) -> Vec<(&'static str, SampleStatValue)>;
}
Expand description

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

Required Methods

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

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

The index of the accepted sample in the trajectory

The unnormalized posterior density at the draw

The value of the hamiltonian of the draw

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

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

The draw number

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

Export the sample statisitcs to a vector. This might include some additional diagnostics coming from the step size and matrix adaptation strategies.

Implementors