pub struct NormalInverseGaussian<F>{ /* private fields */ }Expand description
The normal-inverse Gaussian distribution NIG(α, β).
This is a continuous probability distribution with two parameters,
α (alpha) and β (beta), defined in (-∞, ∞).
It is also known as the normal-Wald distribution.
§Plot
The following plot shows the normal-inverse Gaussian distribution with various values of α and β.
§Example
use rand_distr::{NormalInverseGaussian, Distribution};
let norm_inv_gauss = NormalInverseGaussian::new(2.0, 1.0).unwrap();
let v = norm_inv_gauss.sample(&mut rand::rng());
println!("{} is from a normal-inverse Gaussian(2, 1) distribution", v);Implementations§
Source§impl<F> NormalInverseGaussian<F>
impl<F> NormalInverseGaussian<F>
Sourcepub fn new(alpha: F, beta: F) -> Result<NormalInverseGaussian<F>, Error>
pub fn new(alpha: F, beta: F) -> Result<NormalInverseGaussian<F>, Error>
Construct a new NormalInverseGaussian distribution with the given alpha (tail heaviness) and
beta (asymmetry) parameters.
Note: If subnormal numbers are not supported or are disabled, this sampler may panic or produce incorrect output if alpha is close to the maximum finite float value.
Trait Implementations§
Source§impl<F> Clone for NormalInverseGaussian<F>
impl<F> Clone for NormalInverseGaussian<F>
Source§fn clone(&self) -> NormalInverseGaussian<F>
fn clone(&self) -> NormalInverseGaussian<F>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<F> Copy for NormalInverseGaussian<F>
Source§impl<F> Debug for NormalInverseGaussian<F>
impl<F> Debug for NormalInverseGaussian<F>
Source§impl<F> Distribution<F> for NormalInverseGaussian<F>
impl<F> Distribution<F> for NormalInverseGaussian<F>
Source§impl<F> PartialEq for NormalInverseGaussian<F>
impl<F> PartialEq for NormalInverseGaussian<F>
Source§fn eq(&self, other: &NormalInverseGaussian<F>) -> bool
fn eq(&self, other: &NormalInverseGaussian<F>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<F> StructuralPartialEq for NormalInverseGaussian<F>
Auto Trait Implementations§
impl<F> Freeze for NormalInverseGaussian<F>where
F: Freeze,
impl<F> RefUnwindSafe for NormalInverseGaussian<F>where
F: RefUnwindSafe,
impl<F> Send for NormalInverseGaussian<F>where
F: Send,
impl<F> Sync for NormalInverseGaussian<F>where
F: Sync,
impl<F> Unpin for NormalInverseGaussian<F>where
F: Unpin,
impl<F> UnsafeUnpin for NormalInverseGaussian<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for NormalInverseGaussian<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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.