pub struct Exponential<T> { /* private fields */ }Expand description
Exponential distribution with rate λ.
f(x) = λ exp(−λx) for x ≥ 0.
§Example
use numeris::stats::{Exponential, ContinuousDistribution};
let e = Exponential::new(2.0_f64).unwrap();
assert!((e.mean() - 0.5).abs() < 1e-14);
assert!((e.cdf(0.0)).abs() < 1e-14);Implementations§
Source§impl<T: FloatScalar> Exponential<T>
impl<T: FloatScalar> Exponential<T>
Sourcepub fn new(lambda: T) -> Result<Self, StatsError>
pub fn new(lambda: T) -> Result<Self, StatsError>
Create an exponential distribution with rate lambda. Requires lambda > 0.
Source§impl<T: FloatScalar> Exponential<T>
impl<T: FloatScalar> Exponential<T>
Trait Implementations§
Source§impl<T: Clone> Clone for Exponential<T>
impl<T: Clone> Clone for Exponential<T>
Source§fn clone(&self) -> Exponential<T>
fn clone(&self) -> Exponential<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: FloatScalar> ContinuousDistribution<T> for Exponential<T>
impl<T: FloatScalar> ContinuousDistribution<T> for Exponential<T>
Source§impl<T: Debug> Debug for Exponential<T>
impl<T: Debug> Debug for Exponential<T>
impl<T: Copy> Copy for Exponential<T>
Auto Trait Implementations§
impl<T> Freeze for Exponential<T>where
T: Freeze,
impl<T> RefUnwindSafe for Exponential<T>where
T: RefUnwindSafe,
impl<T> Send for Exponential<T>where
T: Send,
impl<T> Sync for Exponential<T>where
T: Sync,
impl<T> Unpin for Exponential<T>where
T: Unpin,
impl<T> UnsafeUnpin for Exponential<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Exponential<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more