Struct rv::dist::Laplace [−][src]
pub struct Laplace { /* fields omitted */ }
Laplace, or double exponential, distribution
Example
extern crate rand; use rv::prelude::*; let laplace = Laplace::new(0.0, 1.0).expect("Invalid params"); // 100 draws from Laplace let mut rng = rand::thread_rng(); let xs: Vec<f64> = laplace.sample(100, &mut rng); assert_eq!(xs.len(), 100);
Methods
impl Laplace
[src]
impl Laplace
Trait Implementations
impl Clone for Laplace
[src]
impl Clone for Laplace
fn clone(&self) -> Laplace
[src]
fn clone(&self) -> Laplace
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Laplace
[src]
impl Debug for Laplace
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for Laplace
[src]
impl Default for Laplace
Laplace with mean 0 and variance 1
impl Skewness for Laplace
[src]
impl Skewness for Laplace
impl Kurtosis for Laplace
[src]
impl Kurtosis for Laplace
impl Entropy for Laplace
[src]
impl Entropy for Laplace
impl Rv<f64> for Laplace
[src]
impl Rv<f64> for Laplace
fn ln_f(&self, x: &f64) -> f64
[src]
fn ln_f(&self, x: &f64) -> f64
Un-normalized probability function Read more
fn ln_normalizer(&self) -> f64
[src]
fn ln_normalizer(&self) -> f64
The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more
fn draw<R: Rng>(&self, rng: &mut R) -> f64
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> f64
Single draw from the Rv
Read more
fn f(&self, x: &X) -> f64
[src]
fn f(&self, x: &X) -> f64
Un-normalized probability function Read more
fn normalizer(&self) -> f64
[src]
fn normalizer(&self) -> f64
The constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<X>
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<X>
Multiple draws of the Rv
Read more
impl Support<f64> for Laplace
[src]
impl Support<f64> for Laplace
impl ContinuousDistr<f64> for Laplace
[src]
impl ContinuousDistr<f64> for Laplace
fn pdf(&self, x: &X) -> f64
[src]
fn pdf(&self, x: &X) -> f64
The value of the Probability Density Function (PDF) at x
Read more
fn ln_pdf(&self, x: &X) -> f64
[src]
fn ln_pdf(&self, x: &X) -> f64
The value of the log Probability Density Function (PDF) at x
Read more
impl Cdf<f64> for Laplace
[src]
impl Cdf<f64> for Laplace
fn cdf(&self, x: &f64) -> f64
[src]
fn cdf(&self, x: &f64) -> f64
The value of the Cumulative Density Function at x
Read more
fn sf(&self, x: &X) -> f64
[src]
fn sf(&self, x: &X) -> f64
Survival function, 1 - CDF(x)
impl Mean<f64> for Laplace
[src]
impl Mean<f64> for Laplace
impl Median<f64> for Laplace
[src]
impl Median<f64> for Laplace
impl Mode<f64> for Laplace
[src]
impl Mode<f64> for Laplace
impl Variance<f64> for Laplace
[src]
impl Variance<f64> for Laplace
impl Rv<f32> for Laplace
[src]
impl Rv<f32> for Laplace
fn ln_f(&self, x: &f32) -> f64
[src]
fn ln_f(&self, x: &f32) -> f64
Un-normalized probability function Read more
fn ln_normalizer(&self) -> f64
[src]
fn ln_normalizer(&self) -> f64
The log of the constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more
fn draw<R: Rng>(&self, rng: &mut R) -> f32
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> f32
Single draw from the Rv
Read more
fn f(&self, x: &X) -> f64
[src]
fn f(&self, x: &X) -> f64
Un-normalized probability function Read more
fn normalizer(&self) -> f64
[src]
fn normalizer(&self) -> f64
The constant term in the PDF/PMF. Should not be a function of any of the parameters. Read more
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<X>
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<X>
Multiple draws of the Rv
Read more
impl Support<f32> for Laplace
[src]
impl Support<f32> for Laplace
impl ContinuousDistr<f32> for Laplace
[src]
impl ContinuousDistr<f32> for Laplace
fn pdf(&self, x: &X) -> f64
[src]
fn pdf(&self, x: &X) -> f64
The value of the Probability Density Function (PDF) at x
Read more
fn ln_pdf(&self, x: &X) -> f64
[src]
fn ln_pdf(&self, x: &X) -> f64
The value of the log Probability Density Function (PDF) at x
Read more
impl Cdf<f32> for Laplace
[src]
impl Cdf<f32> for Laplace
fn cdf(&self, x: &f32) -> f64
[src]
fn cdf(&self, x: &f32) -> f64
The value of the Cumulative Density Function at x
Read more
fn sf(&self, x: &X) -> f64
[src]
fn sf(&self, x: &X) -> f64
Survival function, 1 - CDF(x)
impl Mean<f32> for Laplace
[src]
impl Mean<f32> for Laplace
impl Median<f32> for Laplace
[src]
impl Median<f32> for Laplace
impl Mode<f32> for Laplace
[src]
impl Mode<f32> for Laplace
impl Variance<f32> for Laplace
[src]
impl Variance<f32> for Laplace