Trait nuts_rs::SampleStats
source · 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
sourcefn maxdepth_reached(&self) -> bool
fn maxdepth_reached(&self) -> bool
Whether the trajectory was stopped because the maximum size was reached.
sourcefn index_in_trajectory(&self) -> i64
fn index_in_trajectory(&self) -> i64
The index of the accepted sample in the trajectory
sourcefn divergence_info(&self) -> Option<&dyn DivergenceInfo>
fn divergence_info(&self) -> Option<&dyn DivergenceInfo>
More detailed information if the draw came from a diverging trajectory.
sourcefn gradient(&self) -> Option<&[f64]>
fn gradient(&self) -> Option<&[f64]>
The logp gradient at the location of the draw. This is only stored
if NutsOptions.store_gradient is true
.
sourcefn to_vec(&self) -> Vec<(&'static str, SampleStatValue)>
fn to_vec(&self) -> Vec<(&'static str, SampleStatValue)>
Export the sample statisitcs to a vector. This might include some additional diagnostics coming from the step size and matrix adaptation strategies.