Expand description
Statistical analysis support for f32 on no_std, powered by embedded-stats-f32.
Provides batch statistics with compensated Kahan summation (mean, variance,
std_dev) and constant-memory streaming statistics with Welford’s algorithm
(StreamingStats), with zero heap allocation, zero libm, and fail-fast rejection
of NaN and ±inf values.
§Behavior & Notes
| Operation / Input | Behavior |
|---|---|
mean(&[f32]) | Arithmetic mean via Kahan summation (Result<f32, StatsError>) |
variance(&[f32]) | Population variance (divisor N) via Kahan (Result<f32, StatsError>) |
std_dev(&[f32]) | Standard deviation (sqrt(variance)) (Result<f32, StatsError>) |
StreamingStats::new() | Initializes O(1) memory streaming accumulator |
acc.update(x) | Updates state if finite; preserves state on Err(StatsError::NonFiniteValue) |
Empty slice / uninitialized StreamingStats | Returns Err(StatsError::EmptySlice) |
NaN or ±Infinity input/output | Returns Err(StatsError::NonFiniteValue) |
Structs§
- Streaming
Stats - Accumulateur de moyenne en ligne, O(1) mémoire.
Enums§
- Stats
Error - Erreurs EmptySlice et NonFiniteValue pour la roboustesse du systeme
Functions§
- kahan_
mean - Calcule la moyenne arithmétique d’une tranche
f32. - kahan_
std_ dev - Calcule l’écart type de population (= √variance) d’une tranche
f32. - kahan_
variance - Calcule la variance de population (non corrigée, diviseur N) d’une tranche
f32. - mean
- Computes the arithmetic mean of
sliceusing Kahan compensated summation. - std_dev
- Computes the population standard deviation of
slice. - variance
- Computes the population variance (divisor
N) ofsliceusing Kahan summation.