[][src]Struct compute::distributions::Exponential

pub struct Exponential { /* fields omitted */ }

Implements the Exponential distribution.

Implementations

impl Exponential[src]

pub fn new(lambda: f64) -> Self[src]

Create a new Exponential distribution with rate parameter lambda.

Errors

Panics if lambda <= 0.

pub fn set_lambda(&mut self, lambda: f64) -> &mut Self[src]

Trait Implementations

impl Clone for Exponential[src]

impl Continuous for Exponential[src]

pub fn pdf(&self, x: f64) -> f64[src]

Calculates the probability density function for the given Exponential distribution at x.

Remarks

Returns 0. if x is negative.

impl Copy for Exponential[src]

impl Debug for Exponential[src]

impl Default for Exponential[src]

impl Distribution for Exponential[src]

pub fn sample(&self) -> f64[src]

Samples from the given Exponential distribution.

Remarks

Uses the inverse transform sampling method.

impl Mean for Exponential[src]

pub fn mean(&self) -> f64[src]

Returns the mean of the given exponential distribution.

impl Variance for Exponential[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.