Struct stats::OnlineStats [] [src]

pub struct OnlineStats {
    // some fields omitted
}

Online state for computing mean, variance and standard deviation.

Methods

impl OnlineStats
[src]

fn new() -> OnlineStats

Create initial state.

Population size, variance and mean are set to 0.

fn from_slice<T: ToPrimitive>(samples: &[T]) -> OnlineStats

Initializes variance from a sample.

fn mean(&self) -> f64

Return the current mean.

fn stddev(&self) -> f64

Return the current standard deviation.

fn variance(&self) -> f64

Return the current variance.

fn add<T: ToPrimitive>(&mut self, sample: T)

Add a new sample.

fn add_null(&mut self)

Add a new NULL value to the population.

This increases the population size by 1.

fn len(&self) -> usize

Returns the number of data points.

Trait Implementations

impl Copy for OnlineStats
[src]

impl Clone for OnlineStats
[src]

fn clone(&self) -> OnlineStats

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Commute for OnlineStats
[src]

fn merge(&mut self, v: OnlineStats)

Merges the value other into self.

fn consume<I: Iterator<Item=Self>>(&mut self, other: I)

Merges the values in the iterator into self.

impl Default for OnlineStats
[src]

fn default() -> OnlineStats

Returns the "default value" for a type. Read more

impl Debug for OnlineStats
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<T: ToPrimitive> FromIterator<T> for OnlineStats
[src]

fn from_iter<I: IntoIterator<Item=T>>(it: I) -> OnlineStats

Creates a value from an iterator. Read more

impl<T: ToPrimitive> Extend<T> for OnlineStats
[src]

fn extend<I: IntoIterator<Item=T>>(&mut self, it: I)

Extends a collection with the contents of an iterator. Read more