Skip to content

Latest commit

 

History

History
213 lines (138 loc) · 4.82 KB

inverse-gamma.rst

File metadata and controls

213 lines (138 loc) · 4.82 KB

Inverse-Gamma Distribution

Table of contents


The density function of the inverse-Gamma distribution:

f(x; \alpha, \beta) = \dfrac{\beta^{\alpha}}{\Gamma(\alpha)} x^{-\alpha-1} \exp\left(-\frac{\beta}{x}\right) \times \mathbf{1}[ x \geq 0 ]

where \Gamma(\cdot) denotes the Gamma function, \alpha is the shape parameter, and \beta is the rate parameter.

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

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

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

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

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

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


The cumulative distribution function of the inverse-Gamma distribution:

F(x; \alpha, \beta) = \int_0^x f(z; \alpha, \beta) dz = 1 - \frac{\gamma(1/x,\beta/x)}{\Gamma (\alpha)}

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:: pinvgamma(const T1, const T2, const T3, const bool)
   :project: statslib

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

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

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

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


The quantile function of the inverse-Gamma distribution:

q(p; \alpha, \beta) = \inf \left\{ x : p \leq 1 - \frac{\gamma(1/x,\beta/x)}{\Gamma (\alpha)} \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:: qinvgamma(const T1, const T2, const T3)
   :project: statslib

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

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

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

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


Random sampling for the inverse-Gamma distribution is achieved by simulating X \sim G(\alpha, 1/\beta), then returning

Z = \frac{1}{X} \sim \text{IG}(\alpha,\beta)
  1. Random number engines
.. doxygenfunction:: rinvgamma(const T1, const T2, rand_engine_t&)
   :project: statslib

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

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

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