Why ordinary regression will not do
Try to model the number of claims a policy makes using ordinary linear regression and three things go wrong at once, each fatal on its own.
The predictions escape the range. A straight line is unbounded, so for some combination of inputs it will predict a negative number of claims. A count cannot be negative.
The error distribution is wrong. Ordinary regression assumes a normal error, which is continuous and symmetric. A claim count is a non-negative whole number and is usually strongly right-skewed, with a large pile at zero.
The variance is not constant. Ordinary regression assumes the same σ² everywhere. For counts, the variance rises with the mean — a group expected to make 100 claims varies far more in absolute terms than one expected to make 2. For a Poisson the variance equals the mean, so assuming it constant is not a mild approximation but a contradiction of the model.
Patching this by taking logs of the response fails too: the logarithm of zero is undefined, and a policy with no claims is the most common policy there is.
A generalised linear model fixes all three by changing two things about ordinary regression and keeping everything else.
The three components
Every GLM is specified by naming three things, and an exam answer that names all three has earned most of the marks on bookwork.
1. The random component. The distribution of the response, which must be from the exponential family: normal, Poisson, binomial, gamma, inverse Gaussian. The choice is driven by the data — Poisson for counts, gamma for claim amounts, binomial for yes-or-no outcomes.
2. The systematic component. The linear predictor, which is the familiar straight-line combination of covariates:
3. The link function. A function g connecting the two:
In words: it is not the mean that is a straight-line function of the covariates, but some transformation of the mean.
Ordinary linear regression is the case where the random component is normal and the link is the identity, g(μ) = μ. Nothing has been thrown away; the familiar model is one member of a family.
What the link function is for
It does two jobs at once, and it is worth separating them.
It keeps the mean in its legal range. The linear predictor runs over every real number. A claim rate must be positive. The log link, g(μ) = ln μ, means μ = eη, which is positive whatever η does. For a probability, which must lie between 0 and 1, the logit link ln(μ/(1−μ)) does the same job at both ends.
It decides how the covariates combine. This is the part with commercial consequences. With an identity link, effects add. With a log link, they multiply:
That is why the log link dominates general insurance pricing. A tariff is naturally multiplicative — a base rate, times a factor for the vehicle, times a factor for the area — and the log link is exactly that structure. A fitted coefficient of 0.4055 is not "0.4055 more claims"; it is a multiplier of e0.4055 = 1.5, or 50% more.
Each distribution has a canonical link, the one that falls out of writing its density in exponential-family form: identity for the normal, log for the Poisson, logit for the binomial, and the reciprocal for the gamma. Canonical links have convenient mathematical properties, but they are a default rather than an obligation — gamma models for claim severity are routinely fitted with a log link instead of the canonical reciprocal, precisely because a multiplicative tariff is wanted.
Exposure, and the offset
One practical point that trips up more people than the theory. Groups being compared rarely have the same amount of exposure: a thousand vehicle-years and ten thousand vehicle-years will not produce comparable claim counts however similar the risks are.
The answer is not to model the rate directly but to put the exposure into the model as a term with a fixed coefficient of 1 — an offset:
Rearranged, ln(μ/exposure) = β0 + β1x1 + … — the model is on the claim rate, while the response being counted remains a genuine Poisson count. Leaving the offset out and modelling raw counts means the model spends its covariates explaining how big each group is rather than how risky it is.
Deviance: how a GLM is assessed
There is no R² here. Fit is measured by the deviance, which compares the log-likelihood of your model with that of the saturated model — the one with a parameter for every observation, which fits perfectly:
For a Poisson model this works out to a formula in observed and fitted counts:
A smaller deviance means a better fit. The deviance of the saturated model is zero by construction.
Its real use is comparing nested models. Fit a model, then fit a larger one containing it, and the drop in deviance has approximately a chi-square distribution with degrees of freedom equal to the number of extra parameters:
So "does region matter?" becomes: fit with and without region, take the difference in deviance, compare with a chi-square. This is the GLM counterpart of the t test on a regression slope, and it generalises to factors with many levels at once.
Where marks are lost
Saying the response is transformed. It is not. g is applied to the mean, not to the data. The difference matters most at zero: ln(0) is undefined, but a fitted mean is never zero, so a log link copes with zero counts without trouble.
Reading a log-link coefficient additively. On a log link, coefficients are multipliers once exponentiated. Reporting β = 0.4055 as an effect of 0.41 instead of a 50% uplift is a serious misreading.
Forgetting the offset. The commonest modelling error in this topic, and it corrupts every coefficient in the model rather than just one.
Comparing deviances of models that are not nested, or fitted to different data. The chi-square result requires one model to be a special case of the other, on the same observations.
Choosing the distribution by the shape of the response variable alone. The exponential-family assumption is about the response given the covariates. A response that looks bimodal overall may be perfectly Poisson within each group.
Questions students ask
Why does this need iteration when ordinary regression does not?
Because the likelihood equations are no longer linear in the parameters. For a normal response with an identity link the score equations solve in closed form, which is the least squares formula. Change the link or the distribution and no closed form exists, so the maximum is found numerically — iteratively reweighted least squares, which is ordinary least squares applied repeatedly with weights that update each time. It is maximum likelihood, done by climbing.
How do I choose the distribution and the link?
The distribution follows the nature of the response: counts to Poisson, positive continuous amounts to gamma, yes-or-no to binomial. The link follows the structure you want the answer to have: log when the effects should multiply, which in insurance pricing is nearly always. Then check the fit with residuals and deviance rather than trusting the choice.
Why is this so central to actuarial work?
Because a premium is a rate per unit of exposure, varying by rating factors, and that is precisely what a Poisson-with-offset or gamma GLM estimates. Frequency and severity are modelled separately — a Poisson GLM for how often, a gamma GLM for how much — and multiplied to give a risk premium. The method on this page is not an illustration of pricing. It is the pricing.
A worked example
A motor book is split into two city groups. Both rows were invented for this example.
| Group | Claims | Exposure (vehicle-years) |
|---|---|---|
| A | 48 | 1,200 |
| B | 90 | 1,500 |
Fit a Poisson model with a log link and an offset for exposure, and test whether the groups really differ.
The raw rates
rate B = 90/1,500 = 0.06 claims per vehicle-year
Group B is making claims at 1.5 times the rate of group A. Note that the raw counts alone would have been misleading: B has 87.5% more claims, but only 50% more claims per vehicle-year, because it also carries 25% more exposure. This is the offset earning its place before any model is fitted.
The fitted model
With one factor at two levels and a separate parameter for each, the model is saturated, so the maximum likelihood estimates reproduce the observed rates exactly and can be written down without iteration. Taking A as the base level:
βB = ln(0.06/0.04) = ln(1.5) = 0.4054651
Reading the coefficients. The intercept is the log of the base rate: e−3.2188758 = 0.04. The group coefficient is a multiplier: e0.4054651 = 1.5, so group B's rate is 50% higher. On a log link this is the only correct reading — 0.4055 is not an addition to anything.
Check the fitted values against the data.
group B: 1,500 × e−3.2188758 + 0.4054651 = 1,500 × e−2.8134107 = 1,500 × 0.06 = 90
Both reproduce the observed counts exactly, which they must for a saturated model, and the deviance of this model is therefore 0.
Does the group factor earn its place?
Compare it with the null model, which gives both groups one common rate:
fitted B = 1,500 × 0.0511111 = 76.6666667
The null model expects 61.3 claims in A and sees 48; expects 76.7 in B and sees 90. Its deviance, with the −(o − e) terms cancelling because the totals match:
= 2[48 × (−0.2451225) + 90 × 0.1603427]
= 2[−11.7658780 + 14.4308385] = 2 × 2.6649605 = 5.3299210
The drop in deviance from the null model to the saturated one is 5.3299210 − 0 = 5.3299210 for one extra parameter, so compare with a chi-square on 1 degree of freedom, whose 5% point is 3.8414588.
There is evidence that the two groups have genuinely different claim rates, so the factor belongs in the model.
Check by a second statistic
The Pearson chi-square tests the same thing by a different formula, comparing observed with expected directly rather than through log-likelihoods:
= 177.7777778/61.3333333 + 177.7777778/76.6666667
= 2.8985507 + 2.3188406 = 5.2173913
Against the same critical value of 3.8414588, with p = 0.0224. The two statistics are 5.3299 and 5.2174 — close, as they should be, since both approximate the same chi-square distribution and differ only in which approximation they take. Same decision, reached independently.
That the two sit within about 2% of each other is itself diagnostic. A large gap between deviance and Pearson chi-square is a sign that the chi-square approximation is straining, typically because some fitted counts are too small. Here the smallest fitted value is 48, so both are comfortable.
What the model says, in plain words
Base claim rate 4% a vehicle-year in group A; group B carries a loading of 1.5 times, giving 6%. The loading is statistically significant at the 5% level but not overwhelmingly so — with only 138 claims in total, a factor of 1.5 is about at the edge of what this much data can establish. More exposure would settle it.
Where this fits in CS1
This page explains one idea from CS1 Actuarial Statistics. The full CS1 syllabus, with what each part is examined on, sits on the course page, and past-paper style mock exams with full solutions are where you find out whether the idea has stuck under time pressure.
Other CS1 topics explained
- Moment generating functions, and how to get moments out of them
- The central limit theorem, and when the normal approximation is safe
- Maximum likelihood estimation, step by step
- Confidence intervals: what the 95% actually means
- Hypothesis testing and p-values, without the folklore
- Simple linear regression: least squares, fitted by hand
- Bayesian estimation, conjugate priors and the credibility formula inside them
- Conditional expectation, and the variance decomposition that comes with it
- Sampling distributions: what the sample mean and sample variance actually do
- The method of moments, and when maximum likelihood is worth the extra work
- The likelihood ratio test, and why the Wald and score tests exist too
- The chi-square goodness of fit test, and how to get its degrees of freedom right
- Contingency tables: testing whether two classifications are related
- Analysis of variance: comparing three or more means at once
- Multiple linear regression, and what controlling for another variable really does
Stuck on a term rather than the idea? The actuarial glossary defines the notation used above. If something here is wrong or unclear, tell us — these pages get corrected.