Skip to content

Latest commit

 

History

History
208 lines (136 loc) · 4.52 KB

gamma.rst

File metadata and controls

208 lines (136 loc) · 4.52 KB

Gamma Distribution

Table of contents


The density function of the Gamma distribution:

f(x; k, \theta) = \dfrac{x^{k-1}\exp(-x/\theta)}{\theta^k \Gamma(k)} \times \mathbf{1}[ x \geq 0 ]

where \Gamma(\cdot) denotes the Gamma function, k is the shape parameter, and \theta is the scale parameter.

Methods for scalar input, as well as for vector/matrix input, are listed below.

.. doxygenfunction:: dgamma(const T1, const T2, const T3, const bool)
   :project: statslib

.. doxygenfunction:: dgamma(const std::vector<eT>&, const T1, const T2, const bool)
   :project: statslib

.. doxygenfunction:: dgamma(const ArmaMat<eT>&, const T1, const T2, const bool)
   :project: statslib

.. doxygenfunction:: dgamma(const BlazeMat<eT, To>&, const T1, const T2, const bool)
   :project: statslib

.. doxygenfunction:: dgamma(const EigenMat<eT, iTr, iTc>&, const T1, const T2, const bool)
   :project: statslib


The cumulative distribution function of the Gamma distribution:

F(x; k, \theta) = \int_0^x f(z; k, \theta) dz = \frac{\gamma(k,x\theta)}{\Gamma (k)}

where \Gamma(\cdot) denotes the gamma function and \gamma(\cdot, \cdot) denotes the incomplete gamma function.

Methods for scalar input, as well as for vector/matrix input, are listed below.

.. doxygenfunction:: pgamma(const T1, const T2, const T3, const bool)
   :project: statslib

.. doxygenfunction:: pgamma(const std::vector<eT>&, const T1, const T2, const bool)
   :project: statslib

.. doxygenfunction:: pgamma(const ArmaMat<eT>&, const T1, const T2, const bool)
   :project: statslib

.. doxygenfunction:: pgamma(const BlazeMat<eT, To>&, const T1, const T2, const bool)
   :project: statslib

.. doxygenfunction:: pgamma(const EigenMat<eT, iTr, iTc>&, const T1, const T2, const bool)
   :project: statslib


The quantile function of the Gamma distribution:

q(p; k, \theta) = \inf \left\{ x : p \leq \frac{\gamma(k,x\theta)}{\Gamma (k)} \right\}

where \Gamma(\cdot) denotes the gamma function and \gamma(\cdot, \cdot) denotes the incomplete gamma function.

Methods for scalar input, as well as for vector/matrix input, are listed below.

.. doxygenfunction:: qgamma(const T1, const T2, const T3)
   :project: statslib

.. doxygenfunction:: qgamma(const std::vector<eT>&, const T1, const T2)
   :project: statslib

.. doxygenfunction:: qgamma(const ArmaMat<eT>&, const T1, const T2)
   :project: statslib

.. doxygenfunction:: qgamma(const BlazeMat<eT, To>&, const T1, const T2)
   :project: statslib

.. doxygenfunction:: qgamma(const EigenMat<eT, iTr, iTc>&, const T1, const T2)
   :project: statslib


Random sampling for the Gamma distribution is achieved via the Ziggurat method of Marsaglia and Tsang (2000).

  1. Random number engines
.. doxygenfunction:: rgamma(const T1, const T2, rand_engine_t&)
   :project: statslib

  1. Seed values
.. doxygenfunction:: rgamma(const T1, const T2, const ullint_t)
   :project: statslib

  1. Random number engines
.. doxygenfunction:: rgamma(const ullint_t, const ullint_t, const T1, const T2, rand_engine_t&)
   :project: statslib

  1. Seed values
.. doxygenfunction:: rgamma(const ullint_t, const ullint_t, const T1, const T2, const ullint_t)
   :project: statslib