#[non_exhaustive]pub enum StatsError {
NotEnoughData {
sample: &'static str,
required: usize,
found: usize,
},
LengthMismatch {
first: usize,
second: usize,
},
ProbabilityOutOfRange {
value: f64,
},
NotFinite {
sample: &'static str,
index: usize,
value: f64,
},
ParameterNotFinite {
parameter: &'static str,
value: f64,
},
NonPositiveExpected {
index: usize,
value: f64,
},
InvalidDegreesOfFreedom {
freedom: f64,
},
NonPositiveParameter {
parameter: &'static str,
value: f64,
},
RankDeficientDesign,
DidNotConverge {
iterations: usize,
},
}Expand description
Errors reported by the checked (try_*) entry points of this crate.
Every panicking convenience wrapper (for example mean)
simply unwraps its try_* twin, so a panic message is always the
Display text of one of these variants.
Degenerate — but well defined — results are not errors. A sample with
zero variance, or a perfectly flat predictor, yields a documented
NaN/infinite statistic rather than an Err; see the individual
functions for the exact convention.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotEnoughData
The sample held fewer observations than the statistic requires.
Fields
LengthMismatch
Two paired inputs had different lengths.
ProbabilityOutOfRange
A quantile probability was outside [0, 1] (or NaN).
NotFinite
An observation was NaN or infinite.
Fields
ParameterNotFinite
A scalar parameter (such as a hypothesised mean) was NaN or infinite.
NonPositiveExpected
An expected cell count was zero or negative, so the chi-squared statistic would divide by zero.
InvalidDegreesOfFreedom
The degrees of freedom implied by the inputs are not a usable distribution parameter (not finite, or not strictly positive).
NonPositiveParameter
A scalar parameter that must be strictly positive (such as a kernel bandwidth) was zero or negative.
RankDeficientDesign
The regression design matrix does not have full column rank, so the coefficients are not identified.
DidNotConverge
An iterative fit did not settle within its iteration budget.
Trait Implementations§
Source§impl Clone for StatsError
impl Clone for StatsError
impl Copy for StatsError
Source§impl Debug for StatsError
impl Debug for StatsError
Source§impl Display for StatsError
impl Display for StatsError
Source§impl Error for StatsError
impl Error for StatsError
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()