Struct rv::dist::Uniform[][src]

pub struct Uniform {
    pub a: f64,
    pub b: f64,
}

Continuous uniform distribution, U(a, b) on the interval x in [a, b]

Example

The Uniform CDF is a line

use rv::prelude::*;

let u = Uniform::new(2.0, 4.0).unwrap();

// A line representing the CDF
let y = |x: f64| { 0.5 * x - 1.0 };

assert!((u.cdf(&3.0_f64) - y(3.0)).abs() < 1E-12);
assert!((u.cdf(&3.2_f64) - y(3.2)).abs() < 1E-12);

Fields

Methods

impl Uniform
[src]

Trait Implementations

impl Debug for Uniform
[src]

Formats the value using the given formatter. Read more

impl Clone for Uniform
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for Uniform
[src]

Returns the "default value" for a type. Read more

impl Skewness for Uniform
[src]

impl Kurtosis for Uniform
[src]

impl Entropy for Uniform
[src]

The entropy, H(X)

impl Rv<f64> for Uniform
[src]

Un-normalized probability function Read more

The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more

Single draw from the Rv Read more

Multiple draws of the Rv Read more

Un-normalized probability function Read more

The constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more

impl Support<f64> for Uniform
[src]

Returns true if x is in the support of the Rv Read more

impl ContinuousDistr<f64> for Uniform
[src]

The value of the Probability Density Function (PDF) at x Read more

The value of the log Probability Density Function (PDF) at x Read more

impl Mean<f64> for Uniform
[src]

Returns None if the mean is undefined

impl Median<f64> for Uniform
[src]

Returns None if the median is undefined

impl Variance<f64> for Uniform
[src]

Returns None if the variance is undefined

impl Cdf<f64> for Uniform
[src]

The value of the Cumulative Density Function at x Read more

Survival function, 1 - CDF(x)

impl InverseCdf<f64> for Uniform
[src]

The value of the x at the given probability in the CDF Read more

Alias for invcdf

Interval containing p proportion for the probability Read more

impl Rv<f32> for Uniform
[src]

Un-normalized probability function Read more

The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more

Single draw from the Rv Read more

Multiple draws of the Rv Read more

Un-normalized probability function Read more

The constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more

impl Support<f32> for Uniform
[src]

Returns true if x is in the support of the Rv Read more

impl ContinuousDistr<f32> for Uniform
[src]

The value of the Probability Density Function (PDF) at x Read more

The value of the log Probability Density Function (PDF) at x Read more

impl Mean<f32> for Uniform
[src]

Returns None if the mean is undefined

impl Median<f32> for Uniform
[src]

Returns None if the median is undefined

impl Variance<f32> for Uniform
[src]

Returns None if the variance is undefined

impl Cdf<f32> for Uniform
[src]

The value of the Cumulative Density Function at x Read more

Survival function, 1 - CDF(x)

impl InverseCdf<f32> for Uniform
[src]

The value of the x at the given probability in the CDF Read more

Alias for invcdf

Interval containing p proportion for the probability Read more

Auto Trait Implementations

impl Send for Uniform

impl Sync for Uniform