dist_gamma {distributional} | R Documentation |
The Gamma distribution
Description
Several important distributions are special cases of the Gamma
distribution. When the shape parameter is 1
, the Gamma is an
exponential distribution with parameter . When the
and
, the Gamma is a equivalent to
a chi squared distribution with n degrees of freedom. Moreover, if
we have
is
and
is
, a function of these two variables
of the form
.
This last property frequently appears in another distributions, and it
has extensively been used in multivariate methods. More about the Gamma
distribution will be added soon.
Usage
dist_gamma(shape, rate, scale = 1/rate)
Arguments
shape , scale |
shape and scale parameters. Must be positive,
|
rate |
an alternative way to specify the scale. |
Details
We recommend reading this documentation on https://pkg.mitchelloharawild.com/distributional/, where the math will render nicely.
In the following, let be a Gamma random variable
with parameters
shape
= and
rate
= .
Support:
Mean:
Variance:
Probability density function (p.m.f):
Cumulative distribution function (c.d.f):
Moment generating function (m.g.f):
See Also
Examples
dist <- dist_gamma(shape = c(1,2,3,5,9,7.5,0.5), rate = c(0.5,0.5,0.5,1,2,1,1))
dist
mean(dist)
variance(dist)
skewness(dist)
kurtosis(dist)
generate(dist, 10)
density(dist, 2)
density(dist, 2, log = TRUE)
cdf(dist, 4)
quantile(dist, 0.7)