Tutorials › Generalized Linear Mixed Models (GLMM) › The Inverse Link for Gamma Means

From GLM to GLMM · Tutorial 21 of 698

The Inverse Link for Gamma Means

Learn how the reciprocal link converts a positive Gamma mean to a linear predictor and how to calculate and check fitted means.

Beginner 9 min read

What You'll Learn

  • Write the reciprocal link and its inverse function.
  • Identify the valid ranges of the predictor and conditional mean.
  • Calculate fitted Gamma means from specified linear predictors.
  • Check whether a predictor specification gives valid means across its covariate range.
  • Recognize unstable predictions near a zero predictor and compare the inverse link with the log link.

Why the Reciprocal Link Requires a Range Check

For a Gamma response, the conditional mean must be positive. The reciprocal link expresses that mean on a predictor scale by taking its reciprocal. Applying the inverse function then turns a predictor value back into a fitted mean. Unlike the log link, this inverse function is not defined for every real-valued predictor: the predictor must be strictly positive.

This restriction matters when calculating fitted values and when specifying a model. A reciprocal transformation of a positive number is positive, but a linear predictor can be zero or negative. Thus, using the inverse link requires checking that the predictor values are in the link's valid range, not merely calculating them and assuming they produce valid means.

Definition and Valid Range

Definition: For a positive conditional mean \(\mu_i\), the reciprocal link is \(g(\mu_i)=1/\mu_i\). If \(\eta_i\) denotes the linear predictor, then \(\eta_i=g(\mu_i)\), and the inverse link is \(g^{-1}(\eta_i)=1/\eta_i\). The link maps \(\mu_i\) in \((0,\infty)\) to \(\eta_i\) in \((0,\infty)\); its inverse maps positive predictors back to positive means.

For a Gamma GLM, write the mean component as \(\eta_i=\mathbf{x}_i^T\boldsymbol{\beta}\), where \(\mathbf{x}_i\) is the predictor vector for observation \(i\) and \(\boldsymbol{\beta}\) is the coefficient vector. Under the reciprocal link, a fitted conditional mean is therefore

$$ \widehat{\mu}_i=\frac{1}{\widehat{\eta}_i} =\frac{1}{\mathbf{x}_i^T\widehat{\boldsymbol{\beta}}}, \qquad \widehat{\eta}_i>0. $$

Here \(\widehat{\eta}_i\) is the fitted linear predictor and \(\widehat{\mu}_i\) is on the response scale, in the units of the outcome. The predictor has reciprocal outcome units: if the outcome is measured in days, then \(\eta_i\) is measured in inverse days. This keeps the equation dimensionally consistent.

The mean component does not by itself specify the entire Gamma model. In the usual Gamma mean-variance formulation, \(Y_i\) has positive support, conditional mean \(\mu_i\), and conditional variance \(\phi\mu_i^2\), where \(\phi>0\) is a dispersion parameter. The reciprocal-link calculation concerns the mean; it does not change the Gamma support or variance relationship. For the GLM calculations here, observations are treated as conditionally independent given their predictors.

Why the Inverse Function Has This Domain

Start with the link equation \(\eta=1/\mu\). Solving for \(\mu\) gives \(\mu=1/\eta\), provided \(\eta\ne 0\). But the Gamma conditional mean must be positive. If \(\eta<0\), then \(1/\eta<0\), which cannot be a valid Gamma mean; if \(\eta=0\), the reciprocal is undefined. Hence the valid predictor range is not merely “nonzero”: it is strictly positive.

$$ \mu>0 \quad\Longrightarrow\quad \eta=\frac{1}{\mu}>0, \qquad \eta>0 \quad\Longrightarrow\quad \mu=\frac{1}{\eta}>0. $$

The inverse function is decreasing because its derivative is \(-1/\eta^2\), which is negative whenever \(\eta>0\). It is also increasingly sensitive in magnitude as \(\eta\) approaches zero: the derivative's magnitude \(1/\eta^2\) grows without bound. These facts explain both the direction of change in fitted means and why very small positive predictors can produce very large fitted means.

$$ \frac{d}{d\eta}\left(\frac{1}{\eta}\right) =-\frac{1}{\eta^2}<0 \quad\text{for }\eta>0, \qquad \lim_{\eta\to 0^+}\frac{1}{\eta}=+\infty. $$

Worked Example: One Predictor Value and a Fitted Mean

Suppose a hypothetical model predicts a mean service time in hours, and at a specified covariate value its fitted linear predictor is \(\widehat{\eta}=0.40\) inverse hours. Calculate and check the fitted mean.

The predictor is positive, so it lies in the valid range. Apply the inverse link:

$$ \widehat{\mu} =\frac{1}{\widehat{\eta}} =\frac{1}{0.40\ \text{hour}^{-1}} =2.50\ \text{hours}. $$

The fitted conditional mean service time at this covariate value is 2.50 hours. This is a model-based mean, not a guarantee that each service time is 2.50 hours. The units also check: dividing by inverse hours gives hours.

Calculating Means Across Predictor Values

With a linear predictor, each covariate setting first determines \(\widehat{\eta}\); only then should the reciprocal be taken. The validity check belongs to the predictor scale. A positive fitted mean at one covariate value does not establish that the same model gives valid means at every other value.

Worked Example: Fitted Means Over a Covariate Range

Consider a hypothetical Gamma model for a positive outcome measured in days. Let \(x\) be a dimensionless covariate, and suppose the fitted predictor is \(\widehat{\eta}=0.10+0.02x\), measured in inverse days. Calculate fitted means at \(x=0\), \(x=2\), and \(x=5\), and check the predictor over \(0\le x\le 5\).

At \(x=0\), the predictor is \(0.10+0.02(0)=0.10\) inverse days, so \(\widehat{\mu}=1/0.10=10.0\) days.

At \(x=2\), the predictor is \(0.10+0.02(2)=0.14\) inverse days, so \(\widehat{\mu}=1/0.14=7.143\) days.

At \(x=5\), the predictor is \(0.10+0.02(5)=0.20\) inverse days, so \(\widehat{\mu}=1/0.20=5.00\) days.

Across the stated range, the predictor increases from 0.10 to 0.20 inverse days and remains positive. The resulting fitted means are valid and decrease from 10.0 to 5.00 days. This direction is consistent with the decreasing inverse function. The calculations establish fitted conditional means at these covariate values; they do not establish a causal effect of \(x\).

Checking the Predictor Before Reporting Predictions

For a specified set of observations, calculate the fitted predictor for each row and check that every value is positive before applying the inverse link. If predictions are intended for a continuous covariate interval, check the predictor throughout that interval rather than only at a convenient example point. A linear predictor may cross zero, even when it is positive for all observed rows.

Worked Example: A Predictor That Leaves the Valid Range

Suppose a hypothetical model predicts a positive outcome measured in days, with \(\widehat{\eta}=0.30-0.04z\) inverse days, where \(z\) is a dimensionless covariate. Check predictions at \(z=0\), \(z=5\), and \(z=8\).

At \(z=0\), \(\widehat{\eta}=0.30-0.04(0)=0.30\) inverse days, giving \(\widehat{\mu}=1/0.30=3.333\) days.

At \(z=5\), \(\widehat{\eta}=0.30-0.04(5)=0.10\) inverse days, giving \(\widehat{\mu}=1/0.10=10.0\) days.

At \(z=8\), \(\widehat{\eta}=0.30-0.04(8)=-0.02\) inverse days. The algebraic reciprocal would be \(-50\) days, but this is not a valid fitted Gamma mean. It is an indication that the model's predictor is outside the link's valid range at \(z=8\). The predictor equals zero at \(z=7.5\), where the inverse link is undefined; it is positive only for \(z<7.5\).

Thus the first two predictions are valid, while the third is not. If \(z=8\) is a covariate value at which the model must make predictions, this specification has a range problem there. One must not report the negative reciprocal as a meaningful mean.

Diagnostics, Alternatives, and Limitations

A practical range diagnostic is to compute the linear predictor for every observed predictor vector and identify its minimum and maximum. For prediction beyond the observed data, determine whether the predictor can approach or cross zero over the intended covariate domain. With a linear predictor, solving \(\mathbf{x}^T\widehat{\boldsymbol{\beta}}=0\) can reveal a boundary at which the fitted mean ceases to be defined. This is a diagnostic for the mean specification, not a test of whether the Gamma distribution itself is appropriate.

Even if every predictor is positive, values close to zero deserve attention. For example, \(\eta=0.01\) inverse days gives a fitted mean of \(100\) days, whereas \(\eta=0.02\) inverse days gives \(50\) days. Small changes on the predictor scale can therefore correspond to large changes on the mean scale near zero. Examine the actual predictor values and predictions, especially at the edges of the covariate range.

The log link is a common alternative for a positive mean. Its inverse maps any real-valued predictor to a positive mean, whereas the reciprocal link requires a positive predictor and produces a decreasing mean as the predictor increases. The identity link is another possible form, but it also requires attention to whether its predictions remain positive. These alternatives impose different relationships between predictors and the conditional mean; the fact that one has a more convenient range does not alone establish that it is appropriate.

The reciprocal link cannot produce a finite mean at a zero predictor, or a positive mean from a negative predictor. Also, the Gamma response model requires strictly positive outcomes. A data set with genuine zeros is not made compatible with the Gamma support merely by choosing a link that has positive fitted means. Finally, a valid mean prediction does not by itself verify the distributional assumptions or adequacy of the full model.

Key takeaway: For the reciprocal link, \(\eta=1/\mu\) and \(\mu=1/\eta\). Both the conditional mean and the predictor must be strictly positive. Calculate and check the predictor first; a zero or negative value cannot yield a valid Gamma fitted mean.

Common Mistakes

  • Taking a reciprocal without checking its sign. A negative predictor gives a negative reciprocal, not a valid Gamma mean. Check \(\widehat{\eta}>0\) before reporting \(\widehat{\mu}=1/\widehat{\eta}\).
  • Treating zero as an acceptable predictor. The inverse link is undefined at zero. As a positive predictor approaches zero, the fitted mean grows without bound.
  • Assuming positive fitted means are guaranteed for all inputs. The reciprocal of a positive predictor is positive, but a linear predictor can become nonpositive at some covariate values. Check the full range of intended predictions.
  • Confusing link-scale and response-scale values. The predictor is measured in reciprocal outcome units; the inverse-link result is a mean in outcome units.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. A hypothetical model has predictor \(\widehat{\eta}=0.25\) inverse hours. What is its fitted mean, with units?
  2. For the reciprocal link, what predictor values give a valid positive, finite conditional mean?
  3. A model for an outcome measured in days has \(\widehat{\eta}=0.08\) inverse days. Calculate the fitted mean.
  4. For \(\widehat{\eta}=0.12-0.03x\), find the largest \(x\) for which the predictor remains strictly positive.
  5. Why is a fitted predictor of \(-0.01\) not a valid Gamma mean prediction after taking its reciprocal?

Solutions. (1) \(\widehat{\mu}=1/0.25=4.00\) hours. (2) The predictor must satisfy \(\widehat{\eta}>0\); zero is undefined and a negative value gives a negative reciprocal. (3) \(\widehat{\mu}=1/0.08=12.5\) days. (4) Solve \(0.12-0.03x>0\), which gives \(x<4\); there is no largest included value because \(x=4\) yields zero, but the upper boundary is 4. (5) Its reciprocal is \(-100\) in outcome units, which is negative and therefore cannot be the positive conditional mean of a Gamma response.

Clinical Biostats