Introduction
In our last lesson, we established why Ordinary Linear Regression (OLR) is not a suitable tool for analyzing binary or count data. We saw that its core assumptions—normality, constant variance, and linearity—are fundamentally violated by these data types, leading to nonsensical predictions and unreliable statistical conclusions. This foundational understanding sets the stage for the solution: the Generalized Linear Model (GLM).
This lesson will introduce the elegant and flexible framework of GLMs. Our goal is to identify and understand the three core components that every GLM is built from: the random component, the systematic component, and the link function. By the end of this lesson, you will see how these three parts work together to create a powerful modeling tool that can be adapted to the very types of data that OLR cannot handle.
The Architecture of a Generalized Linear Model
Think of OLR as a specialized tool designed for one specific job: modeling continuous, normally distributed outcomes. A GLM, in contrast, is like a versatile multi-tool. It provides a single, unified framework that can be configured to handle many different jobs by swapping out a few key parts. These parts are the three components of the GLM.
To start, let's get a concise overview of these three components.
Explaining generalized linear models (GLMs) | VNT #15
This video from the Very Normal channel provides a clear, high-level introduction to the three building blocks of any GLM.
Please watch the segment from 02:59 to 03:55, which defines the random component, the systematic component, and the link function.
Now, let's unpack each of these components in more detail.
1. The Systematic Component (The Linear Predictor)
This is the part of a GLM that should feel most familiar to you from your experience with linear regression. The systematic component is simply a linear combination of the predictor variables. It's the weighted sum that forms the core of the model's equation:
This part of the model is also called the linear predictor. The "linear" in "Generalized Linear Model" refers specifically to this component. We are still modeling the outcome as a linear function of the parameters ('s), even if the ultimate relationship between the predictors and the outcome is not a straight line.
2. The Random Component (The Distribution)
This component addresses the biggest failing of OLR. While OLR rigidly assumes that the response variable (or more accurately, its errors) follows a Normal (Gaussian) distribution, a GLM allows you to choose a probability distribution that actually matches the nature of your data. This chosen distribution is the random component.
These distributions typically come from a special class known as the exponential family, which includes many common distributions and has mathematical properties that make the GLM framework cohesive. You don't need to know the deep theory of the exponential family, but you should recognize the choices it enables:
- For continuous data that is roughly symmetric: Normal distribution.
- For binary data (e.g., 0/1, yes/no): Binomial distribution.
- For count data (e.g., 0, 1, 2, ...): Poisson distribution.
- For continuous, skewed data that must be positive (e.g., time-to-event): Gamma distribution.
By selecting the appropriate random component, you are immediately building a model that respects the fundamental nature of your outcome variable.
3. The Link Function
We now have two pieces: the systematic component (), which can produce any value from to , and the random component, which describes an outcome whose average value () might be constrained (e.g., a probability must be between 0 and 1).
The link function, , is the crucial bridge between them. It connects the mean of the response variable, , to the linear predictor, .
Think of the link function as a "transformer" or "translator." It mathematically transforms the mean of the outcome so that it can be modeled as a linear equation. The inverse of the link function, , then transforms the linear predictor back to the original scale of the mean.
For a clearer picture of how these three components work together, let's watch another explanation.
Understanding Generalized Linear Models (Logistic, Poisson, etc.)
The Simplistics (QuantPsych) channel offers another excellent walk-through of the three GLM components and shows how a standard linear model is just one specific type of GLM.
Please watch from 07:03 to 10:21. This segment will reinforce the definitions of the systematic component, link function, and random component, and then explicitly state the components for an ordinary linear model.
Putting It All Together: A Unified Framework
As the video highlighted, the classic linear model is just a special case of a GLM. Let's formalize this and see how other models fit into the framework.
This chapter from the book 'Interpretable Machine Learning' provides a concise, formal definition of the GLM framework and its components.
Read the first two paragraphs of the 'Non-Gaussian outcomes - GLMs' section. Focus on the equation g(E[Y|x]) = xTβ and the formal definition of the three components.
The true power of the GLM framework lies in its ability to mix and match these components to build the right model for the job. The image below provides a fantastic visual summary of the framework and gives examples for common statistical models.

Let's use the table in the image to trace two examples:
-
Linear Regression:
- Random Component: Normal distribution (for a continuous outcome).
- Systematic Component:
- Link Function: Identity link (). This means , so the mean is modeled directly as a linear combination of predictors.
-
Logistic Regression:
- Random Component: Binomial distribution (for a binary 0/1 outcome).
- Systematic Component:
- Link Function: Logit link (). This transforms the mean (a probability from 0 to 1) onto the scale of the linear predictor (- to ).
By simply swapping the random component and the link function, we move from a linear model to a logistic model, all within the same conceptual structure.
Conclusion
In this lesson, we have deconstructed the Generalized Linear Model into its three essential building blocks. We've moved from why we need GLMs to what a GLM actually is.
Key Takeaways:
- A GLM consists of three core components that provide a flexible modeling framework.
- The Systematic Component (or linear predictor) is the familiar weighted sum of predictor variables: .
- The Random Component is the assumed probability distribution for the response variable (e.g., Normal, Binomial, Poisson), chosen to match the data type.
- The Link Function () connects the mean of the random component () to the systematic component: .
Understanding this three-part structure is the key to mastering GLMs. It allows you to think about model building not as a series of disconnected techniques, but as a single, adaptable process.
Preview of the Next Lesson:
We briefly mentioned that the distributions used in GLMs come from the "exponential family." In the next lesson, we will take a closer look at this concept. We'll explore why this particular family of distributions is so important for the GLM framework and what properties make it work so well.