Introduction: Building the Generalised Linear Model (GLM)

In our previous studies of simple and multiple linear regression, we assumed that the response variable followed a Normal distribution and that the mean response was a direct linear combination of our explanatory variables. However, in the actuarial world, data is rarely that "well-behaved." We often deal with claim counts (which can't be negative) or claim probabilities (which must be between 0 and 1).

This is where Generalised Linear Models (GLMs) come in! In this chapter, we will learn about the "engine" of the GLM: the linear predictor, and the "bridge" that connects it to our data: the link function. We will also explore how to handle different types of data, such as categories (factors) and situations where variables interact with each other. Don't worry if this seems abstract at first; once you see the structure, it fits together like a puzzle!

1. The Linear Predictor \(\eta\)

The linear predictor, usually denoted by the Greek letter eta \(\eta\), is the part of the model that captures the effects of our explanatory variables. It is a linear combination of the unknown parameters (\(\beta\)) and the observed variables.

For a set of explanatory variables \(x_1, x_2, ..., x_k\), the linear predictor for the \(i\)-th observation is written as:

\(\eta_i = \beta_0 + \beta_1 x_{i1} + \beta_2 x_{i2} + ... + \beta_k x_{ik}\)

Forms of the Linear Predictor

The linear predictor is incredibly flexible. Depending on the problem, it can take several forms:

  • Simple Linear Model: \(\eta = \beta_0 + \beta_1 x\) (A straight-line relationship).
  • Polynomial Models: \(\eta = \beta_0 + \beta_1 x + \beta_2 x^2\) (Used when the relationship is curved, but it is still "linear" in terms of the parameters \(\beta\)).
  • Models involving Factors: If we are looking at different groups (like "Smoker" vs "Non-Smoker"), the predictor changes based on which group the observation belongs to.

Key Takeaway: Even though the relationship between the variables and the response might be curvy (like a polynomial), the model is called "linear" because it is a linear sum of the parameters (\(\beta_i\)).

In a standard linear model, we assume the mean response \(\mu = E[Y]\) is equal to the linear predictor \(\eta\). In a GLM, we use a link function \(g(\cdot)\) to connect them:

\(g(\mu_i) = \eta_i\)

Why do we do this? Imagine you are predicting the probability of a car insurance claim. A probability must be between 0 and 1. If we used a simple linear model, our prediction might result in a "probability" of 1.5 or -0.2, which is impossible! The link function maps the range of the mean (e.g., 0 to 1) to the range of the linear predictor (negative infinity to positive infinity).

The Canonical Link Function

Each distribution in the exponential family has a "natural" link function that arises from its mathematical structure, known as the canonical link function. While you can use other links, these are very common in the CS1 exam:

Normal Distribution: Identity link \(\implies g(\mu) = \mu\)
Poisson Distribution: Log link \(\implies g(\mu) = \ln(\mu)\)
Binomial Distribution: Logit link \(\implies g(\mu) = \ln(\frac{\mu}{1-\mu})\)
Gamma / Exponential Distributions: Reciprocal link \(\implies g(\mu) = \frac{1}{\mu}\)

Note: For more on the exponential family, refer to the chapter "The exponential family, variance function and scale parameter."

3. Variables vs. Factors

In actuarial modelling, we use two main types of explanatory inputs:

Continuous Variables

These are numerical measurements that can take any value within a range.
Example: The age of a policyholder, the sum assured on a life policy, or the engine capacity of a car.

Factors (Categorical Values)

Factors represent qualitative groupings. They take on discrete "levels."
Example: Gender (Male, Female), Region (North, South, East, West), or Type of Fuel (Petrol, Diesel, Electric).

The "Reference Level" Trick: When we include a factor with \(k\) levels in a GLM, we don't usually create \(k\) parameters. Instead, we choose one level as the base level (or reference level) and create \(k-1\) dummy variables. The parameters for the other levels then represent the difference from the base level.

Common Mistake: Forgetting to exclude the base level parameter! If you have 3 regions and include 3 parameters plus an intercept, the model will crash (this is called "perfect collinearity"). Always use \(k-1\) parameters for a factor with \(k\) levels if an intercept \(\beta_0\) is present.

4. Interaction Terms

Sometimes, the effect of one variable depends on the level of another. This is called an interaction.

Real-world Example: Suppose we are modelling the risk of a health insurance claim. Both "Age" and "Smoking Status" are important. However, the extra risk of being a smoker might be much higher for a 60-year-old than for a 20-year-old. This "extra" combined effect is an interaction.

Mathematically, we represent an interaction by multiplying the two variables together in the linear predictor:

\(\eta = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \beta_{12}(x_1 \cdot x_2)\)

Where \((x_1 \cdot x_2)\) is the interaction term.

Quick Review: Components of a GLM

1. Random Component: The distribution of the response \(Y\) (e.g., Poisson).
2. Systematic Component: The linear predictor \(\eta = \sum \beta_i x_i\).
3. Link Function: The function \(g(\mu) = \eta\) that joins them.

5. Step-by-Step: Constructing the Predictor

When you are asked to write down the form of a linear predictor in an exam, follow these steps:

  1. Identify the Intercept: Usually \(\beta_0\).
  2. Add Continuous Variables: Add a term like \(\beta_i x_i\) for each variable.
  3. Add Factors: Identify the number of levels \(k\) and add \(k-1\) terms.
  4. Check for Interactions: If the question says the effect of \(X\) varies by \(Y\), add the product term.

Example: If we have a model for claims (\(\mu\)) with an intercept, one continuous variable (Age, \(x_1\)), and one factor (Gender, with levels \(L_1 = \) Male and \(L_2 = \) Female), using a log link:

\(\ln(\mu) = \beta_0 + \beta_1 x_1 + \beta_2 x_{Gender}\)

Where \(x_{Gender} = 1\) if Female, and \(0\) if Male (making Male the base level).

Concept: Linear Predictor (\(\eta\))
What it is: The "math formula" side of the model.
Actuarial Use: Combining age, region, and policy type to estimate risk.

Concept: Link Function (\(g\))
What it is: The "bridge" to the mean response.
Actuarial Use: Ensuring claim counts aren't negative (Log link) or probabilities are between 0 and 1 (Logit link).

Concept: Factors and Interactions
What it is: Handling categories and combined effects.
Actuarial Use: Differentiating premiums by territory or vehicle type.

In the next chapters, we will look at how to estimate these \(\beta\) parameters using maximum likelihood and how to test if our model actually fits the data well.