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