Struct average::Quantile [−][src]
pub struct Quantile { /* fields omitted */ }
Estimate the p-quantile of a sequence of numbers ("population").
The algorithm uses constant space but does not provide any upper bound on
the error. For algorithms that use growing space with bounded error, see
the quantiles
crate. They are
recommended over this algorithm for small samples.
Methods
impl Quantile
[src]
impl Quantile
pub fn new(p: f64) -> Quantile
[src]
pub fn new(p: f64) -> Quantile
Create a new p-quantile estimator.
Panics if p
is not between 0 and 1.
pub fn p(&self) -> f64
[src]
pub fn p(&self) -> f64
Return the value of p
for this p-quantile.
pub fn quantile(&self) -> f64
[src]
pub fn quantile(&self) -> f64
Estimate the p-quantile of the population.
Returns 0 for an empty sample.
pub fn len(&self) -> u64
[src]
pub fn len(&self) -> u64
Return the sample size.
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
Determine whether the sample is empty.
Trait Implementations
impl Debug for Quantile
[src]
impl Debug for Quantile
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Quantile
[src]
impl Clone for Quantile
fn clone(&self) -> Quantile
[src]
fn clone(&self) -> Quantile
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Default for Quantile
[src]
impl Default for Quantile
impl Estimate for Quantile
[src]
impl Estimate for Quantile