pub struct Moments4 { /* private fields */ }Expand description
Estimate the first N moments of a sequence of numbers (“population”).
Implementations§
Source§impl Moments4
impl Moments4
Sourcepub fn mean(&self) -> f64
pub fn mean(&self) -> f64
Estimate the mean of the population.
Returns NaN for an empty sample.
Sourcepub fn central_moment(&self, p: usize) -> f64
pub fn central_moment(&self, p: usize) -> f64
Estimate the pth central moment of the population.
If p > 1, returns NaN for an empty sample.
Sourcepub fn standardized_moment(&self, p: usize) -> f64
Available on crate features std or libm only.
pub fn standardized_moment(&self, p: usize) -> f64
std or libm only.Estimate the pth standardized moment of the population.
Sourcepub fn sample_variance(&self) -> f64
pub fn sample_variance(&self) -> f64
Calculate the sample variance.
This is an unbiased estimator of the variance of the population.
Returns NaN for samples of size 1 or less.
Sourcepub fn sample_skewness(&self) -> f64
Available on crate features std or libm only.
pub fn sample_skewness(&self) -> f64
std or libm only.Calculate the sample skewness.
Returns NaN for an empty sample.
Sourcepub fn sample_excess_kurtosis(&self) -> f64
pub fn sample_excess_kurtosis(&self) -> f64
Calculate the sample excess kurtosis.
Returns NaN for samples of size 3 or less.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Moments4
impl<'de> Deserialize<'de> for Moments4
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> Extend<&'a f64> for Moments4
impl<'a> Extend<&'a f64> for Moments4
Source§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = &'a f64>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = &'a f64>,
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl Extend<f64> for Moments4
impl Extend<f64> for Moments4
Source§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = f64>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = f64>,
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<'a> FromIterator<&'a f64> for Moments4
impl<'a> FromIterator<&'a f64> for Moments4
Source§impl FromIterator<f64> for Moments4
impl FromIterator<f64> for Moments4
Source§impl<'a> FromParallelIterator<&'a f64> for Moments4
Available on crate feature rayon only.
impl<'a> FromParallelIterator<&'a f64> for Moments4
Available on crate feature
rayon only.Source§fn from_par_iter<I>(par_iter: I) -> Moments4
fn from_par_iter<I>(par_iter: I) -> Moments4
Creates an instance of the collection from the parallel iterator
par_iter. Read moreSource§impl FromParallelIterator<f64> for Moments4
Available on crate feature rayon only.
impl FromParallelIterator<f64> for Moments4
Available on crate feature
rayon only.Source§fn from_par_iter<I>(par_iter: I) -> Moments4
fn from_par_iter<I>(par_iter: I) -> Moments4
Creates an instance of the collection from the parallel iterator
par_iter. Read moreAuto Trait Implementations§
impl Freeze for Moments4
impl RefUnwindSafe for Moments4
impl Send for Moments4
impl Sync for Moments4
impl Unpin for Moments4
impl UnwindSafe for Moments4
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
Source§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
Source§fn cast_approx(self) -> T
fn cast_approx(self) -> T
Source§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
Source§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Cast to integer, truncating Read more
Source§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Cast to the nearest integer Read more
Source§fn cast_floor(self) -> T
fn cast_floor(self) -> T
Cast the floor to an integer Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more