Struct rusty_machine::stats::dist::exponential::Exponential [] [src]

pub struct Exponential { /* fields omitted */ }

An Exponential random variable.

Methods

impl Exponential
[src]

Constructs a new Exponential random variable with given lambda parameter.

Returns the lambda parameter.

Trait Implementations

impl Debug for Exponential
[src]

Formats the value using the given formatter.

impl Clone for Exponential
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Exponential
[src]

impl Default for Exponential
[src]

The default Exponential random variable.

The defaults are:

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

impl Distribution<f64> for Exponential
[src]

The pdf of the exponential distribution.

Examples

use rusty_machine::stats::dist::Exponential;
use rusty_machine::stats::dist::Distribution;

// Construct an exponential with lambda parameter 7.0.
let exp = Exponential::new(7f64);

let pdf_zero = exp.pdf(0f64);
assert!((pdf_zero - exp.lambda()).abs() < 1e-20);

The log pdf of the exponential distribution.

Examples

// Construct an exponential with lambda parameter 5.0.
use rusty_machine::stats::dist::Exponential;
use rusty_machine::stats::dist::Distribution;

// Construct an exponential with lambda parameter 5.0.
let exp = Exponential::new(5f64);

let log_pdf = exp.logpdf(3f64);

assert!((log_pdf - exp.lambda().ln() + exp.lambda() * 3f64).abs() < 1e-20);

The cdf of the exponential distribution.

Examples

use rusty_machine::stats::dist::Exponential;
use rusty_machine::stats::dist::Distribution;

// Construct an exponential with lambda parameter 5.0.
let exp = Exponential::new(5f64);

let cdf_zero = exp.cdf(0f64);

assert!((cdf_zero).abs() < 1e-20);

impl Sample<f64> for Exponential
[src]

Generate a random value of Support, using rng as the source of randomness. Read more

impl IndependentSample<f64> for Exponential
[src]

Generate a random value.