ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_distGenGamma Module Reference

This module contains classes and procedures for computing various statistical quantities related to the GenGamma distribution. More...

Data Types

type  distGenGamma_type
 This is the derived type for signifying distributions that are of type GenGamma as defined in the description of pm_distGenGamma. More...
 
interface  getGenGammaCDF
 Generate and return the Cumulative Distribution Function (CDF) of the Generalized Gamma distribution for an input x within the support of the distribution \(x \in (0,+\infty)\). More...
 
interface  getGenGammaLogPDF
 Generate and return the natural logarithm of the Probability Density Function (PDF) of the GenGamma distribution. More...
 
interface  getGenGammaLogPDFNF
 Generate and return the natural logarithm of the normalization factor of the Probability Density Function (PDF) of the GenGamma distribution.
More...
 
interface  setGenGammaCDF
 Return the Cumulative Distribution Function (CDF) of the Generalized Gamma distribution for an input x within the support of the distribution \(x \in (0,+\infty)\). More...
 
interface  setGenGammaLogPDF
 Return the natural logarithm of the Probability Density Function (PDF) of the GenGamma distribution. More...
 
interface  setGenGammaRand
 Return a scalar or array of arbitrary rank of GenGamma-distributed random values with the specified shape and scale parameters \((\kappa, \omega, \sigma)\) of the Generalized Gamma distribution corresponding to the procedure arguments (kappa, omega, sigma). More...
 

Variables

character(*, SK), parameter MODULE_NAME = "@pm_distGenGamma"
 

Detailed Description

This module contains classes and procedures for computing various statistical quantities related to the GenGamma distribution.

Specifically, this module contains routines for computing the following quantities of the GenGamma distribution:

  1. the Probability Density Function (PDF)
  2. the Cumulative Distribution Function (CDF)
  3. the Random Number Generation from the distribution (RNG)
  4. the Inverse Cumulative Distribution Function (ICDF) or the Quantile Function

A variable \(X\) is said to be Generalized Gamma (GenGamma) distributed if its PDF with the scale \(0 < \sigma < +\infty\), shape \(0 < \omega < +\infty\), and shape \(0 < \kappa < +\infty\) parameters is described by the following equation,

\begin{equation} \large \pi(x | \kappa, \omega, \sigma) = \frac{1}{\sigma \omega \Gamma(\kappa)} ~ \bigg( \frac{x}{\sigma} \bigg)^{\frac{\kappa}{\omega} - 1} \exp\Bigg( -\bigg(\frac{x}{\sigma}\bigg)^{\frac{1}{\omega}} \Bigg) ~,~ 0 < x < \infty \end{equation}

where \(\eta = \frac{1}{\sigma \omega \Gamma(\kappa)}\) is the normalization factor of the PDF.
When \(\sigma = 1\), the GenGamma PDF simplifies to the form,

\begin{equation} \large \pi(x) = \frac{1}{\omega \Gamma(\kappa)} ~ x^{\frac{\kappa}{\omega} - 1} \exp\Bigg( -x^{\frac{1}{\omega}} \Bigg) ~,~ 0 < x < \infty \end{equation}

If \((\sigma, \omega) = (1, 1)\), the GenGamma PDF further simplifies to the form,

\begin{equation} \large \pi(x) = \frac{1}{\Gamma(\kappa)} ~ x^{\kappa - 1} \exp(-x) ~,~ 0 < x < \infty \end{equation}

Setting the shape parameter to \(\kappa = 1\) further simplifies the PDF to the Exponential distribution PDF with the scale parameter \(\sigma = 1\),

\begin{equation} \large \pi(x) = \exp(x) ~,~ 0 < x < \infty \end{equation}

  1. The parameter \(\sigma\) determines the scale of the GenGamma PDF.
  2. When \(\omega = 1\), the GenGamma PDF reduces to the PDF of the Gamma distribution.
  3. When \(\kappa = 1, \omega = 1\), the GenGamma PDF reduces to the PDF of the Exponential distribution.

The CDF of the Generalized Gamma distribution over a strictly-positive support \(x \in (0, +\infty)\) with the three (shape, shape, scale) parameters \((\kappa > 0, \omega > 0, \sigma > 0)\) is defined by the regularized Lower Incomplete Gamma function as,

\begin{eqnarray} \large \mathrm{CDF}(x | \kappa, \omega, \sigma) & = & P\bigg(\kappa, \big(\frac{x}{\sigma}\big)^{\frac{1}{\omega}} \bigg) \\ & = & \frac{1}{\Gamma(\kappa)} \int_0^{\big(\frac{x}{\sigma}\big)^{\frac{1}{\omega}}} ~ t^{\kappa - 1}{\mathrm e}^{-t} ~ dt ~, \end{eqnarray}

where \(\Gamma(\kappa)\) represents the Gamma function.

The distribution mean is given by,

\begin{equation} \large \overline{x} = \frac{\Gamma\left(\kappa + \omega\right)}{\Gamma(\kappa)} \sigma ~. \end{equation}

The distribution mode is given by,

\begin{equation} \large \widehat{x} = \begin{cases} \sigma \left( \kappa - \omega \right)^\omega ~~~ , ~~~ \omega < \kappa ~, \nonumber \\ 0 ~~~ , ~~~ \kappa \leq \omega ~. \end{cases} \end{equation}

The distribution variance is given by,

\begin{equation} \large \mathrm{VAR}(x) = \sigma^2 \left[ \frac{\Gamma(\kappa + 2\omega)}{\Gamma(\kappa)} - \left( \frac{\Gamma(\kappa + \omega)}{\Gamma(\kappa)} \right)^2 \right] ~. \end{equation}

Note
The relationship between the GenExpGamma and GenGamma distributions is similar to that of the Normal and LogNormal distributions.
In other words, a better more consistent naming for the GenExpGamma and GenGamma distributions could have been GenGamma and GenLogGamma distributions, respectively, similar to Normal and LogNormal distributions.
See also
pm_distGamma
pm_distGenExpGamma
Stacy, E. W. (1962). A generalization of the gamma distribution. The Annals of mathematical statistics, 33(3), 1187-1192.
Wolfram Research (2010), GenGammaDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/GenGammaDistribution.html (updated 2016)
Test:
test_pm_distGenGamma


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Amir Shahmoradi, Oct 16, 2009, 11:14 AM, Michigan

Variable Documentation

◆ MODULE_NAME

character(*, SK), parameter pm_distGenGamma::MODULE_NAME = "@pm_distGenGamma"

Definition at line 137 of file pm_distGenGamma.F90.