Struct stats::OnlineStats
source · pub struct OnlineStats { /* private fields */ }
Expand description
Online state for computing mean, variance and standard deviation.
Implementations§
source§impl OnlineStats
impl OnlineStats
sourcepub fn new() -> OnlineStats
pub fn new() -> OnlineStats
Create initial state.
Population size, variance and mean are set to 0
.
sourcepub fn from_slice<T: ToPrimitive>(samples: &[T]) -> OnlineStats
pub fn from_slice<T: ToPrimitive>(samples: &[T]) -> OnlineStats
Initializes variance from a sample.
sourcepub fn add<T: ToPrimitive>(&mut self, sample: T)
pub fn add<T: ToPrimitive>(&mut self, sample: T)
Add a new sample.
Trait Implementations§
source§impl Clone for OnlineStats
impl Clone for OnlineStats
source§fn clone(&self) -> OnlineStats
fn clone(&self) -> OnlineStats
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Commute for OnlineStats
impl Commute for OnlineStats
source§impl Debug for OnlineStats
impl Debug for OnlineStats
source§impl Default for OnlineStats
impl Default for OnlineStats
source§fn default() -> OnlineStats
fn default() -> OnlineStats
Returns the “default value” for a type. Read more
source§impl<T: ToPrimitive> Extend<T> for OnlineStats
impl<T: ToPrimitive> Extend<T> for OnlineStats
source§fn extend<I: IntoIterator<Item = T>>(&mut self, it: I)
fn extend<I: IntoIterator<Item = T>>(&mut self, it: I)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl<T: ToPrimitive> FromIterator<T> for OnlineStats
impl<T: ToPrimitive> FromIterator<T> for OnlineStats
source§fn from_iter<I: IntoIterator<Item = T>>(it: I) -> OnlineStats
fn from_iter<I: IntoIterator<Item = T>>(it: I) -> OnlineStats
Creates a value from an iterator. Read more