{
  "id": "link-function",
  "title": "Link Function",
  "lang": "en",
  "source_lang": "en",
  "summary": "A link function connects a response variable’s conditional mean to a linear predictor, allowing regression models to accommodate different response distributions and mean constraints.",
  "category": "mathematics",
  "subcategory": "probability-statistics",
  "type": "concept",
  "aliases": [
    "GLM link",
    "mean link function"
  ],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/link-function/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/link-function/",
      "json": "https://aiwiki.page/zh/link-function.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "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 \\(\\mu\\) given explanatory variables \\(x\\), the model specifies \\(g(\\mu)=x^\\top\\beta\\), where \\(g\\) is the link function and \\(\\beta\\) 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."
    },
    {
      "heading": "Mathematical definition",
      "text": "Let \\(Y_i\\) denote a response and \\(x_i\\) its vector of explanatory variables, possibly including a constant term for an intercept. Write its conditional mean as\n\n\\[\\mu_i=\\operatorname{E}[Y_i\\mid x_i].\\]\n\nThe link function \\(g\\) connects this mean to the linear predictor:\n\n\\[g(\\mu_i)=\\eta_i, \\qquad \\eta_i=x_i^\\top\\beta.\\]\n\nThe term “linear” refers to linearity in the coefficients \\(\\beta\\). The explanatory variables may themselves include powers, interactions, or other fixed transformations.\n\nA 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:\n\n\\[\\mu_i=g^{-1}(\\eta_i).\\]\n\nThe 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.\n\nMany 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."
    },
    {
      "heading": "Role within a generalized linear model",
      "text": "A GLM combines three elements:\n\n- A conditional probability distribution for the response, usually from an exponential dispersion family.\n- A linear predictor built from explanatory variables and coefficients.\n- A link function connecting that predictor to the conditional mean.\n\nThese elements perform different tasks. The distribution specifies how observations vary around their means, while the link specifies how the means depend on explanatory variables.\n\nFor example, a model using the Poisson distribution has conditional variance equal to its conditional mean. Choosing a log link adds the relationship\n\n\\[\\log(\\mu_i)=x_i^\\top\\beta,\\]\n\nbut 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.\n\nThe 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."
    },
    {
      "heading": "Common link functions",
      "text": "Link | Link function \\(g(\\mu)\\) | Inverse link \\(g^{-1}(\\eta)\\) | Typical use\nIdentity | \\(\\mu\\) | \\(\\eta\\) | Unrestricted continuous means\nLog | \\(\\log\\mu\\) | \\(e^\\eta\\) | Positive means, including expected counts\nLogit | \\(\\log\\!\\left(\\mu/(1-\\mu)\\right)\\) | \\(1/(1+e^{-\\eta})\\) | Binary probabilities\nProbit | \\(\\Phi^{-1}(\\mu)\\) | \\(\\Phi(\\eta)\\) | Binary probabilities\nComplementary log-log | \\(\\log[-\\log(1-\\mu)]\\) | \\(1-\\exp[-\\exp(\\eta)]\\) | Binary probabilities, including discrete-time event models\nReciprocal | \\(1/\\mu\\) | \\(1/\\eta\\) | Positive means with a positive predictor\n\nHere, \\(\\Phi\\) is the cumulative distribution function of the standard normal distribution.\n\nIdentity link\n\nThe identity link gives\n\n\\[\\mu_i=x_i^\\top\\beta.\\]\n\nWith normally distributed errors of constant variance, this produces ordinary linear regression. Coefficients describe additive changes in the conditional mean.\n\nThe 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.\n\nLog link\n\nThe log link gives\n\n\\[\\mu_i=\\exp(x_i^\\top\\beta).\\]\n\nThe exponential function ensures that the fitted mean is positive for every finite predictor. Holding other explanatory variables fixed, increasing \\(x_j\\) by one unit multiplies the mean by \\(e^{\\beta_j}\\), provided that variable enters without interactions or additional transformations.\n\nIn count-rate models, exposure \\(t_i>0\\) can be incorporated through an offset:\n\n\\[\\log(\\mu_i)=\\log(t_i)+x_i^\\top\\beta.\\]\n\nThe coefficient of \\(\\log(t_i)\\) is fixed at one. The resulting expected rate is \\(\\mu_i/t_i=\\exp(x_i^\\top\\beta)\\).\n\nLogit, probit, and complementary log-log links\n\nFor a binary response, \\(\\mu=p\\) is the conditional probability of the outcome coded as one.\n\nThe logit link models the logarithm of the odds:\n\n\\[\\log\\left(\\frac{p_i}{1-p_i}\\right)=x_i^\\top\\beta.\\]\n\nIts inverse is the logistic function. In a model without interactions involving \\(x_j\\), \\(e^{\\beta_j}\\) is the conditional odds ratio for a one-unit increase in \\(x_j\\). It is not generally a probability ratio.\n\nThe 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.\n\nThe 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:\n\n\\[p=1-\\exp(-H),\\]\n\nbecause then \\(g(p)=\\log H\\).\n\nFor a binomial count \\(Y_i\\) with \\(n_i\\) trials, these links are usually applied to the success probability \\(p_i\\), with \\(\\operatorname{E}[Y_i\\mid x_i]=n_i p_i\\), rather than directly to the expected count."
    },
    {
      "heading": "Canonical links",
      "text": "An exponential family can be written, in a common parametrization, as\n\n\\[f(y_i;\\theta_i,\\phi) = \\exp\\left\\{ \\frac{y_i\\theta_i-b(\\theta_i)}{a_i(\\phi)} +c(y_i,\\phi) \\right\\}.\\]\n\nHere \\(\\theta_i\\) is the natural parameter, \\(\\phi\\) is a dispersion parameter, and\n\n\\[\\mu_i=b'(\\theta_i), \\qquad \\operatorname{Var}(Y_i\\mid x_i) = a_i(\\phi)b''(\\theta_i).\\]\n\nThe canonical link sets the linear predictor equal to the natural parameter:\n\n\\[g(\\mu_i)=\\theta_i=\\eta_i.\\]\n\nConsequently,\n\n\\[g(\\mu)=(b')^{-1}(\\mu).\\]\n\nImportant examples are:\n\n- The identity link for a normal response with known or separately modeled variance.\n- The log link for a Poisson response.\n- The logit link for a Bernoulli response or binomial success probability.\n\nFor a gamma response, the natural parameter in a standard exponential-dispersion parametrization is \\(-1/\\mu\\). 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.\n\nCanonical 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."
    },
    {
      "heading": "Estimation and computation",
      "text": "Link functions enter maximum likelihood estimation through the dependence of the mean on the coefficients. If\n\n\\[\\operatorname{Var}(Y_i\\mid x_i)=\\phi V(\\mu_i),\\]\n\nthen the coefficient score, for conditionally independent observations with a common dispersion parameter, is\n\n\\[U(\\beta) = \\sum_i \\frac{y_i-\\mu_i}{\\phi V(\\mu_i)} \\frac{d\\mu_i}{d\\eta_i} x_i.\\]\n\nThe factor \\(d\\mu_i/d\\eta_i\\) is determined by the inverse link.\n\nGLMs are often fitted using iteratively reweighted least squares. At each iteration, a working response is formed:\n\n\\[z_i = \\eta_i+(y_i-\\mu_i)\\frac{d\\eta_i}{d\\mu_i},\\]\n\nwith weights\n\n\\[w_i = \\frac{1}{ \\phi V(\\mu_i) \\left(d\\eta_i/d\\mu_i\\right)^2 }.\\]\n\nA weighted least-squares update then produces new coefficients. Observation-specific dispersion or prior weights modify these expressions.\n\nThe 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."
    },
    {
      "heading": "Interpretation on different scales",
      "text": "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,\n\n\\[\\frac{\\partial\\mu}{\\partial x_j} = \\frac{d g^{-1}(\\eta)}{d\\eta}\\beta_j.\\]\n\nFor a logit link, this becomes\n\n\\[\\frac{\\partial p}{\\partial x_j} = p(1-p)\\beta_j.\\]\n\nThus the probability change depends on the current probability and, through it, the values of the explanatory variables.\n\nBecause inverse links are nonlinear, averaging predictions is generally different from applying the inverse link to an average predictor:\n\n\\[\\operatorname{E}[g^{-1}(\\eta)] \\ne g^{-1}(\\operatorname{E}[\\eta]).\\]\n\nThis distinction is important when converting conditional predictions into population averages or integrating over random effects.\n\nA 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."
    },
    {
      "heading": "Distinction from transforming the response",
      "text": "Applying a link to a conditional mean is not the same as transforming each observed response. A log-link model states\n\n\\[\\log\\!\\left(\\operatorname{E}[Y\\mid x]\\right)=x^\\top\\beta,\\]\n\nwhereas a regression on a logged response might state\n\n\\[\\operatorname{E}[\\log Y\\mid x]=x^\\top\\beta.\\]\n\nThese 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.\n\nSimilarly, a link does not make the response normally distributed. It transforms the mean relationship, while the response retains the distribution specified by the model."
    },
    {
      "heading": "Choice and limitations",
      "text": "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.\n\nAlternative 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.\n\nAn 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.\n\nFinally, 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."
    }
  ],
  "links": [
    "generalized-linear-model",
    "conditional-expectation",
    "inverse-function",
    "logistic-regression",
    "real-number",
    "probability-distribution",
    "poisson-distribution",
    "cumulative-distribution-function",
    "normal-distribution",
    "linear-regression",
    "exponential-function",
    "logit",
    "logistic-function",
    "odds-ratio",
    "binomial-distribution",
    "bernoulli-distribution",
    "maximum-likelihood-estimation",
    "iteratively-reweighted-least-squares",
    "numerical-stability",
    "confidence-interval",
    "cross-validation"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}