Struct average::Quantile [−][src]
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]
impl Estimate for Quantile[src]
Auto Trait Implementations
impl RefUnwindSafe for Quantile
impl Send for Quantile
impl Sync for Quantile
impl Unpin for Quantile
impl UnwindSafe for Quantile
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,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<S, T> Cast<T> for S where
T: Conv<S>, [src]
T: Conv<S>,
impl<S, T> CastFloat<T> for S where
T: ConvFloat<S>, [src]
T: ConvFloat<S>,
pub fn cast_trunc(self) -> T[src]
pub fn cast_nearest(self) -> T[src]
pub fn cast_floor(self) -> T[src]
pub fn cast_ceil(self) -> T[src]
impl<T> Conv<T> for 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.
pub fn to_owned(&self) -> T[src]
pub 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.
pub 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>,