From a Gamma Density to Canonical Form
A gamma model can be indexed by its shape and rate. When the shape is fixed and only the rate changes, the density has a particularly direct exponential-family representation: the response itself is the sufficient statistic, and the rate becomes the negative of the natural parameter. The minus sign matters because a gamma density must decay as the response grows.
Throughout, let the fixed shape be \(\alpha>0\), let the varying rate be \(\lambda>0\), and let the response be \(Y>0\). Using the rate parameterization, the gamma density is
where \(\Gamma(\alpha)=\int_0^\infty t^{\alpha-1}e^{-t}\,dt\). Outside \(y>0\), the density is zero. The shape \(\alpha\) is held fixed in this tutorial; only \(\lambda\) varies.
The indicator in \(h(y)\) records the common support \(y>0\). The power \(y^{\alpha-1}\) is part of the base measure because \(\alpha\) is fixed; it does not vary with \(\eta\). The natural parameter is negative because \(\eta=-\lambda\), while every valid rate satisfies \(\lambda>0\).
Deriving the Log-Partition Function
The log-partition function is determined by the requirement that the density integrate to one. With the base measure above and \(T(y)=y\), the normalizing integral is
For \(\eta<0\), set \(t=(-\eta)y\). Then \(y=t/(-\eta)\) and \(dy=dt/(-\eta)\). Applying the definition of the gamma function gives
In canonical form, the normalizing factor is \(e^{A(\eta)}\). Therefore \(e^{A(\eta)}=(-\eta)^{-\alpha}\), so \(A(\eta)=-\alpha\log(-\eta)\) for \(\eta<0\). Equivalently, substituting \(\eta=-\lambda\) yields
This recovers the original gamma density, including its normalizing constant. In this convention the factor \(1/\Gamma(\alpha)\) is included in the base measure, so it does not appear in \(A(\eta)\). A different allocation of parameter-free constants can change the displayed base measure and log-partition function together, but not the density.
Proof. When \(\eta<0\), the substitution above proves that the normalizing integral is finite and equals \((-\eta)^{-\alpha}\). At \(\eta=0\), the integral is proportional to \(\int_0^\infty y^{\alpha-1}\,dy\), which diverges because \(\alpha>0\). If \(\eta>0\), the integrand \(y^{\alpha-1}e^{\eta y}\) does not have an integrable tail; in particular, its exponential factor grows without bound. Thus the integral is finite exactly for \(\eta<0\). Taking its logarithm gives \(A(\eta)=-\alpha\log(-\eta)\). \(\square\)
Worked Representations
Worked Example: Shape 2 and Rate 3
Let \(\alpha=2\) and \(\lambda=3\). Since \(\Gamma(2)=1\), the gamma density is
The canonical quantities are \(\eta=-3\), \(T(y)=y\), \(h(y)=y\) for \(y>0\), and
Reconstructing the density,
The coefficient \(9\) comes from \(e^{-A(-3)}\); the power of \(y\) remains in the base measure.
Worked Example: Shape One-Half and Rate 4
For \(\alpha=\tfrac12\), \(\lambda=4\), and \(\Gamma(\tfrac12)=\sqrt{\pi}\), the density is
Here \(\eta=-4\), \(h(y)=y^{-1/2}/\sqrt{\pi}\), and
Thus
The base measure has a negative power of \(y\), but this causes no problem: the density is integrable near zero because its exponent is \(-\tfrac12>-1\).
Worked Example: Shape 3 and Rate One-Half
Let \(\alpha=3\), \(\lambda=\tfrac12\). Since \(\Gamma(3)=2\), the density becomes
The base measure is \(h(y)=y^2/2\), the natural parameter is \(\eta=-\tfrac12\), and the log-partition value is
Consequently,
This example also checks the normalizing constant directly: the exponential factor contributed \(1/8\), and the base measure contributed \(1/2\).
What the Fixed-Shape Assumption Does
Fixing \(\alpha\) is not a cosmetic choice. It makes \(y^{\alpha-1}/\Gamma(\alpha)\) a parameter-free base measure while the rate changes through \(\eta=-\lambda\) and \(A(\eta)\). If the shape changes as well, this displayed base measure changes with the parameter, so it is no longer the same one-parameter representation. This tutorial's canonical form describes varying rate at one fixed shape, not simultaneous variation of shape and rate.
The natural parameter also has an interpretable sign constraint. Increasing \(\lambda\) makes \(\eta=-\lambda\) more negative, increasing the strength of the exponential decay \(e^{\eta y}\). A nonnegative \(\eta\) cannot normalize this power-law carrier over the positive half-line, as the normalizing-integral calculation showed.
Proof. Every density in the family is supported on the same set \((0,\infty)\), independently of \(\lambda\). The natural parameter ranges over \((-\infty,0)\), which is an open subset of the real line. Finally, \(T(y)=y\) takes different values on subsets of positive measure within \((0,\infty)\); for example, it is at most \(1\) on \((0,1)\) and greater than \(2\) on \((2,3)\). Thus it is not constant almost everywhere under any of these gamma densities, which are positive throughout their support. These are the stated regularity properties. \(\square\)
This result is useful as a structural check: the parameter changes through a single scalar natural parameter over an open domain, while the support and carrier remain fixed. It does not require treating the shape as an additional parameter.
Common Mistake: Using the Rate as the Natural Parameter
A frequent error is to write the exponent as \(+\lambda y\), set \(\eta=\lambda>0\), and then choose a log-partition function to normalize the density. That sign does not reproduce the gamma kernel: \(e^{+\lambda y}\) grows rather than decays as \(y\) increases, and its integral over \((0,\infty)\) is infinite. The correction is to retain the density's factor \(e^{-\lambda y}\), set \(\eta=-\lambda\), and use the domain \(\eta<0\).
Another mistake is to put \(y^{\alpha-1}\) into the log-partition function. It depends on the observation \(y\), whereas \(A(\eta)\) may depend only on the natural parameter. With fixed shape, this power belongs in the base measure; the log-partition function is the parameter-only term \(-\alpha\log(-\eta)\).
Check Your Understanding
Use the fixed-shape gamma representation to answer the following.
- For shape \(4\) and rate \(2\), identify \(\eta\), \(T(y)\), \(h(y)\), and \(A(\eta)\).
- Why must the natural parameter be negative in this representation?
- For shape \(\tfrac32\), write the base measure and log-partition function.
- What part of the stated representation would cease to be parameter-free if the shape were allowed to vary?
- Show that the log-partition function for shape \(2\) at \(\eta=-5\) is \(-2\log(5)\).