Tutorials › Generalized Linear Models › Link Functions And Their Inverses

Link Functions and Scale · Tutorial 101 of 981

Link Functions And Their Inverses

Learn to convert a specified mean to its linear predictor and back using the link function and inverse link.

Beginner 9 min read

What You'll Learn

  • Define a link function and its inverse on corresponding sets of values
  • Convert numerical values from the mean scale to the predictor scale
  • Recover a mean from a linear predictor using the inverse link
  • Check conversions by composing a link with its inverse
  • Distinguish transforming a model mean from transforming an observed response

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\).

Definition: A link function \(g\) maps a mean \(\mu\) to a linear predictor \(\eta\) by \(\eta=g(\mu)\). On the corresponding sets of values, its inverse link \(g^{-1}\) maps the predictor back to the mean: \(\mu=g^{-1}(\eta)\). Each input must be a value for which the relevant function is defined.

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.

1
Identify the starting quantity.
A mean \(\mu\) calls for the link \(g\); a predictor \(\eta\) calls for the inverse link \(g^{-1}\).
2
Apply the function in the correct direction.
Calculate \(\eta=g(\mu)\) or \(\mu=g^{-1}(\eta)\), as appropriate.
3
Check the conversion.
Apply the reverse function and verify that it returns the starting value, up to any rounding used.
Result: Round-trip identities. For corresponding values in the domains of the functions, \(g^{-1}(g(\mu))=\mu\) and \(g(g^{-1}(\eta))=\eta\).

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:

$$ \eta=g(\mu)=\mu=4.6. $$

Predictor to mean. The inverse of the identity function is itself, so \(g^{-1}(\eta)=\eta\). Thus

$$ \mu=g^{-1}(4.6)=4.6. $$

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.

$$ \eta=\log(12)\approx 2.4849. $$

Predictor to mean. Use the exponential function, not another logarithm:

$$ \mu=\exp(2.4849)\approx 12.0003. $$

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\):

$$ \eta =\log\!\left(\frac{0.25}{1-0.25}\right) =\log\!\left(\frac{0.25}{0.75}\right) =\log\!\left(\frac{1}{3}\right) \approx -1.0986. $$

Predictor to mean. Using the unrounded predictor, \(\exp(\eta)=\frac{1}{3}\). Therefore

$$ \mu =\frac{\exp(\eta)}{1+\exp(\eta)} =\frac{1/3}{1+1/3} =\frac{1/3}{4/3} =\frac{1}{4} =0.25. $$

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\).

Result: Inverse of an affine link. For \(g(\mu)=a+b\mu\), where \(b\ne 0\), the inverse is \(g^{-1}(\eta)=\frac{\eta-a}{b}\) on the corresponding sets of values.

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,

$$ g\!\left(g^{-1}(\eta)\right) =a+b\left(\frac{\eta-a}{b}\right) =a+\eta-a =\eta. $$

In the forward direction,

$$ g^{-1}(g(\mu)) =\frac{(a+b\mu)-a}{b} =\frac{b\mu}{b} =\mu. $$

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:

$$ \mu_i=g^{-1}(\eta_i)=g^{-1}(x_i^\mathsf{T}\beta). $$

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.

Result: Predictor-to-mean substitution. If \(\eta_i=x_i^\mathsf{T}\beta\) and the link relation is \(\eta_i=g(\mu_i)\), then \(\mu_i=g^{-1}(x_i^\mathsf{T}\beta)\).

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:

$$ g^{-1}(\eta_i) =g^{-1}(g(\mu_i)) =\mu_i. $$

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.

  1. For the identity link, what predictor corresponds to \(\mu=7.2\), and what mean is recovered from that predictor?
  2. 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.
  3. For the logit link, calculate the predictor corresponding to \(\mu=0.5\). Show the substitution into the formula.
  4. Explain why \(g^{-1}\) means an inverse function rather than a reciprocal.
  5. If \(\eta_i=x_i^\mathsf{T}\beta\), write the formula that converts this predictor to the model mean \(\mu_i\).
Clinical Biostats