[][src]Struct mathru::statistics::distrib::Exponential

pub struct Exponential { /* fields omitted */ }

Exponential distribution

Fore more information: https://en.wikipedia.org/wiki/Exponential_distribution

Methods

impl Exponential[src]

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

Creates a probability distribution

Arguments

  • lambda > 0.0

Panics

if lambda <= 0.0

Example

use mathru::statistics::distrib::Exponential;

let distrib: Exponential = Exponential::new(&0.3);

pub fn from_data<'a>(data: &'a Vec<f64>) -> Self[src]

impl Exponential[src]

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

Trait Implementations

impl Continuous<f64, f64> for Exponential[src]

fn pdf<'a>(&'a self, x: f64) -> f64[src]

Probability density function

Arguments

  • x Random variable x ∈ &#x2115 | x > 0.0

Example

use mathru::statistics::distrib::{Continuous, Exponential};

let distrib: Exponential = Exponential::new(&0.3);
let x: f64 = 5.0;
let p: f64 = distrib.pdf(x);

fn cdf<'a>(&'a self, x: f64) -> f64[src]

Cumulative distribution function

Arguments

  • x Random variable

Example

use mathru::statistics::distrib::{Continuous, Exponential};

let distrib: Exponential = Exponential::new(&0.3);
let x: f64 = 0.4;
let p: f64 = distrib.cdf(x);

fn quantile<'a>(&'a self, p: f64) -> f64[src]

Quantile function of inverse cdf

fn mean<'a>(&'a self) -> f64[src]

Expected value

Example

use mathru::statistics::distrib::{Discrete, Bernoulli};

let distrib: Bernoulli = Bernoulli::new(0.2);
let mean: f64 = distrib.mean();

fn variance<'a>(&'a self) -> f64[src]

Variance

Example

use mathru::statistics::distrib::{Discrete, Bernoulli};

let distrib: Bernoulli = Bernoulli::new(0.2);
let var: f64 = distrib.variance();

Auto Trait Implementations

Blanket Implementations

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

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

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.

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

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

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,