Skip to main content

ContinuousDistribution

Trait ContinuousDistribution 

Source
pub trait ContinuousDistribution {
Show 16 methods // Required methods fn pdf(&self, x: f64) -> f64; fn cdf(&self, x: f64) -> f64; fn support(&self) -> (f64, f64); fn mean(&self) -> f64; fn variance(&self) -> f64; fn skewness(&self) -> f64; fn excess_kurtosis(&self) -> f64; // Provided methods fn logpdf(&self, x: f64) -> f64 { ... } fn sf(&self, x: f64) -> f64 { ... } fn ppf(&self, p: f64) -> f64 { ... } fn isf(&self, q: f64) -> f64 { ... } fn std(&self) -> f64 { ... } fn median(&self) -> f64 { ... } fn interval(&self, confidence: f64) -> (f64, f64) { ... } fn log_likelihood(&self, data: &[f64]) -> f64 { ... } fn sample<U: UniformGenerator>(&self, rng: &mut U) -> f64 where Self: Sized { ... }
}
Expand description

A continuous probability distribution on the real line.

Required Methods§

Source

fn pdf(&self, x: f64) -> f64

The probability density.

Source

fn cdf(&self, x: f64) -> f64

The distribution function P(X ≤ x).

Source

fn support(&self) -> (f64, f64)

The interval [a, b] outside which the density is zero.

Source

fn mean(&self) -> f64

Source

fn variance(&self) -> f64

Source

fn skewness(&self) -> f64

Source

fn excess_kurtosis(&self) -> f64

The excess kurtosis (zero for the normal distribution), as SciPy’s stats(moments='k').

Provided Methods§

Source

fn logpdf(&self, x: f64) -> f64

The log density (more accurate than pdf(x).ln() in the tails where overridden).

Source

fn sf(&self, x: f64) -> f64

The survival function P(X > x).

Source

fn ppf(&self, p: f64) -> f64

The quantile (percent-point) function, the inverse of the distribution function.

Source

fn isf(&self, q: f64) -> f64

The inverse survival function.

Source

fn std(&self) -> f64

Source

fn median(&self) -> f64

Source

fn interval(&self, confidence: f64) -> (f64, f64)

The central interval containing a fraction confidence of the probability.

Source

fn log_likelihood(&self, data: &[f64]) -> f64

Σ log f(xᵢ).

Source

fn sample<U: UniformGenerator>(&self, rng: &mut U) -> f64
where Self: Sized,

A sample by inversion, ppf(U).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§