Trait nuts_rs::DivergenceInfo
source · [−]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
sourcefn start_location(&self) -> Option<&[f64]>
fn start_location(&self) -> Option<&[f64]>
The position in parameter space where the diverging leapfrog started
sourcefn end_location(&self) -> Option<&[f64]>
fn end_location(&self) -> Option<&[f64]>
The position in parameter space where the diverging leapfrog ended
sourcefn energy_error(&self) -> Option<f64>
fn energy_error(&self) -> Option<f64>
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
sourcefn end_idx_in_trajectory(&self) -> Option<i64>
fn end_idx_in_trajectory(&self) -> Option<i64>
The index of the end location of the diverging leapfrog.
sourcefn start_idx_in_trajectory(&self) -> Option<i64>
fn start_idx_in_trajectory(&self) -> Option<i64>
The index of the start location of the diverging leapfrog.
sourcefn logp_function_error(&self) -> Option<&dyn Error>
fn logp_function_error(&self) -> Option<&dyn Error>
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.