A link function is a function that relates the conditional mean of a response variable to the linear predictor of a generalized linear model (GLM). If the response has mean given explanatory variables , the model specifies , where is the link function and is a vector of coefficients. This construction allows a predictor that is linear in its coefficients to describe nonlinear changes in probabilities, counts, and other responses. The link specifies the mean relationship; it does not, by itself, specify the response distribution.
Mathematical definition
Let denote a response and its vector of explanatory variables, possibly including a constant term for an intercept. Write its conditional mean as
The link function connects this mean to the linear predictor:
The term “linear” refers to linearity in the coefficients . The explanatory variables may themselves include powers, interactions, or other fixed transformations.
A link is ordinarily one-to-one and differentiable on the interior of the admissible mean space. Its inverse, sometimes called the response function, returns the mean:
The link therefore operates from the mean scale to the predictor scale, while the inverse link operates in the opposite direction. For example, in logistic regression, the link is the logit, whereas the inverse link is the logistic function.
Many links map the entire interior of the mean space onto the real line, so every finite linear predictor produces an admissible mean. This is not universal. Some links require restrictions on the predictor or coefficients.
Role within a generalized linear model
A GLM combines three elements:
- A conditional probability distribution for the response, usually from an exponential dispersion family.
- A linear predictor built from explanatory variables and coefficients.
- A link function connecting that predictor to the conditional mean.
These elements perform different tasks. The distribution specifies how observations vary around their means, while the link specifies how the means depend on explanatory variables.
For example, a model using the Poisson distribution has conditional variance equal to its conditional mean. Choosing a log link adds the relationship
but the logarithm does not create the Poisson variance assumption. Conversely, using a log link does not require a Poisson distribution: positive continuous responses can also be modeled with a log link and a different distribution.
The GLM framework was introduced in a unified form by John Nelder and Robert Wedderburn in 1972, bringing models such as normal linear regression and logistic regression into a common formulation.
Common link functions
| Link | Link function | Inverse link | Typical use |
|---|---|---|---|
| Identity | Unrestricted continuous means | ||
| Log | Positive means, including expected counts | ||
| Logit | Binary probabilities | ||
| Probit | Binary probabilities | ||
| Complementary log-log | Binary probabilities, including discrete-time event models | ||
| Reciprocal | Positive means with a positive predictor |
Here, is the cumulative distribution function of the standard normal distribution.
Identity link
The identity link gives
With normally distributed errors of constant variance, this produces ordinary linear regression. Coefficients describe additive changes in the conditional mean.
The identity link can also be used with other response distributions, but constraints may be necessary. For example, a Poisson mean must remain positive, whereas an unrestricted linear predictor can be negative.
Log link
The log link gives
The exponential function ensures that the fitted mean is positive for every finite predictor. Holding other explanatory variables fixed, increasing by one unit multiplies the mean by , provided that variable enters without interactions or additional transformations.
In count-rate models, exposure can be incorporated through an offset:
The coefficient of is fixed at one. The resulting expected rate is .
Logit, probit, and complementary log-log links
For a binary response, is the conditional probability of the outcome coded as one.
The logit link models the logarithm of the odds:
Its inverse is the logistic function. In a model without interactions involving , is the conditional odds ratio for a one-unit increase in . It is not generally a probability ratio.
The probit link uses the standard normal quantile function. It can be interpreted through a latent normally distributed variable whose crossing of a threshold determines the binary outcome.
The complementary log-log link is asymmetric, unlike the logit and probit links. It arises naturally when an event probability over an interval is expressed through an integrated hazard:
because then .
For a binomial count with trials, these links are usually applied to the success probability , with , rather than directly to the expected count.
Canonical links
An exponential family can be written, in a common parametrization, as
Here is the natural parameter, is a dispersion parameter, and
The canonical link sets the linear predictor equal to the natural parameter:
Consequently,
Important examples are:
- The identity link for a normal response with known or separately modeled variance.
- The log link for a Poisson response.
- The logit link for a Bernoulli response or binomial success probability.
For a gamma response, the natural parameter in a standard exponential-dispersion parametrization is . Thus the strictly canonical link in that parametrization is the negative reciprocal. The positive reciprocal link is also commonly described as the canonical inverse link because its sign can be absorbed into the regression coefficients; the precise statement depends on the parametrization.
Canonical links simplify likelihood derivatives and estimation equations. They are not necessarily the most appropriate links for every application. Interpretation, mean constraints, and the relationship supported by the data also matter.
Estimation and computation
Link functions enter maximum likelihood estimation through the dependence of the mean on the coefficients. If
then the coefficient score, for conditionally independent observations with a common dispersion parameter, is
The factor is determined by the inverse link.
GLMs are often fitted using iteratively reweighted least squares. At each iteration, a working response is formed:
with weights
A weighted least-squares update then produces new coefficients. Observation-specific dispersion or prior weights modify these expressions.
The choice of link affects the working weights, parameter constraints, and numerical stability. A canonical link simplifies computation but does not guarantee that a finite maximum-likelihood estimate exists.
Interpretation on different scales
A coefficient describes a change on the link scale, not necessarily a constant change in the response mean. For a predictor entering linearly without interactions,
For a logit link, this becomes
Thus the probability change depends on the current probability and, through it, the values of the explanatory variables.
Because inverse links are nonlinear, averaging predictions is generally different from applying the inverse link to an average predictor:
This distinction is important when converting conditional predictions into population averages or integrating over random effects.
A confidence interval for a mean can often be constructed on the predictor scale and transformed through the inverse link. For a monotone inverse link, the interval endpoints transform accordingly, with their order reversed if the inverse link is decreasing.
Distinction from transforming the response
Applying a link to a conditional mean is not the same as transforming each observed response. A log-link model states
whereas a regression on a logged response might state
These are different assumptions because logarithms and expectations do not generally commute. A Poisson model with a log link can accommodate observed zeros; taking the logarithm of each observation cannot do so directly.
Similarly, a link does not make the response normally distributed. It transforms the mean relationship, while the response retains the distribution specified by the model.
Choice and limitations
A link must be compatible with the admissible mean space. Logit and probit inverse links automatically produce probabilities between zero and one; a log inverse link produces positive means. An identity link for probabilities or a reciprocal link for positive responses requires additional restrictions.
Alternative links may fit similarly over the observed predictor range but differ substantially near boundaries or under extrapolation. Their coefficients also have different scales and interpretations, so numerical coefficient sizes are not directly comparable across links.
An appropriate link does not correct an inappropriate variance model, dependence among observations, or omitted predictors. Overdispersion and correlation require separate treatment. Model comparisons may use likelihood-based measures, residual diagnostics, or cross-validation, with predictive performance assessed on the response scale relevant to the application.
Finally, a link function describes a statistical mean relationship. Its coefficients do not acquire a causal interpretation solely from the choice of link; causal interpretation requires additional assumptions about the study design and data-generating process.