[−][src]Struct rv::dist::Laplace
Laplace, or double exponential, distribution over x in (-∞, ∞).
Example
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]
pub fn set_mu(&mut self, val: f64) -> &mut Self
[src]
Location in (-∞, ∞)
pub fn set_b(&mut self, val: f64) -> &mut Self
[src]
Scale in (0, ∞)
impl Laplace
[src]
pub fn new(mu: f64, b: f64) -> Result<Self>
[src]
Create a new Laplace distribution.
pub fn new_unchecked(mu: f64, b: f64) -> Self
[src]
Creates a new Laplace without checking whether the parameters are valid.
pub fn mu(&self) -> f64
[src]
Get the mu parameter
Examples
let laplace = Laplace::new(-1.0, 2.0).unwrap(); assert_eq!(laplace.mu(), -1.0);
pub fn b(&self) -> f64
[src]
Get the b parameter
Examples
let laplace = Laplace::new(-1.0, 2.0).unwrap(); assert_eq!(laplace.b(), 2.0);
Trait Implementations
impl Rv<f64> for Laplace
[src]
fn ln_f(&self, x: &f64) -> f64
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> f64
[src]
fn f(&self, x: &X) -> f64
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<X>
[src]
impl Rv<f32> for Laplace
[src]
fn ln_f(&self, x: &f32) -> f64
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> f32
[src]
fn f(&self, x: &X) -> f64
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<X>
[src]
impl Support<f64> for Laplace
[src]
impl Support<f32> for Laplace
[src]
impl ContinuousDistr<f64> for Laplace
[src]
impl ContinuousDistr<f32> for Laplace
[src]
impl Cdf<f64> for Laplace
[src]
impl Cdf<f32> for Laplace
[src]
impl Mean<f64> for Laplace
[src]
impl Mean<f32> for Laplace
[src]
impl Median<f64> for Laplace
[src]
impl Median<f32> for Laplace
[src]
impl Mode<f64> for Laplace
[src]
impl Mode<f32> for Laplace
[src]
impl Variance<f64> for Laplace
[src]
impl Variance<f32> for Laplace
[src]
impl Entropy for Laplace
[src]
impl Skewness for Laplace
[src]
impl Kurtosis for Laplace
[src]
impl<'_> From<&'_ Laplace> for String
[src]
impl Clone for Laplace
[src]
impl Default for Laplace
[src]
Laplace with mean 0 and variance 1
impl PartialEq<Laplace> for Laplace
[src]
impl PartialOrd<Laplace> for Laplace
[src]
fn partial_cmp(&self, other: &Laplace) -> Option<Ordering>
[src]
fn lt(&self, other: &Laplace) -> bool
[src]
fn le(&self, other: &Laplace) -> bool
[src]
fn gt(&self, other: &Laplace) -> bool
[src]
fn ge(&self, other: &Laplace) -> bool
[src]
impl Display for Laplace
[src]
impl Debug for Laplace
[src]
Auto Trait Implementations
impl Send for Laplace
impl Sync for Laplace
impl Unpin for Laplace
impl UnwindSafe for Laplace
impl RefUnwindSafe for Laplace
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<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> 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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
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>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,