pub struct InverseGaussian<F>{ /* private fields */ }
Expand description
The inverse Gaussian distribution IG(μ, λ)
.
This is a continuous probability distribution with mean parameter μ
(mu
)
and shape parameter λ
(lambda
), defined for x > 0
.
It is also known as the Wald distribution.
§Plot
The following plot shows the inverse Gaussian distribution
with various values of μ
and λ
.
§Example
use rand_distr::{InverseGaussian, Distribution};
let inv_gauss = InverseGaussian::new(1.0, 2.0).unwrap();
let v = inv_gauss.sample(&mut rand::rng());
println!("{} is from a inverse Gaussian(1, 2) distribution", v);
Implementations§
source§impl<F> InverseGaussian<F>
impl<F> InverseGaussian<F>
sourcepub fn new(mean: F, shape: F) -> Result<InverseGaussian<F>, Error>
pub fn new(mean: F, shape: F) -> Result<InverseGaussian<F>, Error>
Construct a new InverseGaussian
distribution with the given mean and
shape.
Trait Implementations§
source§impl<F> Clone for InverseGaussian<F>
impl<F> Clone for InverseGaussian<F>
source§fn clone(&self) -> InverseGaussian<F>
fn clone(&self) -> InverseGaussian<F>
Returns a copy 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<F> Debug for InverseGaussian<F>
impl<F> Debug for InverseGaussian<F>
source§impl<'de, F> Deserialize<'de> for InverseGaussian<F>
impl<'de, F> Deserialize<'de> for InverseGaussian<F>
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<F> Distribution<F> for InverseGaussian<F>
impl<F> Distribution<F> for InverseGaussian<F>
source§impl<F> PartialEq for InverseGaussian<F>
impl<F> PartialEq for InverseGaussian<F>
source§impl<F> Serialize for InverseGaussian<F>
impl<F> Serialize for InverseGaussian<F>
impl<F> Copy for InverseGaussian<F>
impl<F> StructuralPartialEq for InverseGaussian<F>
Auto Trait Implementations§
impl<F> Freeze for InverseGaussian<F>where
F: Freeze,
impl<F> RefUnwindSafe for InverseGaussian<F>where
F: RefUnwindSafe,
impl<F> Send for InverseGaussian<F>where
F: Send,
impl<F> Sync for InverseGaussian<F>where
F: Sync,
impl<F> Unpin for InverseGaussian<F>where
F: Unpin,
impl<F> UnwindSafe for InverseGaussian<F>where
F: 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)