pub struct RunningStats { /* private fields */ }Expand description
Welford’s online mean/variance accumulator: numerically stable for long streams and mergeable across partial results.
Implementations§
Source§impl RunningStats
impl RunningStats
pub fn new() -> Self
pub fn push(&mut self, x: f64)
Sourcepub fn merge(&mut self, other: &RunningStats)
pub fn merge(&mut self, other: &RunningStats)
Merge another accumulator (parallel reduction).
pub fn count(&self) -> usize
pub fn mean(&self) -> f64
Sourcepub fn variance(&self) -> f64
pub fn variance(&self) -> f64
Population variance (divide by n, matching mean_std_err).
pub fn std_err(&self) -> f64
pub fn stats(&self) -> SimStats
Trait Implementations§
Source§impl Clone for RunningStats
impl Clone for RunningStats
Source§fn clone(&self) -> RunningStats
fn clone(&self) -> RunningStats
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for RunningStats
Source§impl Debug for RunningStats
impl Debug for RunningStats
Source§impl Default for RunningStats
impl Default for RunningStats
Source§fn default() -> RunningStats
fn default() -> RunningStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RunningStats
impl RefUnwindSafe for RunningStats
impl Send for RunningStats
impl Sync for RunningStats
impl Unpin for RunningStats
impl UnsafeUnpin for RunningStats
impl UnwindSafe for RunningStats
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more