pub struct Gamma { /* private fields */ }
๐Deprecated since 0.7.0: moved to rand_distr crate
Expand description
The Gamma distribution Gamma(shape, scale)
distribution.
The density function of this distribution is
f(x) = x^(k - 1) * exp(-x / ฮธ) / (ฮ(k) * ฮธ^k)
where ฮ
is the Gamma function, k
is the shape and ฮธ
is the
scale and both k
and ฮธ
are strictly positive.
The algorithm used is that described by Marsaglia & Tsang 20001,
falling back to directly sampling from an Exponential for shape == 1
, and using the boosting technique described in that paper for
shape < 1
.
George Marsaglia and Wai Wan Tsang. 2000. โA Simple Method for Generating Gamma Variablesโ ACM Trans. Math. Softw. 26, 3 (September 2000), 363-372. DOI:10.1145/358407.358414 โฉ
Implementationsยง
Trait Implementationsยง
Sourceยงimpl Distribution<f64> for Gamma
impl Distribution<f64> for Gamma
impl Copy for Gamma
Auto Trait Implementationsยง
impl Freeze for Gamma
impl RefUnwindSafe for Gamma
impl Send for Gamma
impl Sync for Gamma
impl Unpin for Gamma
impl UnwindSafe for Gamma
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 more