Struct stats::OnlineStats [−][src]
pub struct OnlineStats { /* fields omitted */ }Online state for computing mean, variance and standard deviation.
Methods
impl OnlineStats[src]
impl OnlineStatspub fn new() -> OnlineStats[src]
pub fn new() -> OnlineStatsCreate initial state.
Population size, variance and mean are set to 0.
pub fn from_slice<T: ToPrimitive>(samples: &[T]) -> OnlineStats[src]
pub fn from_slice<T: ToPrimitive>(samples: &[T]) -> OnlineStatsInitializes variance from a sample.
pub fn mean(&self) -> f64[src]
pub fn mean(&self) -> f64Return the current mean.
pub fn stddev(&self) -> f64[src]
pub fn stddev(&self) -> f64Return the current standard deviation.
pub fn variance(&self) -> f64[src]
pub fn variance(&self) -> f64Return the current variance.
pub fn add<T: ToPrimitive>(&mut self, sample: T)[src]
pub fn add<T: ToPrimitive>(&mut self, sample: T)Add a new sample.
pub fn add_null(&mut self)[src]
pub fn add_null(&mut self)Add a new NULL value to the population.
This increases the population size by 1.
pub fn len(&self) -> usize[src]
pub fn len(&self) -> usizeReturns the number of data points.
Trait Implementations
impl Clone for OnlineStats[src]
impl Clone for OnlineStatsfn clone(&self) -> OnlineStats[src]
fn clone(&self) -> OnlineStatsReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Copy for OnlineStats[src]
impl Copy for OnlineStatsimpl Commute for OnlineStats[src]
impl Commute for OnlineStatsfn merge(&mut self, v: OnlineStats)[src]
fn merge(&mut self, v: OnlineStats)Merges the value other into self.
fn consume<I: Iterator<Item = Self>>(&mut self, other: I)[src]
fn consume<I: Iterator<Item = Self>>(&mut self, other: I)Merges the values in the iterator into self.
impl Default for OnlineStats[src]
impl Default for OnlineStatsfn default() -> OnlineStats[src]
fn default() -> OnlineStatsReturns the "default value" for a type. Read more
impl Debug for OnlineStats[src]
impl Debug for OnlineStatsfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl<T: ToPrimitive> FromIterator<T> for OnlineStats[src]
impl<T: ToPrimitive> FromIterator<T> for OnlineStatsfn from_iter<I: IntoIterator<Item = T>>(it: I) -> OnlineStats[src]
fn from_iter<I: IntoIterator<Item = T>>(it: I) -> OnlineStatsCreates a value from an iterator. Read more
impl<T: ToPrimitive> Extend<T> for OnlineStats[src]
impl<T: ToPrimitive> Extend<T> for OnlineStatsfn extend<I: IntoIterator<Item = T>>(&mut self, it: I)[src]
fn extend<I: IntoIterator<Item = T>>(&mut self, it: I)Extends a collection with the contents of an iterator. Read more
Auto Trait Implementations
impl Send for OnlineStats
impl Send for OnlineStatsimpl Sync for OnlineStats
impl Sync for OnlineStats