#[non_exhaustive]pub enum TimeSeriesError {
ValueNotFinite {
index: usize,
},
TooFewObservations {
needed: usize,
got: usize,
},
OptionOutOfRange {
option: &'static str,
got: f64,
min: f64,
max: f64,
},
NoVariation,
DegenerateRegression,
}Expand description
Why a time-series statistic was refused: crate::correlation::acf,
crate::correlation::pacf, crate::testing::adf_test and
crate::testing::kpss_test.
The data is checked before the options, and the options before any
computation: a refusal of an option never hides a refusal of the data,
and TimeSeriesError::NoVariation / TimeSeriesError::DegenerateRegression
only follow options that were in range.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ValueNotFinite
The series holds a NaN or an infinity.
TooFewObservations
Fewer observations than the statistic is defined for.
OptionOutOfRange
An option outside its domain, which depends on the number of
observations: min and max are both inclusive.
Fields
NoVariation
The series does not vary (about its level, or its trend, for the KPSS test) beyond the rounding of its own size, so the statistic divides by zero.
DegenerateRegression
The ADF test regression is singular, or fits the differences exactly (a deterministic series), so the t-ratio is undefined.
Implementations§
Source§impl TimeSeriesError
impl TimeSeriesError
Sourcepub fn out_of(
option: &'static str,
got: f64,
domain: &RangeInclusive<usize>,
) -> Self
pub fn out_of( option: &'static str, got: f64, domain: &RangeInclusive<usize>, ) -> Self
option set to got, outside domain – the refusal a caller that
reads the option itself (negative, or past what a count holds) gives
against a domain such as crate::correlation::acf_max_lag_domain.
Trait Implementations§
Source§impl Clone for TimeSeriesError
impl Clone for TimeSeriesError
impl Copy for TimeSeriesError
Source§impl Debug for TimeSeriesError
impl Debug for TimeSeriesError
Source§impl Display for TimeSeriesError
impl Display for TimeSeriesError
Source§impl Error for TimeSeriesError
impl Error for TimeSeriesError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()