[][src]Struct stats::OnlineStats

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]

impl Commute for OnlineStats[src]

impl Copy for OnlineStats[src]

impl Debug for OnlineStats[src]

impl Default for OnlineStats[src]

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

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

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.