pub struct Gamma { /* private fields */ }
Expand description
Gamma distribution
There are two common parametrizations for the Gamma distribution.
- X ~ Gamma(alpha, beta) = Gamma(shape, rate)
- X ~ Gamma(k, theta) = Gamma(shape, scale)
This implementation uses the first parametrization (shape, rate).
Note that scale = 1 / rate <=> rate = 1 / scale.
Implementations§
Trait Implementations§
Source§impl Distribution for Gamma
impl Distribution for Gamma
Source§fn cf(&self, t: f64) -> Complex<f64>
fn cf(&self, t: f64) -> Complex<f64>
Characteristic function of the distribution.
Returns the value of the characteristic function at t.
The characteristic function is defined as:
cf(t) = E[e^{itX}]
cf(t) = E[e^{itX}]
Source§fn pdf(&self, x: f64) -> f64
fn pdf(&self, x: f64) -> f64
Probability density function of the distribution.
Returns the probability that a random variable is equal to x.
NOTE: Panics if the distribution is discrete.
Source§fn pmf(&self, x: f64) -> f64
fn pmf(&self, x: f64) -> f64
Probability mass function of the distribution.
Returns the probability that a random variable is equal to x.
NOTE: Panics if the distribution is continuous.
Source§fn cdf(&self, x: f64) -> f64
fn cdf(&self, x: f64) -> f64
Distribution function of the distribution.
Returns the probability that a random variable is less than or equal to x.
Source§fn inv_cdf(&self, _p: f64) -> f64
fn inv_cdf(&self, _p: f64) -> f64
Inverse distribution function of the distribution.
Returns the value of x such that cdf(x) = p.
Source§fn mean(&self) -> f64
fn mean(&self) -> f64
Returns the mean of the distribution.
Mean is the average value of the distribution.
https://en.wikipedia.org/wiki/Mean
Source§fn median(&self) -> f64
fn median(&self) -> f64
Returns the median of the distribution.
Median is the value that splits the distribution into two equal parts.
https://en.wikipedia.org/wiki/Median
Source§fn mode(&self) -> f64
fn mode(&self) -> f64
Returns the mode of the distribution.
Mode is the value that maximizes the probability density function.
https://en.wikipedia.org/wiki/Mode_(statistics)
Source§fn variance(&self) -> f64
fn variance(&self) -> f64
Returns the variance of the distribution.
Variance is a measure of the spread of the distribution.
https://en.wikipedia.org/wiki/Variance
Source§fn skewness(&self) -> f64
fn skewness(&self) -> f64
Returns the skewness of the distribution.
Skewness is a measure of the asymmetry of the distribution.
https://en.wikipedia.org/wiki/Skewness
Source§fn kurtosis(&self) -> f64
fn kurtosis(&self) -> f64
Returns the kurtosis of the distribution.
Kurtosis is a measure of the “tailedness” of the distribution.
https://en.wikipedia.org/wiki/Kurtosis
Source§fn entropy(&self) -> f64
fn entropy(&self) -> f64
Returns the entropy of the distribution.
Entropy is a measure of the uncertainty of the distribution.
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
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§fn to_subset_unchecked(&self) -> SS
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.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§fn to_subset_unchecked(&self) -> SS
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.