[−][src]Struct stats::OnlineStats
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]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Commute for OnlineStats
[src]
fn merge(&mut self, v: OnlineStats)
[src]
fn consume<I: Iterator<Item = Self>>(&mut self, other: I)
[src]
impl Copy for OnlineStats
[src]
impl Debug for OnlineStats
[src]
impl Default for OnlineStats
[src]
fn default() -> OnlineStats
[src]
impl<T: ToPrimitive> Extend<T> for OnlineStats
[src]
fn extend<I: IntoIterator<Item = T>>(&mut self, it: I)
[src]
impl<T: ToPrimitive> FromIterator<T> for OnlineStats
[src]
fn from_iter<I: IntoIterator<Item = T>>(it: I) -> OnlineStats
[src]
Auto Trait Implementations
impl RefUnwindSafe for OnlineStats
impl Send for OnlineStats
impl Sync for OnlineStats
impl Unpin for OnlineStats
impl UnwindSafe for OnlineStats
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,