Trait Quantiles

Source
pub trait Quantiles: Distribution {
    // Provided methods
    fn quantile(&self, p: Probability) -> f64 { ... }
    fn cquantile(&self, p: Probability) -> f64 { ... }
    fn lower_quartile(&self) -> f64 { ... }
    fn median(&self) -> f64 { ... }
    fn upper_quartile(&self) -> f64 { ... }
    fn iqr(&self) -> f64 { ... }
    fn lower_fence(&self) -> f64 { ... }
    fn upper_fence(&self) -> f64 { ... }
}

Provided Methods§

Source

fn quantile(&self, p: Probability) -> f64

Evaluates the inverse cumulative distribution function (CDF) at p.

The quantile function specifies the value x of a random variable X at which the probability is less than or equal to p: Q(p) = inf{ x in R : p <= F(x)}. For continuous and strictly monotonically increasing CDFs, it takes the exact form: Q = 1 / F.

Source

fn cquantile(&self, p: Probability) -> f64

Evaluates the complementary quantile function at x: Q(1 - p).

Source

fn lower_quartile(&self) -> f64

Computes the lower quartile of the distribution, Q(0.25).

Source

fn median(&self) -> f64

Computes the median value of the distribution, Q(0.5).

A default implementation is provided by calling self.quantile(0.5). It is recommended, however, that you provide specialised version as it is generally more efficient than evaluating Q.

Source

fn upper_quartile(&self) -> f64

Computes the upper quartile of the distribution, Q(0.75).

Source

fn iqr(&self) -> f64

Computes the interquartile range (IQR) of the distribution, Q(0.75) - Q(0.25).

Source

fn lower_fence(&self) -> f64

Computes the lower fence of the distribution, Q(0.25) - 1.5 · IQR.

The lower fence is typically used to define the lower limit of the distribution, beyond which values are deemed outliers.

Source

fn upper_fence(&self) -> f64

Computes the lower fence of the distribution, Q(0.75) + 1.5 · IQR.

The upper fence is typically used to define the upper limit of the distribution, beyond which values are deemed outliers.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§