Why Use a Gamma GLM?
Some outcomes are continuous, strictly positive, and strongly right-skewed. Examples in hypothetical actuarial settings include positive repair costs per repair and positive payment amounts on claims, when the analysis includes only observations with a payment. Such outcomes are not well represented by a model that allows negative fitted means. A Gamma generalized linear model (GLM) provides a distribution on positive values and relates its conditional mean to predictors through a link function.
The choice of link affects how predictors change the mean; it does not change the response family. In particular, a Gamma GLM with a log link and one with an inverse link both assume Gamma-distributed responses, but they impose different mean structures. Each specification also implies a particular relationship between the conditional mean and variance.
The Gamma Distribution and Its Variance
To make the parameterization precise, a Gamma random variable with shape \(k>0\) and scale \(\theta>0\) has density
Here \(\Gamma(k)\) is the gamma function. For a Gamma GLM, set \(k=1/\phi\) and \(\theta=\phi\mu\). Both parameters are positive when \(\mu>0\) and \(\phi>0\). This distribution has support \(y>0\): it assigns zero probability to nonpositive outcomes.
The mean-variance relationship follows directly from the shape-scale moments. For a Gamma variable, \(E[Y]=k\theta\) and \(\operatorname{Var}(Y)=k\theta^2\). Substituting the GLM parameters gives \(E[Y]=(1/\phi)(\phi\mu)=\mu\), and
Thus the variance grows quadratically with the mean when dispersion is held fixed. The coefficient of variation, the standard deviation divided by the mean, is \(\sqrt{\phi}\), so it is constant across predictor values under a common-dispersion Gamma model. Larger fitted means therefore have larger absolute standard deviations, even though their relative variability is the same.
These assumptions matter as much as the ability to represent right skew. A standard Gamma GLM is not appropriate for a response that can be zero or negative. It also may be a poor choice if the observed variability does not plausibly grow approximately in proportion to the square of the mean. A transformation or a different model family may be considered, but the Gamma model itself still assumes positive outcomes and this mean-variance pattern.
Log-Link Gamma GLM
With the log link, the linear predictor is the logarithm of the conditional mean:
Because the exponential of any real number is positive, a log-link linear predictor always gives a valid positive mean. For a one-unit increase in a numerical predictor \(x_j\), holding the other predictors fixed, the fitted mean is multiplied by \(\exp(\beta_j)\). This is a multiplicative interpretation: \(\exp(\beta_j)-1\) is the proportional change in the mean, not a fixed dollar or unit change.
For a categorical predictor, a coefficient compares fitted means between levels on the multiplicative scale, conditional on the other predictors. The interpretation applies to the mean, not to every individual response. Individual Gamma outcomes remain variable around their fitted means.
Worked Example: Fitted Means Under a Log Link
A hypothetical insurer models positive repair payments, measured in dollars, using a binary predictor \(x\), where \(x=1\) indicates a specified repair category and \(x=0\) is the reference category. A fitted Gamma GLM has \(\log(\mu)=\log(100)+\log(1.5)x\) and estimated dispersion \(\phi=0.16\). Calculate the fitted mean and variance in each category, and interpret the predictor coefficient.
Method and assumptions. Use the log-link inverse transformation \(\mu=\exp(\eta)\) and the Gamma variance formula \(\operatorname{Var}(Y\mid x)=\phi\mu^2\). The model assumes strictly positive repair payments and the same dispersion in both categories.
Reference category, \(x=0\). The linear predictor is \(\eta=\log(100)+\log(1.5)(0)=\log(100)\). Therefore, \(\mu=\exp(\log(100))=100\) dollars, and the variance is \(0.16(100)^2=0.16(10{,}000)=1{,}600\) dollars squared.
Specified category, \(x=1\). The linear predictor is \(\eta=\log(100)+\log(1.5)=\log(150)\). Thus, \(\mu=\exp(\log(150))=150\) dollars, and the variance is \(0.16(150)^2=0.16(22{,}500)=3{,}600\) dollars squared.
Interpretation and check. The fitted mean is multiplied by \(\exp(\log(1.5))=1.5\), a 50% increase from 100 to 150 dollars. The standard deviations are \(\sqrt{1{,}600}=40\) dollars and \(\sqrt{3{,}600}=60\) dollars. Both have coefficient of variation \(0.4=\sqrt{0.16}\), as the common-dispersion assumption requires. The calculation avoids treating the coefficient \(\log(1.5)\) as a fixed dollar increase.
Inverse-Link Gamma GLM
With the inverse link, the linear predictor equals the reciprocal of the conditional mean:
Since \(\mu_i\) must be positive, this specification requires \(\eta_i>0\) for every predictor value at which a fitted mean is needed. Unlike the log link, an unrestricted linear predictor can be zero or negative, in which case the inverse-link formula does not give a valid positive finite mean. Check this condition over the intended prediction range, not just at the observations used for fitting.
The inverse link does not give the same coefficient interpretation as the log link. For a numerical predictor \(x\) with \(\eta=\beta_0+\beta_1x>0\), the fitted mean is \(1/(\beta_0+\beta_1x)\). Its derivative with respect to \(x\) is \(-\beta_1/(\beta_0+\beta_1x)^2=-\beta_1\mu^2\). Consequently, a constant change in \(x\) does not generally produce a constant change in the mean or a constant proportional change.
The canonical link for the Gamma family in the usual exponential-family parameterization is the negative inverse link, \(g(\mu)=-1/\mu\). The inverse link specified here is \(1/\mu\), without the negative sign; it is commonly used but is not the canonical link. Do not confuse this sign distinction when checking a model's formula or interpretation.
Worked Example: Fitted Means Under an Inverse Link
A hypothetical portfolio model predicts positive administration costs, in dollars, from a numerical workload measure \(x\). Its fitted inverse-link Gamma model is \(1/\mu=0.02+0.005x\), with \(\phi=0.09\). Calculate the fitted mean, variance, and standard deviation at \(x=0\) and \(x=4\), and check the direction of the predictor effect.
Method and assumptions. First calculate \(\eta=0.02+0.005x\), then require \(\eta>0\) and set \(\mu=1/\eta\). Use \(\operatorname{Var}(Y\mid x)=0.09\mu^2\). The outcome is assumed strictly positive, and dispersion is common across workload values.
At \(x=0\). The linear predictor is \(\eta=0.02+0.005(0)=0.02>0\). The fitted mean is \(\mu=1/0.02=50\) dollars. The variance is \(0.09(50)^2=0.09(2{,}500)=225\) dollars squared, and the standard deviation is \(\sqrt{225}=15\) dollars.
At \(x=4\). The linear predictor is \(\eta=0.02+0.005(4)=0.02+0.02=0.04>0\). The fitted mean is \(\mu=1/0.04=25\) dollars. The variance is \(0.09(25)^2=0.09(625)=56.25\) dollars squared, and the standard deviation is \(\sqrt{56.25}=7.5\) dollars.
Direction and check. Since \(\beta_1=0.005>0\), the denominator increases as workload increases, so the fitted mean decreases. More specifically, \(d\mu/dx=-0.005\mu^2\), which is negative wherever the mean is valid. The coefficient of variation is \(\sqrt{0.09}=0.3\) at both predictor values: \(15/50=0.3\) and \(7.5/25=0.3\). The example avoids interpreting \(0.005\) as a direct increase in expected dollars.
Comparing the Link Specifications
Both links use the same Gamma response distribution and the same variance function, but their mean curves differ. With a log link, the mean is exponential in the linear predictor. With an inverse link, it is the reciprocal of the linear predictor and is valid only when that predictor is positive. These are substantive assumptions about how the conditional mean changes with predictors, not merely alternative notations for the same model.
| Specification | Mean | Condition for a valid fitted mean | One-unit numerical-predictor effect |
|---|---|---|---|
| Log link | \(\mu=\exp(\eta)\) | Any finite real \(\eta\) | Multiplies the mean by \(\exp(\beta_j)\) |
| Inverse link | \(\mu=1/\eta\) | \(\eta>0\) | Changes the reciprocal mean; the effect depends on the current mean |
Worked Example: Comparing Two Valid Gamma Link Predictions
For a hypothetical positive inspection cost, two fitted Gamma models use the same dispersion \(\phi=0.25\). At \(x=1\), the log-link model has \(\log(\mu)=\log(100)+\log(1.2)x\), while the inverse-link model has \(1/\mu=0.01+0.01x\). Calculate and compare their fitted means and variances at \(x=1\), and state what the comparison does and does not establish.
Method and assumptions. Apply each link's inverse function separately, then calculate the Gamma variance using its own fitted mean and the stated common dispersion. Both models assume the response is strictly positive and conditionally Gamma.
Log-link model. At \(x=1\), \(\eta=\log(100)+\log(1.2)=\log(120)\). Thus \(\mu=\exp(\log(120))=120\) dollars. Its variance is \(0.25(120)^2=0.25(14{,}400)=3{,}600\) dollars squared.
Inverse-link model. At \(x=1\), \(\eta=0.01+0.01(1)=0.02>0\). Thus \(\mu=1/0.02=50\) dollars. Its variance is \(0.25(50)^2=0.25(2{,}500)=625\) dollars squared.
Comparison and check. The predicted means are 120 and 50 dollars, so the two fitted mean structures differ substantially at this predictor value. Their variances differ too because each equals \(0.25\mu^2\). Both are mathematically valid at \(x=1\), but the arithmetic alone does not establish which model is preferable. That requires assessing fit and predictive performance for the intended use; the link should also be defensible for the relevant predictor range.
Common Mistakes and Model Checks
A common exam trap is to use the wrong variance formula. For the Gamma GLM defined here, \(\operatorname{Var}(Y\mid x)=\phi\mu^2\), not \(\phi\mu\). For example, with \(\phi=0.16\) and \(\mu=150\), the incorrect calculation \(0.16(150)=24\) is not the variance under this model. The correct calculation is \(0.16(150)^2=3{,}600\) dollars squared. The square is essential.
A second trap is to overlook the support or the link's domain. A Gamma GLM cannot assign positive probability to an exact zero or negative response. The log link gives a positive mean for every finite linear predictor; the inverse link does not. For an inverse-link model, a prediction at \(\eta=0\) is undefined, and a prediction at \(\eta<0\) would give a negative mean, contrary to the model's requirements. Extrapolation can therefore be especially problematic if the linear predictor may cross zero.
Before interpreting a fitted Gamma GLM, check that the modeled response is strictly positive, identify the link, verify the resulting mean is valid, and remember the conditional variance assumption. A log link supports multiplicative mean interpretations; an inverse link requires an explicit positivity check and has a predictor-dependent effect on the mean. Neither link removes the need to consider whether the Gamma distribution and its mean-variance relationship are suitable for the analysis.
Check Your Understanding
For each problem, use the stated Gamma parameterization and check that the link produces a valid positive mean.
- A log-link Gamma model has \(\log(\mu)=\log(64)+\log(1.25)x\) and \(\phi=0.10\). Find the mean and variance at \(x=2\). (Answer: \(\mu=100\), \(\operatorname{Var}(Y\mid x)=1{,}000\).)
- An inverse-link Gamma model has \(1/\mu=0.04+0.002x\) and \(\phi=0.09\). At \(x=10\), calculate the mean and variance. (Answer: \(\eta=0.06\), \(\mu=50/3\approx16.6667\), and \(\operatorname{Var}(Y\mid x)=25\).)
- A log-link Gamma model has \(\log(\mu)=\log(200)-(\log 2)x\) and \(\phi=0.25\). Find the fitted mean and variance at \(x=1\), and state the multiplicative change from \(x=0\). (Answer: \(\mu=100\), \(\operatorname{Var}(Y\mid x)=2{,}500\), and the mean is multiplied by \(1/2\).)
- An inverse-link model has \(1/\mu=0.03-0.004x\). For what values of \(x\) is the fitted mean valid? Explain what happens at the boundary. (Answer: \(x<7.5\); at \(x=7.5\), \(\eta=0\) and the mean is undefined, while for \(x>7.5\) the mean would be negative.)
- A Gamma response has shape \(k=5\) and scale \(\theta=12\). Convert to the GLM mean-dispersion parameterization, then calculate the mean, variance, and coefficient of variation. (Answer: \(\phi=0.2\), \(\mu=60\), \(\operatorname{Var}(Y)=720\), and the coefficient of variation is \(\sqrt{0.2}\approx0.4472\).)