[−][src]Struct rv::dist::Uniform
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
a: f64
b: f64
Methods
impl Uniform
[src]
Trait Implementations
impl Rv<f64> for Uniform
[src]
fn ln_f(&self, x: &f64) -> f64
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> f64
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<f64>
[src]
fn f(&self, x: &X) -> f64
[src]
Probability function Read more
impl Rv<f32> for Uniform
[src]
fn ln_f(&self, x: &f32) -> f64
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> f32
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<f32>
[src]
fn f(&self, x: &X) -> f64
[src]
Probability function Read more
impl Support<f64> for Uniform
[src]
impl Support<f32> for Uniform
[src]
impl ContinuousDistr<f64> for Uniform
[src]
fn pdf(&self, x: &X) -> f64
[src]
The value of the Probability Density Function (PDF) at x
Read more
fn ln_pdf(&self, x: &X) -> f64
[src]
The value of the log Probability Density Function (PDF) at x
Read more
impl ContinuousDistr<f32> for Uniform
[src]
fn pdf(&self, x: &X) -> f64
[src]
The value of the Probability Density Function (PDF) at x
Read more
fn ln_pdf(&self, x: &X) -> f64
[src]
The value of the log Probability Density Function (PDF) at x
Read more
impl Cdf<f64> for Uniform
[src]
impl Cdf<f32> for Uniform
[src]
impl InverseCdf<f64> for Uniform
[src]
fn invcdf(&self, p: f64) -> f64
[src]
fn quantile(&self, p: f64) -> X
[src]
Alias for invcdf
fn interval(&self, p: f64) -> (X, X)
[src]
Interval containing p
proportion for the probability Read more
impl InverseCdf<f32> for Uniform
[src]
fn invcdf(&self, p: f64) -> f32
[src]
fn quantile(&self, p: f64) -> X
[src]
Alias for invcdf
fn interval(&self, p: f64) -> (X, X)
[src]
Interval containing p
proportion for the probability Read more
impl Mean<f64> for Uniform
[src]
impl Mean<f32> for Uniform
[src]
impl Median<f64> for Uniform
[src]
impl Median<f32> for Uniform
[src]
impl Variance<f64> for Uniform
[src]
impl Variance<f32> for Uniform
[src]
impl Entropy for Uniform
[src]
impl Skewness for Uniform
[src]
impl Kurtosis for Uniform
[src]
impl PartialOrd<Uniform> for Uniform
[src]
fn partial_cmp(&self, other: &Uniform) -> Option<Ordering>
[src]
fn lt(&self, other: &Uniform) -> bool
[src]
fn le(&self, other: &Uniform) -> bool
[src]
fn gt(&self, other: &Uniform) -> bool
[src]
fn ge(&self, other: &Uniform) -> bool
[src]
impl<'_> From<&'_ Uniform> for String
[src]
impl PartialEq<Uniform> for Uniform
[src]
impl Clone for Uniform
[src]
fn clone(&self) -> Uniform
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for Uniform
[src]
impl Display for Uniform
[src]
impl Debug for Uniform
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ApiReady for T where
T: Clone + Debug + PartialOrd<T> + PartialEq<T>,
[src]
T: Clone + Debug + PartialOrd<T> + PartialEq<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,