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]
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<'de> Deserialize<'de> for Quantile
[src]
impl<'de> Deserialize<'de> for Quantile
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl RefUnwindSafe for Quantile
impl RefUnwindSafe for Quantile
impl UnwindSafe for Quantile
impl UnwindSafe for Quantile
Blanket Implementations
impl<S, T> CastFloat<T> for S where
T: ConvFloat<S>,
[src]
impl<S, T> CastFloat<T> for S where
T: ConvFloat<S>,
[src]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]
pub fn try_cast_trunc(self) -> Result<T, Error>
[src]
pub fn try_cast_nearest(self) -> Result<T, Error>
[src]
pub fn try_cast_floor(self) -> Result<T, Error>
[src]
pub fn try_cast_ceil(self) -> Result<T, Error>
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]