Why a Link Function Is Needed
A generalized linear model forms a linear predictor from the model’s predictors, but the conditional mean of a response may be restricted. A probability must lie between 0 and 1, and a positive expected count cannot be negative. A link function connects these two quantities: it expresses the conditional mean on a scale where the predictors can combine linearly.
For observation \(i\), write the conditional mean as \(\mu_i=E[Y_i\mid \mathbf{x}_i]\), where \(Y_i\) is the response and \(\mathbf{x}_i\) is its predictor vector. The linear predictor is \(\eta_i=\mathbf{x}_i^\mathsf{T}\boldsymbol{\beta}\), where \(\boldsymbol{\beta}\) is the coefficient vector. The link sets the relationship between \(\mu_i\) and \(\eta_i\); it does not change the fact that \(\eta_i\) can be any real number.
In standard GLM use, a link maps the allowable mean range to the real line. This is important because a linear predictor is not itself restricted to a probability range or a positive range. Instead, the inverse link translates any finite value of \(\eta_i\) into a mean in the inverse link’s range. The response distribution and its support still matter: the mean must be valid for the chosen response model.
Four Links and the Means They Permit
The identity, log, logit, and probit links all allow a real-valued linear predictor, but they translate it into different conditional means. Their domains and ranges are therefore central to choosing and interpreting a model.
| Link | Link equation | Inverse link | Allowed conditional mean |
|---|---|---|---|
| Identity | \(g(\mu)=\mu\) | \(g^{-1}(\eta)=\eta\) | All real numbers |
| Log | \(g(\mu)=\log(\mu)\) | \(g^{-1}(\eta)=\exp(\eta)\) | \(\mu>0\) |
| Logit | \(g(\mu)=\log\left(\frac{\mu}{1-\mu}\right)\) | \(g^{-1}(\eta)=\frac{\exp(\eta)}{1+\exp(\eta)}\) | \(0<\mu<1\) |
| Probit | \(g(\mu)=\Phi^{-1}(\mu)\) | \(g^{-1}(\eta)=\Phi(\eta)\) | \(0<\mu<1\) |
Here \(\Phi\) is the cumulative distribution function of a standard normal random variable, and \(\Phi^{-1}\) is its quantile function. A finite logit or probit predictor gives a mean strictly between 0 and 1, not exactly 0 or 1. Those boundary probabilities require predictors tending toward negative or positive infinity. In contrast, the identity link can return any real-valued mean, while the log link always returns a strictly positive mean.
The link alone does not specify the response distribution. For example, logit and probit are both links that can express a conditional probability, but they transform that probability differently. A GLM specification also includes a response family and a linear predictor. A link cannot make an otherwise incompatible mean valid for a response model.
Why the Inverse Link Produces the Mean
The inverse-link relationship follows directly from the definition. If a model states \(g(\mu_i)=\eta_i\), and \(g\) is invertible over its allowed mean domain, apply \(g^{-1}\) to both sides:
This is more than a change in notation. It is the step that turns a fitted predictor into a prediction on the response’s mean scale. For the log link, exponentiation gives a positive mean. For the logit link, solving for \(\mu\) gives the logistic function:
The last step comes from multiplying by \(1-\mu\), then collecting the terms containing \(\mu\): \(\exp(\eta)-\exp(\eta)\mu=\mu\), so \(\exp(\eta)=\mu[1+\exp(\eta)]\). Since \(\exp(\eta)>0\), the resulting mean is between 0 and 1 for every finite \(\eta\).
Worked Examples
Worked Example: Using a Log Link for an Expected Count
A hypothetical model predicts the expected number of equipment alerts per operating month for a site. Its linear predictor is \(\eta=-0.5+0.4x\), where \(x=0\) denotes the reference equipment group and \(x=2\) denotes a group with a specified maintenance feature. The model uses a log link. Calculate both predicted means and the ratio of the second mean to the first.
Method. A log link has \(g(\mu)=\log(\mu)\), so its inverse is \(\mu=\exp(\eta)\). The mean is positive even when the predictor is negative.
For the reference group, \(x=0\), giving \(\eta=-0.5+0.4(0)=-0.5\). Thus \(\mu=\exp(-0.5)=0.6065\) alerts per operating month, to four decimal places.
For the second group, \(x=2\), giving \(\eta=-0.5+0.4(2)=-0.5+0.8=0.3\). Thus \(\mu=\exp(0.3)=1.3499\) alerts per operating month, to four decimal places.
The ratio is \(\exp(0.3)/\exp(-0.5)=\exp(0.8)=2.2255\), to four decimal places. The second fitted mean is about 2.2255 times the reference fitted mean.
Check. Both means are positive, as required by the log link. The ratio also agrees with the change in the linear predictor: exponentiating the predictor difference \(0.3-(-0.5)=0.8\) gives 2.2255. A common mistake is to report \(-0.5\) and \(0.3\) as the expected counts; these are predictor values, not means.
Worked Example: Comparing Logit and Probit Probabilities
A hypothetical underwriting team models whether an application requires manual review. For a particular applicant, the linear predictor is \(\eta=-0.4+0.6x\), where \(x\) is 0 for one application category and 1 for another. Calculate the fitted probabilities for each category using both a logit link and a probit link. Round probabilities to four decimal places.
Method. For \(x=0\), \(\eta=-0.4+0.6(0)=-0.4\). For \(x=1\), \(\eta=-0.4+0.6(1)=0.2\). With the logit link, use \(\exp(\eta)/[1+\exp(\eta)]\). With the probit link, use \(\Phi(\eta)\).
For the logit model at \(x=0\), \(\exp(-0.4)=0.6703\), so the probability is \(0.6703/(1+0.6703)=0.4013\). At \(x=1\), \(\exp(0.2)=1.2214\), so the probability is \(1.2214/(1+1.2214)=0.5498\).
For the probit model at \(x=0\), \(\Phi(-0.4)=0.3446\). At \(x=1\), \(\Phi(0.2)=0.5793\). Thus the logit fitted probabilities are 0.4013 and 0.5498; the probit fitted probabilities are 0.3446 and 0.5793.
Check. All four probabilities lie strictly between 0 and 1. The two links use the same predictor values but produce different probabilities because their inverse functions differ. A common mistake is to treat a probit predictor as a logit predictor and apply the logistic inverse; for a probit model the correct inverse is \(\Phi\).
Worked Example: Checking an Identity-Link Prediction
A hypothetical model for a continuous outcome uses the identity link and has linear predictor \(\eta=2-1.2x\), where \(x\) is a workload index. Calculate the fitted means at \(x=1\) and \(x=2\), and assess them if the outcome is required by the application to be nonnegative.
Method. The identity inverse link is \(g^{-1}(\eta)=\eta\), so the conditional mean equals the linear predictor.
At \(x=1\), \(\eta=2-1.2(1)=0.8\), and the fitted mean is \(0.8\). At \(x=2\), \(\eta=2-1.2(2)=2-2.4=-0.4\), and the fitted mean is \(-0.4\).
The first fitted mean satisfies the nonnegative requirement, but the second does not. The identity link itself permits the second value: its mean range is all real numbers. If the outcome’s application requires a nonnegative conditional mean, this fitted value signals that the identity-link specification or its use at this predictor value is unsuitable for that requirement.
Check. The calculation does not apply an exponential or logistic transformation because the model uses the identity link. A common mistake is to assume that every GLM link automatically restricts predictions to the response’s practical range. It does not; validity must be checked against the link and the response context.
Choosing and Interpreting a Valid Mean Range
A useful selection check is to begin with the mean the analysis needs to model, rather than choosing a link solely because it is familiar. A link’s inverse determines the range of fitted means over all finite linear predictors.
State what \(E[Y_i\mid\mathbf{x}_i]\) represents and the values it can validly take in the response model.
Determine whether \(g^{-1}(\eta)\) can produce only allowed means for every real-valued \(\eta\).
Coefficients act on the linear-predictor scale. Apply the inverse link before reporting a fitted conditional mean.
For a probability mean, both logit and probit inverse links stay strictly within \((0,1)\). The identity link does not enforce that restriction, while the log link only enforces positivity and can produce means greater than 1. For a strictly positive mean, the log inverse link is positive for all finite predictors; identity predictions still need to be checked. These range properties do not by themselves determine which response family is appropriate.
A link also determines how a change in predictors translates to the mean scale. Under a log link, increasing the predictor by \(c\) multiplies the mean by \(\exp(c)\), because \(\exp(\eta+c)/\exp(\eta)=\exp(c)\). Under the identity link, the same predictor change adds \(c\) to the mean. For logit and probit links, a coefficient changes the predictor, but converting that change into a probability difference requires evaluating the inverse link at the relevant predictor values. In particular, a logit coefficient changes the log odds, not the probability by a fixed amount.
Common Exam Traps
- Using the predictor as the mean. With a log link and \(\eta=0.25\), the mean is \(\exp(0.25)=1.2840\), not 0.25.
- Confusing logit and probit inverses. The logit inverse is \(\exp(\eta)/[1+\exp(\eta)]\); the probit inverse is \(\Phi(\eta)\).
- Assuming identity predictions are automatically valid. Identity permits any real mean, so probabilities or nonnegative targets may be predicted outside their allowed ranges.
- Claiming finite logit or probit predictors give boundary probabilities. Their fitted means are strictly between 0 and 1 for finite \(\eta\).
- Treating a link as a response distribution. A link specifies the mean-predictor relationship; a separate response-family choice specifies the distributional model.
Check Your Understanding
For each problem, identify the relevant inverse link and calculate or assess the requested conditional mean.
- A hypothetical event-count model uses a log link with predictor \(\eta=-0.2\). Calculate the fitted mean to four decimal places. (Answer: \(\exp(-0.2)=0.8187\).)
- A model uses the identity link and gives \(\eta=3.5\). What is its fitted mean, and would that value be a valid probability mean? (Answer: The mean is 3.5; it is not a valid probability because it is greater than 1.)
- A logit model gives \(\eta=\log(4)\). Calculate its fitted probability. (Answer: \(4/(1+4)=0.8000\).)
- A probit model gives \(\eta=1.25\). Calculate its fitted probability to four decimal places using the standard normal distribution function. (Answer: \(\Phi(1.25)=0.8944\).)
- A hypothetical binary-outcome model has predictor \(\eta=-1+0.5x\) and uses a logit link. For \(x=4\), calculate the fitted probability to four decimal places, and state whether it is a boundary probability. (Answer: \(\eta=1\), so the probability is \(\exp(1)/[1+\exp(1)]=0.7311\); it is not a boundary probability.)