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.
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.
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
Taking logarithms separates the terms involving \(y\) and \(\mu\):
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.
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
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
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\),
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,
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
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
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
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 component | Gamma value | Interpretation |
|---|---|---|
| \(\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\).
Check Your Understanding
Use the density and component definitions above to answer each question.
- A gamma response has shape \(5\) and scale \(3\). Find \(\mu\), \(\phi\), and \(\theta\), and verify that the scale equals \(\phi\mu\).
- For a gamma response with \(\mu=8\), state the natural parameter and cumulant function value in terms of logarithms.
- Why must the natural parameter be negative in this gamma representation?
- Which terms in the log density belong to \(c(y,\phi)\), and which belong to \(\{y\theta-b(\theta)\}/\phi\)?
- For \(\phi=1/4\), what gamma shape does the representation imply, and what is the coefficient of \(\log y\) in the base-measure term?