Trait peroxide::statistics::dist::RNG

source ·
pub trait RNG {
    // Required methods
    fn sample_with_rng<R: Rng + Clone>(&self, rng: &mut R, n: usize) -> Vec<f64>;
    fn pdf<S: PartialOrd + SampleUniform + Copy + Into<f64>>(&self, x: S) -> f64;
    fn cdf<S: PartialOrd + SampleUniform + Copy + Into<f64>>(&self, x: S) -> f64;

    // Provided method
    fn sample(&self, n: usize) -> Vec<f64> { ... }
}
Expand description

Random Number Generator trait

§Methods

  • sample: extract samples

Required Methods§

source

fn sample_with_rng<R: Rng + Clone>(&self, rng: &mut R, n: usize) -> Vec<f64>

Extract samples of distributions with rng

source

fn pdf<S: PartialOrd + SampleUniform + Copy + Into<f64>>(&self, x: S) -> f64

Probability Distribution Function

§Type

f64 -> f64

source

fn cdf<S: PartialOrd + SampleUniform + Copy + Into<f64>>(&self, x: S) -> f64

Cumulative Distribution Function

§Type

f64 -> f64

Provided Methods§

source

fn sample(&self, n: usize) -> Vec<f64>

Extract samples of distributions

Object Safety§

This trait is not object safe.

Implementors§

source§

impl RNG for WeightedUniform<f64>

source§

impl<T: PartialOrd + SampleUniform + Copy + Into<f64>> RNG for OPDist<T>

RNG for OPDist

source§

impl<T: PartialOrd + SampleUniform + Copy + Into<f64>> RNG for TPDist<T>

RNG for TPDist