Skip to main content

DiscreteDistribution

Trait DiscreteDistribution 

Source
pub trait DiscreteDistribution {
    // Required methods
    fn pmf(&self, k: i64) -> f64;
    fn cdf(&self, k: i64) -> f64;
    fn support(&self) -> (i64, i64);
    fn mean(&self) -> f64;
    fn variance(&self) -> f64;
    fn skewness(&self) -> f64;
    fn excess_kurtosis(&self) -> f64;

    // Provided methods
    fn logpmf(&self, k: i64) -> f64 { ... }
    fn sf(&self, k: i64) -> f64 { ... }
    fn ppf(&self, p: f64) -> i64 { ... }
    fn log_likelihood(&self, data: &[i64]) -> f64 { ... }
    fn sample<U: UniformGenerator>(&self, rng: &mut U) -> i64
       where Self: Sized { ... }
}
Expand description

A discrete distribution on the integers.

Required Methods§

Source

fn pmf(&self, k: i64) -> f64

Source

fn cdf(&self, k: i64) -> f64

Source

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

Source

fn mean(&self) -> f64

Source

fn variance(&self) -> f64

Source

fn skewness(&self) -> f64

Source

fn excess_kurtosis(&self) -> f64

Provided Methods§

Source

fn logpmf(&self, k: i64) -> f64

Source

fn sf(&self, k: i64) -> f64

Source

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

The smallest k with cdf(k) ≥ p.

Source

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

Source

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

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§