Struct average::Quantile[][src]

pub struct Quantile { /* fields omitted */ }

Estimate the p-quantile of a sequence of numbers (“population”).

The P² algorithm is employed. It uses constant space but the relative error of the quantile estimate is not bounded by a function of the number of samples. For algorithms that use growing space with bounded error, see the quantiles crate.

It is recommended to use a different algorithm for discrete distributions and a small number of samples, or for quantiles close to a singularity in the distribution.

Implementations

impl Quantile[src]

pub fn new(p: f64) -> Quantile[src]

Create a new p-quantile estimator.

Panics if p is not between 0 and 1.

pub fn p(&self) -> f64[src]

Return the value of p for this p-quantile.

pub fn quantile(&self) -> f64[src]

Estimate the p-quantile of the population.

Returns 0 for an empty sample.

pub fn len(&self) -> u64[src]

Return the sample size.

pub fn is_empty(&self) -> bool[src]

Determine whether the sample is empty.

Trait Implementations

impl Clone for Quantile[src]

impl Debug for Quantile[src]

impl Default for Quantile[src]

fn default() -> Quantile[src]

Create a new median estimator.

impl<'de> Deserialize<'de> for Quantile[src]

impl Estimate for Quantile[src]

impl Serialize for Quantile[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<S, T> Cast<T> for S where
    T: Conv<S>, 
[src]

impl<S, T> CastFloat<T> for S where
    T: ConvFloat<S>, 
[src]

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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.