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§
fn mean(&self) -> f64
fn variance(&self) -> f64
fn skewness(&self) -> f64
Sourcefn excess_kurtosis(&self) -> f64
fn excess_kurtosis(&self) -> f64
The excess kurtosis (zero for the normal distribution), as SciPy’s stats(moments='k').
Provided Methods§
Sourcefn logpdf(&self, x: f64) -> f64
fn logpdf(&self, x: f64) -> f64
The log density (more accurate than pdf(x).ln() in the tails where overridden).
Sourcefn ppf(&self, p: f64) -> f64
fn ppf(&self, p: f64) -> f64
The quantile (percent-point) function, the inverse of the distribution function.
fn std(&self) -> f64
fn median(&self) -> f64
Sourcefn interval(&self, confidence: f64) -> (f64, f64)
fn interval(&self, confidence: f64) -> (f64, f64)
The central interval containing a fraction confidence of the probability.
Sourcefn log_likelihood(&self, data: &[f64]) -> f64
fn log_likelihood(&self, data: &[f64]) -> f64
Σ log f(xᵢ).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".