Tutorials › Generalized Linear Models › Gamma Density In Exponential-Dispersion Form

Gamma Response Models · Tutorial 571 of 981

Gamma Density In Exponential-Dispersion Form

Learn to match gamma shape-and-scale parameters to the exponential-dispersion form and verify each component of the representation.

Intermediate 10 min read

What You'll Learn

  • Convert gamma shape and scale into mean and dispersion parameters
  • Identify the natural parameter and its admissible domain
  • Derive the gamma cumulant function from the density
  • Separate parameter-dependent terms from the base-measure term
  • Verify the representation by normalization and numerical examples
  • Avoid confusing gamma scale with dispersion

Why Write the Gamma Density This Way?

A generalized linear model is built around a response distribution whose density can be organized into a standard form. For a gamma response, that organization makes clear which quantity plays the role of the natural parameter, which function is the cumulant function, and which terms belong to the base measure. The same probability distribution can be described using shape and scale, or using a mean and a dispersion parameter; the exponential-dispersion form makes the latter structure explicit.

The goal here is to perform that rewrite carefully. In particular, the gamma scale is not itself the dispersion parameter, and terms involving the response value must be separated from terms involving the model parameter. Keeping those distinctions straight is essential when reading or deriving a gamma likelihood.

The Exponential-Dispersion Form

A one-parameter exponential-dispersion density has the form below, with respect to Lebesgue measure for a continuous response. The functions \(a\), \(b\), and \(c\) specify the dispersion scaling, cumulant function, and remaining density term.

$$ f(y;\theta,\phi) = \exp\left\{ \frac{y\theta-b(\theta)}{a(\phi)} +c(y,\phi) \right\}. $$

For the gamma form used here, \(a(\phi)=\phi\), with \(\phi>0\). The natural parameter must lie in a domain where \(b(\theta)\) is defined; the gamma response will require \(\theta<0\). The density is supported on \(y>0\), so its value is zero for \(y\leq 0\). In a formula for \(c(y,\phi)\), this support restriction can be stated separately rather than encoded in the logarithmic expression.

Definition: In the gamma exponential-dispersion representation, \(\theta\) is the natural parameter, \(b(\theta)\) is the cumulant function, \(\phi\) is the positive dispersion parameter, and \(c(y,\phi)\) is the base-measure term. For \(y>0\), the specific components are \(\theta=-1/\mu\), \(b(\theta)=-\log(-\theta)\), \(a(\phi)=\phi\), and \(c(y,\phi)=(1/\phi-1)\log y-\log\Gamma(1/\phi)-(1/\phi)\log\phi\).

Deriving the Gamma Representation

Use the gamma shape-and-scale convention: a gamma variable with shape \(\alpha>0\) and scale \(\beta>0\) has density \(y^{\alpha-1}\exp(-y/\beta)/\{\Gamma(\alpha)\beta^\alpha\}\) for \(y>0\). Write its mean as \(\mu=\alpha\beta\), and set \(\phi=1/\alpha\). Equivalently, \(\alpha=1/\phi\) and \(\beta=\phi\mu\). Substituting these relations gives

$$ f(y;\mu,\phi) = \frac{y^{1/\phi-1}\exp\{-y/(\phi\mu)\}} {\Gamma(1/\phi)(\phi\mu)^{1/\phi}}, \qquad y>0,\quad \mu>0,\quad \phi>0. $$

Taking logarithms separates the terms involving \(y\) and \(\mu\):

$$ \begin{aligned} \log f(y;\mu,\phi) &= \left(\frac{1}{\phi}-1\right)\log y -\frac{y}{\phi\mu} -\log\Gamma(1/\phi) -\frac{1}{\phi}\log\phi -\frac{1}{\phi}\log\mu. \end{aligned} $$

The terms involving the response and the mean can be grouped as \((-y/\mu-\log\mu)/\phi\). Set \(\theta=-1/\mu\). Since \(\mu>0\), this gives \(\theta<0\), and \(\log\mu=-\log(-\theta)\). Therefore, if \(b(\theta)=-\log(-\theta)\), then \(y\theta-b(\theta)=-y/\mu-\log\mu\). The terms left over are precisely \(c(y,\phi)\) in the definition above.

Theorem: If \(Y\) has a gamma distribution with shape \(1/\phi\) and scale \(\phi\mu\), where \(\mu>0\) and \(\phi>0\), then its density is in exponential-dispersion form with natural parameter \(\theta=-1/\mu<0\), cumulant function \(b(\theta)=-\log(-\theta)\), dispersion scaling \(a(\phi)=\phi\), and base-measure term \(c(y,\phi)=(1/\phi-1)\log y-\log\Gamma(1/\phi)-(1/\phi)\log\phi\) for \(y>0\).

Proof. Begin with the gamma density in shape-and-scale form and substitute \(\alpha=1/\phi\) and \(\beta=\phi\mu\). Its logarithm is the displayed expression above. With \(\theta=-1/\mu\), we have \(\theta<0\), \(-\log(-\theta)=\log\mu\), and hence \[ \frac{y\theta-b(\theta)}{\phi} = \frac{-y/\mu-\log\mu}{\phi}. \] The remaining terms in the log density are \((1/\phi-1)\log y-\log\Gamma(1/\phi)-(1/\phi)\log\phi\). Thus the log density equals \(\{y\theta-b(\theta)\}/\phi+c(y,\phi)\), which proves the claimed representation for \(y>0\). The gamma density is zero outside that support. \(\square\)

Normalization Confirms the Cumulant Function

The algebra identifies the required components; normalization provides an independent check. For fixed \(\phi>0\) and \(\theta<0\), define \(q=-\theta>0\), so \(b(\theta)=-\log q\). Then the exponential-dispersion expression on \(y>0\) is

$$ \begin{aligned} \exp\left\{\frac{y\theta-b(\theta)}{\phi}+c(y,\phi)\right\} &= \frac{q^{1/\phi}}{\Gamma(1/\phi)\phi^{1/\phi}} y^{1/\phi-1}\exp\left(-\frac{qy}{\phi}\right). \end{aligned} $$

To integrate this expression, use the gamma integral \(\int_0^\infty y^{r-1}e^{-sy}\,dy=\Gamma(r)/s^r\), valid for \(r>0\) and \(s>0\). Here \(r=1/\phi>0\) and \(s=q/\phi>0\). Therefore the integral of the density expression is

$$ \frac{q^{1/\phi}}{\Gamma(1/\phi)\phi^{1/\phi}} \frac{\Gamma(1/\phi)}{(q/\phi)^{1/\phi}} =1. $$

This calculation shows that the stated base-measure term and cumulant function produce a normalized density throughout the domain \(\theta<0\). The boundary \(\theta=0\) is not included: there \(q=0\), and the gamma-integral argument requires a strictly positive rate.

Worked Conversions

Worked Example: Convert Shape and Scale to the Dispersion Form

Suppose \(Y\) has a gamma distribution with shape \(\alpha=4\) and scale \(\beta=2.5\). Find \(\mu,\phi,\theta,b(\theta)\), and \(c(y,\phi)\).

For a gamma distribution in this convention, \(\mu=\alpha\beta\), so \(\mu=4(2.5)=10\). The dispersion is the reciprocal shape: \(\phi=1/\alpha=1/4\). As a check, \(\phi\mu=(1/4)(10)=2.5\), which recovers the original scale.

The natural parameter is \(\theta=-1/\mu=-1/10=-0.1\), which is in the required negative domain. The cumulant function is \(b(\theta)=-\log(0.1)=\log 10\). Finally, for \(y>0\),

$$ \begin{aligned} c(y,1/4) &=(4-1)\log y-\log\Gamma(4)-4\log(1/4)\\ &=3\log y-\log 6+4\log 4. \end{aligned} $$

Here \(\Gamma(4)=3!=6\). These components give the same shape-4, scale-2.5 density; in particular, the coefficient of \(\log y\) is \(3\), as required by the original power \(y^{\alpha-1}=y^3\).

Worked Example: Check a Density Numerically in Both Forms

Take \(\mu=5\), \(\phi=1/2\), and evaluate the density at \(y=3\). The associated gamma shape is \(1/\phi=2\), and its scale is \(\phi\mu=2.5\).

In the ordinary gamma density,

$$ \begin{aligned} f(3) &=\frac{3^{2-1}e^{-3/2.5}}{\Gamma(2)(2.5)^2}\\ &=\frac{3e^{-1.2}}{6.25} \approx 0.1446. \end{aligned} $$

For the exponential-dispersion calculation, \(\theta=-1/5=-0.2\), \(b(\theta)=\log 5\), and \(c(3,1/2)=\log 3-\log\Gamma(2)-2\log(1/2)=\log 3+2\log 2\). Thus

$$ \begin{aligned} \log f(3) &=\frac{3(-0.2)-\log 5}{0.5}+\log 3+2\log 2\\ &=\frac{-0.6-1.6094}{0.5}+1.0986+1.3863\\ &\approx -1.9340, \qquad f(3)=e^{-1.9340}\approx 0.1446. \end{aligned} $$

The two computations agree. This checks not just the natural-parameter terms, but also the constants in the base-measure term.

Worked Example: Recover the Density from the Components

Suppose \(\theta=-1/12\) and \(\phi=1/3\). Write the corresponding gamma parameters, then evaluate the density at \(y=6\).

From \(\theta=-1/\mu\), the mean is \(\mu=12\). The shape is \(1/\phi=3\), and the scale is \(\phi\mu=(1/3)(12)=4\). The gamma density at \(6\) is therefore

$$ f(6)=\frac{6^{3-1}e^{-6/4}}{\Gamma(3)4^3} =\frac{36e^{-1.5}}{2(64)} =\frac{9e^{-1.5}}{32} \approx 0.0628. $$

The exponential-dispersion components give \(b(\theta)=\log 12\) and \(c(6,1/3)=2\log 6-\log\Gamma(3)-3\log(1/3) =2\log6-\log2+3\log3\). Hence

$$ \begin{aligned} \log f(6) &=3\left(6(-1/12)-\log12\right) +2\log6-\log2+3\log3\\ &\approx -8.9547+6.1862\\ &\approx -2.7685, \qquad f(6)=e^{-2.7685}\approx 0.0628. \end{aligned} $$

This example also illustrates that the base-measure term depends on \(y\) and \(\phi\), whereas \(\theta\) carries the dependence on the mean.

Interpreting the Components Correctly

The parameter mapping is summarized below. In particular, the scale is \(\phi\mu\), not \(\phi\); the dispersion is the reciprocal of the gamma shape.

Exponential-dispersion componentGamma valueInterpretation
\(\theta\)\(-1/\mu\)Natural parameter; strictly negative
\(b(\theta)\)\(-\log(-\theta)\)Cumulant function on \(\theta<0\)
\(a(\phi)\)\(\phi\)Dispersion scaling
\(c(y,\phi)\)\((1/\phi-1)\log y-\log\Gamma(1/\phi)-(1/\phi)\log\phi\)Base-measure term for \(y>0\)
Gamma shape and scale\(1/\phi\) and \(\phi\mu\)Ordinary gamma parameterization

The division between \(b\) and \(c\) is made according to the exponential-dispersion convention: \(y\theta-b(\theta)\) is divided by \(a(\phi)\), while \(c(y,\phi)\) is not. A quick check is to inspect the log density: the term \(-y/(\phi\mu)\) and the term \(-\log\mu/\phi\) belong together in \(\{y\theta-b(\theta)\}/\phi\). The remaining powers and normalizing constants form \(c\).

Common Mistake: Calling the Scale the Dispersion

A frequent error is to identify the gamma scale \(\beta\) with the exponential-dispersion parameter \(\phi\). This fails because the scale changes with the mean: under this parameterization, \(\beta=\phi\mu\), while \(\phi=1/\alpha\). For example, shape \(4\) and scale \(2.5\) give \(\phi=1/4\), not \(2.5\), and \(\mu=10\). Substituting \(2.5\) for \(\phi\) would produce the wrong shape \(1/\phi\) and the wrong powers and normalizing constants in the density.

Another useful safeguard is to check the support and parameter domain whenever using the representation: \(y\) must be positive, \(\phi\) must be positive, and \(\theta\) must be negative. A formula involving \(\log y\) is not a gamma density formula at \(y\leq0\), and \(b(\theta)=-\log(-\theta)\) is not real-valued for \(\theta\geq0\).

Key takeaway: For a gamma response with mean \(\mu>0\) and dispersion \(\phi>0\), the shape is \(1/\phi\), the scale is \(\phi\mu\), the natural parameter is \(-1/\mu\), and the cumulant function is \(-\log(-\theta)\). The remaining response and dispersion terms belong to \(c(y,\phi)\).

Check Your Understanding

Use the density and component definitions above to answer each question.

  1. A gamma response has shape \(5\) and scale \(3\). Find \(\mu\), \(\phi\), and \(\theta\), and verify that the scale equals \(\phi\mu\).
  2. For a gamma response with \(\mu=8\), state the natural parameter and cumulant function value in terms of logarithms.
  3. Why must the natural parameter be negative in this gamma representation?
  4. Which terms in the log density belong to \(c(y,\phi)\), and which belong to \(\{y\theta-b(\theta)\}/\phi\)?
  5. For \(\phi=1/4\), what gamma shape does the representation imply, and what is the coefficient of \(\log y\) in the base-measure term?
Clinical Biostats