Tutorials › Generalized Linear Models › Canonical Links Versus Useful Links for Family Choice

Choosing Continuous Families · Tutorial 642 of 981

Canonical Links Versus Useful Links for Family Choice

Learn what makes a link canonical, how the main continuous-family links compare, and why interpretation and response support still matter when choosing a model.

Intermediate 10 min read

What You'll Learn

  • Define a canonical link through the exponential-family natural parameter.
  • Derive canonical links from Gaussian and power variance functions.
  • Compare canonical and log links for gamma, inverse-Gaussian, and Tweedie models.
  • Interpret how a link changes the relationship between predictors and the conditional mean.
  • Explain why canonical status and computational convenience do not establish family suitability.

Canonical Does Not Mean Automatically Suitable

A generalized linear model pairs a response distribution with a link relating its conditional mean to a linear predictor. Some links are called canonical because they make that predictor equal to the distribution’s natural parameter. This connection often simplifies likelihood calculations. It does not, by itself, make the resulting mean model scientifically sensible or the response distribution appropriate.

For positive outcomes, a log link is often useful because every real-valued linear predictor maps to a positive mean and coefficients have a multiplicative interpretation. A canonical link may instead restrict the range of the linear predictor or imply an awkward mean change for a unit change in a predictor. The choice is therefore not a contest in which “canonical” always wins: distributional assumptions and the scientific meaning of the mean relationship remain central.

Definition and the Canonical-Link Formula

For an exponential-dispersion model, write the density or mass function as

$$ f(y;\theta,\phi) = \exp\left\{ \frac{y\theta-b(\theta)}{\phi}+c(y,\phi) \right\}. $$

Here \(\theta\) is the natural parameter, \(\phi\) is a dispersion parameter, and \(b\) is the cumulant function. In the usual regular case, \(E[Y]=\mu=b'(\theta)\) and \(\operatorname{Var}(Y)=\phi b''(\theta)=\phi V(\mu)\). A GLM specifies a linear predictor \(\eta=x^\mathsf{T}\beta\) and a link \(g\) such that \(g(\mu)=\eta\).

Definition: A canonical link is a link for which the linear predictor equals the natural parameter: \(g(\mu)=\theta\), where \(\mu=b'(\theta)\). Equivalently, the canonical link is the inverse of the mean map \(b'\), on its valid parameter domain. A nonzero affine rescaling of this link is commonly treated as equivalent when the linear predictor coefficients are correspondingly rescaled.

The variance function gives a convenient way to identify the canonical link. Differentiating \(\mu=b'(\theta)\) gives \(d\mu/d\theta=b''(\theta)=V(\mu)\), so \(d\theta/d\mu=1/V(\mu)\) wherever \(V(\mu)>0\). Consequently, up to an additive constant,

$$ g_{\mathrm{can}}(\mu)=\theta(\mu) =\int \frac{1}{V(\mu)}\,d\mu. $$

This determines a link from the family’s variance structure; it does not determine whether that structure fits the response data or whether the induced predictor-to-mean relationship is useful.

Canonical Links for the Main Continuous Families

For a Gaussian model with constant variance, \(V(\mu)=1\), so the canonical link is the identity, \(g(\mu)=\mu\). In a gamma model, \(V(\mu)=\mu^2\), giving \(g(\mu)=-1/\mu\), up to an additive constant. The inverse-Gaussian variance function is \(V(\mu)=\mu^3\), giving \(g(\mu)=-1/(2\mu^2)\), again up to an additive constant.

For a Tweedie model with power variance function \(V(\mu)=\mu^p\), integration gives the canonical link below. In the semicontinuous setting, typically \(1<p<2\); the \(p=2\) gamma and \(p=3\) inverse-Gaussian cases are useful reference points in the broader power-variance family.

$$ g_{\mathrm{can}}(\mu)= \begin{cases} \dfrac{\mu^{1-p}}{1-p}, & p\ne 1,\\[6pt] \log(\mu), & p=1. \end{cases} $$

For \(1<p<2\), this canonical link takes only negative values for positive \(\mu\). The Gaussian, gamma, inverse-Gaussian, and Tweedie links are summarized here using natural-parameter conventions; common affine-equivalent forms are noted.

FamilyVariance function \(V(\mu)\)Canonical linkOften useful alternative
Gaussian1Identity: \(\mu\)Identity for an unrestricted mean; other links when scientifically justified
Gamma\(\mu^2\)\(-1/\mu\)Log: \(\log(\mu)\)
Inverse-Gaussian\(\mu^3\)\(-1/(2\mu^2)\)Log: \(\log(\mu)\)
Tweedie\(\mu^p\)\(\mu^{1-p}/(1-p)\), \(p\ne1\)Log: \(\log(\mu)\)

For example, the gamma canonical link is also often written \(1/\mu\), and the inverse-Gaussian canonical link as \(1/\mu^2\). Each differs from the natural-parameter version by a nonzero affine transformation, so the convention can be absorbed into the coefficients when the model is parameterized accordingly.

Worked Comparisons

Worked Example: Gamma Canonical Versus Log Link

Suppose a gamma GLM has a positive conditional mean \(\mu=4\). Under the natural-parameter convention, its canonical predictor value is

$$ \eta_{\mathrm{can}}=-\frac{1}{\mu}=-\frac{1}{4}=-0.25. $$

Under a log link the predictor value at the same mean is

$$ \eta_{\log}=\log(4)\approx 1.3863. $$

The local change in mean per unit change in predictor also differs. For the canonical link, \(\eta=-1/\mu\), so \(d\eta/d\mu=1/\mu^2\) and \(d\mu/d\eta=\mu^2=16\) at \(\mu=4\). For the log link, \(d\eta/d\mu=1/\mu\), so \(d\mu/d\eta=\mu=4\). Thus, near this mean, the same small predictor change implies different absolute changes in the fitted mean. The canonical value is a distributional parameterization, not a guarantee that its predictor scale is the most interpretable one.

Worked Example: Inverse-Gaussian Canonical Versus Log Link

For an inverse-Gaussian response with mean \(\mu=2\), the natural-parameter canonical predictor is

$$ \eta_{\mathrm{can}}=-\frac{1}{2\mu^2} =-\frac{1}{2(2^2)} =-\frac{1}{8}. $$

The log-link predictor at the same mean is \(\eta_{\log}=\log(2)\approx0.6931\). For the canonical link, \(d\eta/d\mu=\mu^{-3}\), so \(d\mu/d\eta=\mu^3=8\) at \(\mu=2\). For the log link, \(d\mu/d\eta=\mu=2\). This comparison describes local scales, not a claim that one link fits better. The choice should reflect the intended mean relationship and the observed data, while the inverse-Gaussian family’s distributional assumptions must be assessed separately.

Worked Example: A Semicontinuous Tweedie Canonical Link

Take a Tweedie variance power \(p=1.5\), a value in the semicontinuous range, and consider a positive mean \(\mu=4\). The canonical link is

$$ \eta_{\mathrm{can}} =\frac{4^{1-1.5}}{1-1.5} =\frac{4^{-0.5}}{-0.5} =\frac{1/2}{-1/2} =-1. $$

The inverse mapping is \(\mu=[(1-p)\eta]^{1/(1-p)}\), which requires \(\eta<0\) when \(1<p<2\). In contrast, a log link gives \(\eta=\log(4)\approx1.3863\), and its inverse \(\mu=\exp(\eta)\) is positive for every real predictor. The canonical link is mathematically tied to the Tweedie variance function, but a model whose linear predictor can take any real value needs to address the canonical link’s restricted range. A log link may be more convenient for that reason, without changing the need to justify the Tweedie family and power.

Why the Canonical Link Simplifies the Score

The canonical link has a real computational advantage: it gives a particularly simple likelihood score for the regression coefficients. This is one reason it is useful, but the simplification concerns estimation algebra rather than scientific validity.

Result: Suppose \(Y_1,\ldots,Y_n\) are independent observations from a regular exponential-dispersion family with common fixed \(\phi\), and \(\eta_i=x_i^\mathsf{T}\beta\). For a differentiable link and means in the interior of their valid domain, the log-likelihood score is
$$ \frac{\partial\ell}{\partial\beta} = \sum_{i=1}^n x_i\, \frac{(Y_i-\mu_i)}{\phi V(\mu_i)} \frac{d\mu_i}{d\eta_i}. $$

For the canonical link, \(d\eta_i/d\mu_i=1/V(\mu_i)\), so \(d\mu_i/d\eta_i=V(\mu_i)\), and the score reduces to

$$ \frac{\partial\ell}{\partial\beta} = \frac{1}{\phi}\sum_{i=1}^n x_i(Y_i-\mu_i). $$

To derive the general expression, the log-likelihood contribution depending on \(\mu_i\) is \(\{Y_i\theta(\mu_i)-b(\theta(\mu_i))\}/\phi\). By the chain rule and \(b'(\theta)=\mu\), its derivative with respect to \(\mu_i\) is

$$ \frac{1}{\phi} \left(Y_i-b'(\theta_i)\right) \frac{d\theta_i}{d\mu_i} = \frac{Y_i-\mu_i}{\phi V(\mu_i)}. $$

Multiplying by \(d\mu_i/d\eta_i\) and \(d\eta_i/d\beta=x_i\), then summing independent contributions, yields the stated score. Under the canonical link, the variance factors cancel. This derivation assumes the regular family representation and differentiability stated above; it does not extend automatically to a parameter boundary where the derivatives or likelihood are not regular. \(\square\)

What the Link Does—and Does Not—Choose

The link specifies how covariates relate to the conditional mean: \(g(\mu_i)=x_i^\mathsf{T}\beta\). That relationship affects fitted means and therefore, through the family’s variance function, the implied conditional variances. But the link does not replace the family’s assumptions about response support or its conditional distributional shape. For example, choosing a log link does not turn a Gaussian response into a positive-only distribution; a Gaussian variable still has support on the real line.

Family and link choices should therefore answer distinct questions. The family concerns the response distribution and how its variability changes with the mean. The link concerns the mean scale on which predictors act. A link can be computationally convenient and still impose a mean relationship that is scientifically implausible. Conversely, a noncanonical link can be useful if it provides an appropriate mean relationship and yields valid fitted means.

1
Assess the response and family.
Check whether the family’s support and mean–variance structure make sense for the outcome. A link cannot repair a family whose distributional assumptions are unsuitable.
2
Choose a mean relationship.
Ask what a change in a predictor should mean on the response scale. A log link, for example, makes predictor changes act multiplicatively on the mean.
3
Check the link’s domain.
Ensure the linear predictor maps to a valid mean throughout the covariate region of interest. This is especially important for canonical links with restricted predictor ranges.

Common Pitfall

Incorrect reasoning: “The gamma canonical link is mathematically natural, so it must be the best link for positive skewed data.” This confuses a property of the exponential-family parameterization with evidence about the mean relationship and the response distribution.

Correction: Canonical status provides a natural-parameter interpretation and can simplify the score equations. It does not establish that the gamma family fits the outcome, that the implied mean pattern is scientifically appropriate, or that all fitted means are valid. A log link may be preferable when a multiplicative mean effect and an unrestricted real-valued predictor are useful. The family and link should be evaluated for their separate roles.

Key takeaway: A canonical link is defined by the family’s natural parameter. Its algebraic convenience is valuable, but it is not a substitute for checking response support, mean–variance behavior, predictor interpretation, and valid fitted means.

Check Your Understanding

Use the definitions and comparisons above to answer these questions.

  1. What relationship between the linear predictor and the natural parameter defines a canonical link?
  2. For a gamma model with \(V(\mu)=\mu^2\), derive the canonical link up to an additive constant.
  3. At a positive mean, why does a log link automatically produce a positive fitted mean for any real-valued linear predictor?
  4. For a Tweedie model with \(1<p<2\), what restriction does the canonical link place on the predictor?
  5. Give one computational advantage of the canonical link and one reason that advantage does not establish that it is scientifically suitable.
Clinical Biostats