pub trait DivergenceInfo: AsSampleStatVec + Debug + Send {
    fn start_location(&self) -> Option<&[f64]>;
    fn end_location(&self) -> Option<&[f64]>;
    fn energy_error(&self) -> Option<f64>;
    fn end_idx_in_trajectory(&self) -> Option<i64>;
    fn start_idx_in_trajectory(&self) -> Option<i64>;
    fn logp_function_error(&self) -> Option<&dyn Error>;
}
Expand description

Details about a divergence that might have occured during sampling

There are two reasons why we might observe a divergence:

  • The integration error of the Hamiltonian is larger than a cutoff value or nan.
  • The logp function caused a recoverable error (eg if an ODE solver failed)

Required Methods

The position in parameter space where the diverging leapfrog started

The position in parameter space where the diverging leapfrog ended

The difference between the energy at the initial location of the trajectory and the energy at the end of the diverging leapfrog step.

This is not available if the divergence was caused by a logp function error

The index of the end location of the diverging leapfrog.

The index of the start location of the diverging leapfrog.

Return the logp function error that caused the divergence if there was any

This is not available if the divergence was cause because of a large energy difference.

Implementors