Introduction
Hello! In our last lesson, we broke down the Generalized Linear Model (GLM) into its three fundamental components: the random component, the systematic component, and the link function. You learned that these three pieces work together to create a flexible modeling framework that overcomes the key limitations of ordinary linear regression.
This lesson zooms in on the most innovative of these components: the link function. Your learning goal is to define the purpose of a link function and identify the canonical link for the Normal, Poisson, and Binomial distributions. Mastering this is essential for your exam, as it forms the basis for correctly specifying and interpreting GLMs. We will solidify what the link function does and why a specific "canonical" link is the default choice for each common data type.
The Purpose of the Link Function
As we briefly covered, the link function, , is the crucial bridge connecting the mean of the response variable, , to the linear predictor, .
So, what is its purpose? The link function solves two main problems simultaneously:
- The Constraint Problem: Response variables often have natural constraints. For instance, probabilities ( from a Binomial model) must be between 0 and 1, and counts ( from a Poisson model) must be positive. However, the linear predictor can produce any value from to . The link function mathematically transforms the constrained scale of to the unconstrained scale of , ensuring that when we invert the process to get a prediction, it will always be a valid, sensible value.
- The Linearity Problem: The relationship between the predictors and the raw mean of the response is often not linear. The link function provides a scale on which this relationship is linear. It "bends the line," as the video from our last lesson described, allowing us to model non-linear relationships while still using a linear equation at the core.
To formalize these ideas and see how they are expressed, let's turn to a concise reading.
Generalized Linear Models Link Function
This document provides a clear, formal definition of the link function and its role in connecting the mean of the response to the linear predictor.
Please read the first page of this document. Focus on how it uses the logistic regression model as an example to explain the general concept of a link function and then introduces the 'identity' link for linear regression as the simplest case.
Canonical Links: The "Natural" Choice
While several different link functions might be mathematically possible for a given distribution, each distribution in the exponential family has one special link called the canonical link.
- Definition: The canonical link is the function that transforms the mean, , to the distribution's natural parameter, . (We will explore the exponential family and natural parameters in more detail in the next module, but for now, you can think of it as the most "natural" mathematical pairing).
- Why it's important: Canonical links are the default in most statistical software and often have desirable statistical properties, such as ensuring the concavity of the log-likelihood function, which simplifies parameter estimation.
For your exam, you must be able to instantly pair the common distributions with their canonical links. Let's review them one by one.
1. Normal Distribution (Continuous Data)
- Random Component: Normal distribution.
- Mean: The mean can be any real number ().
- Canonical Link: Identity
- Equation:
- Full Model:
- Purpose: No transformation is needed because the range of is already unconstrained, just like the linear predictor . This special case of a GLM is simply the ordinary linear regression model.
2. Poisson Distribution (Count Data)
- Random Component: Poisson distribution.
- Mean: The mean count must be positive ().
- Canonical Link: Log
- Equation:
- Full Model:
- Purpose: The natural log function maps the domain of positive numbers () to the entire real number line (). This guarantees that any predicted mean, , will always be positive.
3. Binomial Distribution (Binary/Proportion Data)
- Random Component: Binomial distribution.
- Mean: The mean probability (often written as ) must be between 0 and 1 ().
- Canonical Link: Logit
- Equation:
- Full Model:
- Purpose: The logit function, which calculates the log-odds, maps the domain of (0, 1) to the entire real number line. This ensures that any predicted probability, , will always be between 0 and 1.
The following video provides a concise review of these canonical links and why they are chosen.
GLM Link Function, and Canonical Links
This video from Stats4Everyone provides a clear recap of what a link function is and then systematically identifies the canonical links for the Normal, Poisson, and Binomial distributions.
Please watch from 00:35 to 07:40. The first part defines the link function, and the second part (starting at 03:21) introduces the canonical links for each of our key distributions.
This table summarizes what you need to know for the exam.
| Distribution (Random Comp.) | Data Type | Mean Range () | Canonical Link | Link Equation |
|---|---|---|---|---|
| Normal | Continuous | Identity | ||
| Poisson | Counts | Log | ||
| Binomial | Binary / Proportions | Logit |
Visual Decision Guides
Since your exam is application-focused, having a clear decision-making process is vital. The following flowcharts are excellent tools to help you quickly determine the right link function based on the type of data you're analyzing.
Here is a guide for when your outcome is a binary variable.

And here is a guide for when you are modeling count data.

Quick Practice
Let's test your ability to apply these rules. For each scenario below, identify the appropriate probability distribution for the response variable and its corresponding canonical link function.
- A study investigates whether a bird a researcher observes is male or female (a binary outcome).
- An urban planner models the number of cars that pass through an intersection per hour.
- An agronomist models the height of corn stalks (a continuous measurement) based on fertilizer type.
Click to reveal answers
-
Distribution: Binomial. The outcome is binary (male/female).
Canonical Link: Logit. -
Distribution: Poisson. The outcome is a count of events (cars) in a fixed interval (an hour).
Canonical Link: Log. -
Distribution: Normal. The outcome is a continuous, unbounded measurement (height).
Canonical Link: Identity.
Conclusion
In this lesson, we focused entirely on the role and identity of the link function. You are now equipped with the knowledge to handle exam questions that require you to specify the correct GLM components.
Key Takeaways:
- Purpose of the Link Function: It connects the mean of the response () to the linear predictor () by (1) transforming the constrained range of to the unconstrained range of , and (2) creating a scale where the relationship is linear.
- Canonical Links: These are the "natural" or default links for a given distribution.
- The Essential Pairings:
- Normal distribution Identity link
- Poisson distribution Log link
- Binomial distribution Logit link
You have now solidified your understanding of the three core GLM components. In the next lesson, we will put this knowledge into practice by focusing on the complete decision-making process: given a description of a response variable, you will select the most appropriate distribution and link function for a GLM, preparing you for a common type of exam question.