From a Mean to a Linear Predictor
In a generalized linear model, the mean of the response and the linear predictor are expressed on different scales. The model’s link function connects these two quantities: it takes a mean as input and returns the corresponding linear predictor. Its inverse makes the conversion in the other direction. This tutorial focuses on carrying out and checking those conversions for specified values.
Write \(\mu\) for a mean and \(\eta\) for its corresponding linear predictor. If the link is \(g\), the defining relationship is \(\eta=g(\mu)\). Conversely, if the inverse link is \(g^{-1}\), then \(\mu=g^{-1}(\eta)\). The symbol \(g^{-1}\) denotes an inverse function, not the reciprocal \(1/g\).
The direction of conversion is important. Start with a mean and apply \(g\) to get a predictor. Start with a predictor and apply \(g^{-1}\) to get a mean. In a model with observations indexed by \(i\), this is commonly written as \(\eta_i=g(\mu_i)\) and \(\mu_i=g^{-1}(\eta_i)\). If the linear predictor has already been calculated, for example as \(\eta_i=x_i^\mathsf{T}\beta\), the inverse link converts it to the model mean.
Two-Way Conversion and a Round-Trip Check
A reliable calculation has three parts: identify the starting scale, apply the function that moves to the other scale, and check by applying the reverse function. The check is useful for catching a reversed link, an incorrect inverse, or a numerical error.
A mean \(\mu\) calls for the link \(g\); a predictor \(\eta\) calls for the inverse link \(g^{-1}\).
Calculate \(\eta=g(\mu)\) or \(\mu=g^{-1}(\eta)\), as appropriate.
Apply the reverse function and verify that it returns the starting value, up to any rounding used.
Proof. By definition, \(g^{-1}\) is the inverse of \(g\) on the corresponding sets. The defining property of an inverse is that composing the function with its inverse in either order returns the input. Therefore \(g^{-1}(g(\mu))=\mu\) for each eligible \(\mu\), and \(g(g^{-1}(\eta))=\eta\) for each eligible \(\eta\). \(\square\)
This identity is a structural check, not a guarantee that rounded calculations will reproduce every displayed digit. For example, if a value is rounded before the reverse conversion, the returned value may differ slightly from the unrounded starting value.
Worked Conversions for Common Links
The link determines the arithmetic used to change scales. These examples focus on numerical conversion, not on choosing a link for a particular response distribution or interpreting model coefficients.
Worked Example: Identity Link
For the identity link, \(g(\mu)=\mu\). Convert the mean \(\mu=4.6\) to the predictor scale, then recover the mean.
Mean to predictor. Apply the link directly:
Predictor to mean. The inverse of the identity function is itself, so \(g^{-1}(\eta)=\eta\). Thus
Check. Applying \(g\) to the recovered mean gives \(g(4.6)=4.6\), the original predictor. Both scales have the same numerical value for this link.
Worked Example: Log Link
For the log link, \(g(\mu)=\log(\mu)\), with inverse \(g^{-1}(\eta)=\exp(\eta)\). Convert \(\mu=12\) to the predictor scale, then return to the mean scale.
Mean to predictor.
Predictor to mean. Use the exponential function, not another logarithm:
The small discrepancy from 12 is due to rounding \(\log(12)\) to four decimal places. Using the unrounded value gives \(\exp(\log(12))=12\) exactly by the inverse identity.
Worked Example: Logit Link
For a mean between 0 and 1, the logit link is \(g(\mu)=\log\!\left(\frac{\mu}{1-\mu}\right)\), and its inverse is \(g^{-1}(\eta)=\frac{\exp(\eta)}{1+\exp(\eta)}\). Convert \(\mu=0.25\) to the predictor scale and back.
Mean to predictor. Substitute \(0.25\):
Predictor to mean. Using the unrounded predictor, \(\exp(\eta)=\frac{1}{3}\). Therefore
The recovered mean matches the starting value. A negative predictor here corresponds to a mean below \(0.5\); the calculation itself requires only substituting into the link and inverse-link formulas.
An Affine Link and Its Inverse
An affine link provides a useful general check on how an inverse is calculated. If \(g(\mu)=a+b\mu\), with \(a\) and \(b\) fixed and \(b\ne 0\), solve the equation \(\eta=a+b\mu\) for \(\mu\).
Proof. Starting from \(\eta=a+b\mu\), subtract \(a\) from both sides to obtain \(\eta-a=b\mu\). Since \(b\ne 0\), divide by \(b\), giving \(\mu=(\eta-a)/b\). To check the formula in the other direction,
In the forward direction,
Both compositions return their input, so the stated formula is the inverse. The condition \(b\ne 0\) is essential: if \(b=0\), then \(g(\mu)=a\) for every \(\mu\), and the equation cannot be solved uniquely for an arbitrary mean. \(\square\)
Using the Inverse Link in a Model
Suppose a model specifies a linear predictor \(\eta_i=x_i^\mathsf{T}\beta\) for case \(i\) and uses link \(g\) to relate that predictor to the model mean \(\mu_i\). By the definition of the link, \(\eta_i=g(\mu_i)\). Applying the inverse link gives the mean-scale quantity:
This is a conversion of the model’s mean, not a conversion of the observed response. In general, the observed response \(Y_i\) is random, while \(\mu_i\) denotes its model mean. Applying \(g^{-1}\) to a calculated predictor produces the mean specified by the model; it does not assert that the observed response equals that mean.
Derivation. The link relation states \(\eta_i=g(\mu_i)\). Because \(g^{-1}\) is the inverse on the corresponding values, apply it to both sides:
Substitute \(\eta_i=x_i^\mathsf{T}\beta\) into the left side to obtain \(\mu_i=g^{-1}(x_i^\mathsf{T}\beta)\), as claimed. \(\square\)
Common Mistakes and a Practical Check
- Using the wrong direction. Applying \(g^{-1}\) to a mean does not convert that mean to a predictor. Use \(g\) for mean-to-predictor conversion and \(g^{-1}\) for predictor-to-mean conversion.
- Treating \(g^{-1}\) as a reciprocal. The notation means the inverse function. For the log link, for example, \(g^{-1}(\eta)=\exp(\eta)\), not \(1/\log(\eta)\).
- Transforming the observed response instead of the mean. The link relates the model mean to the linear predictor. A predicted mean and an observed response are different quantities.
- Skipping the reverse check. After computing a transformed value, apply the reverse function where possible. A failure to recover the starting value often reveals a formula or arithmetic error.
A compact way to keep the roles straight is to write both equations before substituting numbers: \(\eta=g(\mu)\) and \(\mu=g^{-1}(\eta)\). Then label the value you have and the value you need. The formulas determine the conversion; detailed questions about which values are allowed for a particular link are separate from carrying out that conversion.
Check Your Understanding
Use the link and inverse-link formulas stated in each question.
- For the identity link, what predictor corresponds to \(\mu=7.2\), and what mean is recovered from that predictor?
- For the log link, write the expression that converts \(\mu=5\) to a predictor and the expression that converts that predictor back to a mean.
- For the logit link, calculate the predictor corresponding to \(\mu=0.5\). Show the substitution into the formula.
- Explain why \(g^{-1}\) means an inverse function rather than a reciprocal.
- If \(\eta_i=x_i^\mathsf{T}\beta\), write the formula that converts this predictor to the model mean \(\mu_i\).