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>where
F: Float + Deserialize<'de>,
StandardNormal: Distribution<F>,
StandardUniform: Distribution<F>,
impl<'de, F> Deserialize<'de> for InverseGaussian<F>where
F: Float + Deserialize<'de>,
StandardNormal: Distribution<F>,
StandardUniform: Distribution<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