Module 3: Non-Linear Models & Generalized Linear Models (GLMs)
Study manual for Exam SRM
1. The Exponential Dispersion Family (EDF)
Generalized Linear Models (GLMs) extend Ordinary Least Squares by relaxing the requirement of normal errors and constant variance. A random variable belongs to the Exponential Dispersion Family if its probability density function (or probability mass function) can be expressed in the canonical form:
where:
- is the canonical (natural) parameter, which relates to the location (mean).
- is the dispersion parameter, which relates to the scale (variance). Typically, , where is a known prior weight (e.g., exposure or policy count).
- is the cumulant function (strictly convex and twice continuously differentiable).
- is a base normalizing function independent of .
1.1 Derivation of Mean and Variance via Likelihood Identities
Because is a valid density integrating to 1:
Differentiating the identity with respect to and applying the Bartlett identities:
The Mean Function:
Taking expectations:
The Variance Function:
Differentiating a second time:
Applying the second Bartlett identity :
where is the variance function, which describes how the variance of depends inherently on its mean .
2. Canonical Links & The Five Core Distributions
A GLM consists of three structural components:
- Random Component: The response variable follows a distribution from the Exponential Dispersion Family with mean .
- Systematic Component: A linear predictor .
- Link Function : A monotonic differentiable function that connects the mean to the linear predictor:
2.1 The Master Exponential Dispersion Family Table for Exam SRM
| Distribution | Notation | Density | Natural Parameter | Cumulant | Dispersion | Mean | Variance Function | Canonical Link |
|---|---|---|---|---|---|---|---|---|
| Normal (Gaussian) | Identity: | |||||||
| Bernoulli (Binomial) | Logit: | |||||||
| Poisson | Log: | |||||||
| Gamma | Negative Inverse: | |||||||
| Inverse Gaussian | Inverse Squared: |
3. Binary Classification: Logistic Regression & Alternative Links
For a binary response (e.g., policy lapsed vs. renewed, claim occurred vs. no claim), let .
3.1 The Logistic (Logit) Model
The logit link sets the log-odds equal to the linear predictor:
Inverting to solve for the success probability:
- Logit (Sigmoid)
- Linear (OLS Unbounded)
The logistic function constrains probabilities strictly to (0, 1). As the linear predictor η approaches positive or negative infinity, the curve flattens out asymptomatically.
3.2 Odds and the Odds Ratio (OR)
- If , (4 to 1 in favor).
- If , (1 to 4).
Interpreting Coefficients via Odds Ratios:
Consider increasing predictor by unit while holding all other predictors fixed:
- If : Increasing increases the odds of the event by .
- If : Increasing decreases the odds of the event.
- For a change of units: .
3.3 Alternative Link Functions for Binary Data
- Probit Link:
where is the cumulative distribution function of the standard normal distribution .
- Both Logit and Probit are symmetric around .
- The logistic distribution has heavier tails than the standard normal; as a rule of thumb, .
- Complementary Log-Log (cloglog) Link:
- Asymmetric Link: Approaches 0 slowly and approaches 1 very steeply.
- Ideal for modeling rare actuarial events (e.g., catastrophic claims, rare disease incidence) where probability of occurrence is small.
3.4 Classification Performance: ROC Curves & AUC
Actual Positive (Y = 1) Actual Negative (Y = 0)
Predicted 1 True Positive (TP) False Positive (FP) [Type I Error]
Predicted 0 False Negative (FN) [Type II] True Negative (TN)- Sensitivity (True Positive Rate / Recall):
- Specificity (True Negative Rate):
- The Receiver Operating Characteristic (ROC) Curve: Plots Sensitivity (vertical axis) against (horizontal axis) across all possible classification probability thresholds .
- Area Under the Curve (AUC):
- : Model performs no better than random guessing (the diagonal line).
- : Perfect classification performance.
- Probabilistic Meaning: AUC equals the probability that the classifier will rank a randomly chosen positive observation higher than a randomly chosen negative observation.
4. Count Models & Actuarial Exposure Offsets
In property-casualty ratemaking, we model claim counts across policyholders with varying exposure periods (e.g., car-years, employee-months).
4.1 Poisson Regression with Exposure Offsets
Let . The expected claim frequency is . Using the canonical log link on the claim rate :
Substituting :
4.2 Overdispersion & The Negative Binomial Distribution
In a standard Poisson distribution, the mean and variance are strictly equal:
In real actuarial datasets, overdispersion () almost universally occurs due to:
- Unobserved policyholder heterogeneity (latent risk factors not in ).
- Contagion / clustering of claims (e.g., hail storm damaging multiple vehicles).
Consequences of Overdispersion in Poisson GLM:
- Parameter estimates remain consistent and unbiased.
- Standard errors are severely underestimated.
- -values are falsely deflated, leading to spurious statistical significance.
Remedies for Overdispersion:
- Quasi-Poisson Model: Assumes and , where is an estimated dispersion parameter. Parameter estimates remain identical to Poisson, but all standard errors are multiplied by .
- Negative Binomial GLM: Assumes , arising as a Gamma-Poisson mixture.
where is the overdispersion parameter. As , the Negative Binomial converges to the Poisson distribution.
5. Model Evaluation: Deviance, Likelihood Ratio Tests & Residuals
In GLMs, sums of squares are replaced by log-likelihoods and deviances.
5.1 The Three Log-Likelihood Benchmarks
| Model | Log-likelihood | Fit |
|---|---|---|
| Null model (intercept only) | , the lowest | Worst possible fit |
| Fitted model ( predictors) | , in between | The candidate model being tested |
| Saturated model ( parameters) | , the highest | Perfect fit, |
- Saturated Model (): An ideal model with parameters (), assigning each observation its own parameter . It achieves the highest possible log-likelihood.
- Fitted Model (): The candidate GLM with predictors ().
- Null Model (): An intercept-only model with 1 parameter, setting .
5.2 Residual Deviance and Scaled Deviance
The Residual Deviance measures the discrepancy between the fitted model and the saturated model:
The Scaled Deviance is:
- For Poisson and Binomial models, the dispersion parameter is fixed by definition: . Hence, Scaled Deviance equals Residual Deviance: .
- For Normal models, , and .
5.3 The Likelihood Ratio Test (LRT) for Nested GLMs
To test whether predictors can be dropped from a full GLM ():
- We reject if the deviance drop exceeds the critical value .
- When is unknown (e.g., Gamma GLM), we use the partial -type ratio:
5.4 Residuals in GLMs
Because raw residuals have non-constant variance , GLMs utilize standardized residuals:
- Pearson Residual ():
Sum of squared Pearson residuals yields the Pearson Chi-Square Statistic:
The dispersion parameter is estimated as:
- Deviance Residual (): The signed square root of observation 's contribution to the total deviance :
6. R code and output interpretation lab
6.1 Interpreting summary(glm()) for Poisson and Logistic Models
fit_pois <- glm(claim_count ~ age_group + vehicle_use,
family = poisson(link = "log"),
offset = log(exposure),
data = auto_claims)
summary(fit_pois)Call:
glm(formula = claim_count ~ age_group + vehicle_use, family = poisson(link = "log"),
data = auto_claims, offset = log(exposure))
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.45000 0.08500 -28.824 < 2e-16 ***
age_groupYoung 0.42000 0.06500 6.462 1.04e-10 ***
age_groupSenior -0.18000 0.09200 -1.957 0.0504 .
vehicle_useCommute 0.25000 0.05500 4.545 5.49e-06 ***
---
(Dispersion parameter for poisson family taken to be 1)
Null deviance: 1845.2 on 1499 degrees of freedom
Residual deviance: 1520.4 on 1496 degrees of freedom
AIC: 3240.8Line-by-Line Exam Extraction:
- Multiplicative Rate Multipliers:
- Base expected rate (reference: MiddleAge, Pleasure use) per unit exposure claims/year.
- Young drivers have an estimated claim frequency rate multiplier of higher claim frequency than MiddleAge drivers.
- Commute vehicles experience higher claim frequency than Pleasure vehicles.
- Predicting for a Specific Policy:
- Policy profile: Young driver, Commute use, Exposure years.
- Linear predictor:
- Expected claim count:
- Goodness-of-Fit & Dispersion Check:
- Degrees of freedom .
- Ratio .
- Because this ratio is very close to , there is no significant overdispersion, confirming that the Poisson distribution is appropriate!
7. Common traps
8. Master Practice Question Vault
Problem 1: Logistic Regression Odds Ratio & Probability Calculation
A credit insurance firm estimates the probability of debt default using logistic regression:
where DebtRatio is measured as a percentage (e.g., 40 for 40%) and EmploymentYears is in years.
- Calculate the Odds Ratio of default associated with a 10-percentage-point increase in DebtRatio.
- For an applicant with DebtRatio and EmploymentYears years, calculate the estimated probability of default.
- A;
- B;
- C;
- D;
- E;
Detailed 4-Step Solution:
- Calculate the Odds Ratio:
- Evaluate the Linear Predictor :
- Convert Logit to Probability:
- Conclusion: and . Answer (B).
Why the other choices are wrong:
- (A) Reports the odds as the probability, forgetting to divide by .
- (C) Gives the odds ratio for a 1-point change, , instead of a 10-point change.
- (D) Gives , the probability of no default.
- (E) Reports the log-odds change without exponentiating it.
Problem 2: Poisson GLM Expected Count with Exposure Offset
An actuary fits a Poisson regression model with log link to commercial fleet collision claim counts:
where:
- is the number of vehicle-years of exposure.
- for heavy trucks, otherwise.
- for urban delivery routes, otherwise.
A logistics company operates a fleet of 80 heavy trucks on urban delivery routes over a 6-month period.
Calculate the expected number of collision claims for this fleet.
- A0.11
- B4.22
- C3.45
- D8.43
- E2.97
Detailed 4-Step Solution:
- Establish the Exposure Period: .
- Compute the Rate Component: For heavy trucks () in urban areas ():
Annual rate per vehicle-year: .
- Compute the Expected Claim Count:
Equivalently, on the log scale with the exposure as an offset: , so . Answer (B).
Why the other choices are wrong:
- (A) Gives the claim rate per vehicle-year and forgets the exposure of 40 vehicle-years.
- (C) Leaves out the urban coefficient 0.20.
- (D) Uses 80 vehicle-years, a full year for each truck, instead of half a year.
- (E) Leaves out the heavy-truck coefficient 0.35.
Problem 3: Pearson Dispersion Estimator in Overdispersed GLM
A claim count model with estimated coefficients is fitted to a sample of policies. The computed Pearson chi-square statistic is .
Under the quasi-Poisson framework, determine:
- The estimated dispersion parameter .
- The factor by which the reported standard errors from a naive Poisson GLM must be multiplied.
- A; SE multiplier is 1.33
- B; SE multiplier is 1.16
- C; SE multiplier is 1.34
- D; SE multiplier is 1.80
- E; SE multiplier is 1.80
Detailed 4-Step Solution:
- Degrees of Freedom:
- Estimate Dispersion Parameter:
- Compute SE Multiplier: Under quasi-Poisson, . Therefore, standard errors scale by:
- Conclusion: ; SE multiplier is . Answer (C).
Why the other choices are wrong:
- (A) Divides by instead of .
- (B) Reports the SE multiplier as and takes the square root again.
- (D) Forgets the square root, scaling the standard errors by instead of .
- (E) Squares and then reports itself as the multiplier.