6.1 Deviance, Likelihood Ratio Tests & Residual Diagnostics
Key Takeaways
Total deviance D(y, mu_hat) = 2*(l_sat - l_model) measures total discrepancy between the fitted GLM and the hypothetical saturated model that fits each observation perfectly.
In models with unknown dispersion (Gamma, Inverse Gaussian, Tweedie), scaled deviance D* = D / phi governs nested model comparison, and the dispersion parameter is estimated via the Pearson statistic phi_hat = chi^2 / (n - p).
The Likelihood Ratio Test (LRT) assesses nested models via the deviance difference Delta D / phi ~ chi^2_{Delta df}; for severity GLMs with estimated dispersion, this converts to an F-test.
The Bayesian Information Criterion (BIC) imposes a much heavier parameter penalty k*ln(n) than AIC (2k) in large P&C datasets (n > 100,000), preventing overfitting and selecting parsimonious rating structures.
Deviance residuals r_{D, i} normalize skewness better than Pearson residuals; residual plots against fitted values detect link misspecification and incorrect variance functions, while leverage and Cook's distance identify influential commercial shock losses.
Deviance in Generalized Linear Models
In classical Ordinary Least Squares (OLS) regression, model goodness-of-fit is assessed using the Residual Sum of Squares (). In Generalized Linear Models, where response distributions belong to the Exponential Dispersion Family, the general measure of discrepancy is deviance.
The Saturated Model vs. The Proposed Model
To understand deviance, consider two theoretical extremes of model complexity:
- The Saturated Model (): A model with as many parameters as observations (). It assigns one parameter per data point, achieving an exact fit: for all . It represents the highest attainable log-likelihood for the dataset, denoted .
- The Current Model (): A parsimonious model with parameters () yielding fitted values and log-likelihood .
MODEL SPECTRUM
Null Model Current Fitted Model Saturated Model
(Intercept Only) (p parameters) (n parameters)
────────────────────┼──────────────────────────────────────┼────────────────────►
Worst Fit Parsimonious Fit Perfect Fit
Lowest l(mu) l(mu_hat) Highest l(y)
└──────────────────┬───────────────────┘
▼
DEVIANCE D = 2 * [l(y) - l(mu_hat)]
Total and Scaled Deviance
The scaled deviance is defined as twice the difference between the maximized log-likelihood of the saturated model and that of the current model:
In the Exponential Dispersion Family, the log-likelihood for observation with prior weight is:
Substituting this into the scaled deviance expression:
Where is the canonical parameter evaluated at , and is evaluated at .
- is the total (unscaled) deviance.
- is the dispersion parameter.
- The total deviance decomposes into a weighted sum of individual unit deviances :
Unit Deviance Formulas Across Actuarial Distributions
Each Exponential Dispersion Family distribution has a unique unit deviance function:
| Distribution | Variance Function | Dispersion | Unit Deviance |
|---|---|---|---|
| Normal | (estimated) | ||
| Poisson | (fixed) | ||
| Gamma | (estimated) | ||
| Inverse Gaussian | (estimated) | ||
| Tweedie () | (estimated) |
Note
For the Poisson unit deviance, when , the term evaluates to by taking the continuous limit , yielding .
Pearson Chi-Square Statistic and Dispersion Estimation
An alternative measure of model goodness-of-fit is the Pearson Chi-Square statistic , which aggregates standardized squared residuals:
Estimating the Unknown Dispersion Parameter
In Poisson and Binomial models, the dispersion parameter is fixed by definition (). However, in severity models (Gamma, Inverse Gaussian) and pure premium models (Tweedie), is an unknown nuisance parameter that must be estimated from data to calculate standard errors and conduct hypothesis tests.
Actuaries estimate using the Pearson estimator:
Where:
- is the number of observations in the training sample.
- is the number of estimated regression parameters (including the intercept).
- represents the residual degrees of freedom.
Alternatively, software can estimate dispersion using the deviance estimator . However, casualty actuaries strongly favor the Pearson estimator because holds exactly under mild moment conditions, whereas the deviance estimator can be severely biased when distributions are highly skewed or sample sizes within rating cells are moderate.
Hypothesis Testing and Nested Model Comparison
In actuarial rate filing and pricing research, actuaries systematically evaluate whether adding rating variables (e.g., credit tier, vehicle telematics, roof age) significantly improves model performance.
The Likelihood Ratio Test (LRT) for Nested GLMs
Two models are nested if the smaller (reduced) model with parameters can be obtained by constraining parameters of the larger (full) model to zero.
- Null Hypothesis : The constrained parameters equal zero (the simpler model is sufficient).
- Alternative Hypothesis : At least one constrained parameter is non-zero (the full model is required).
Under Wilks' theorem, the difference in scaled deviances follows an asymptotic Chi-Square distribution:
The Actuarial -Test When Dispersion is Estimated
In severity models (Gamma, Inverse Gaussian) where is unknown and must be estimated, using against a critical value ignores the sampling uncertainty in . To maintain exact statistical size, actuaries apply the Analysis of Deviance -test:
If the computed -statistic exceeds the critical value , the actuary rejects and concludes that the additional rating variables provide statistically significant explanatory power.
NESTED MODEL COMPARISON
│
┌───────────────────────┴───────────────────────┐
▼ ▼
Known Dispersion Estimated Dispersion
(Poisson: phi = 1) (Gamma, Inverse Gaussian)
│ │
▼ ▼
Likelihood Ratio Test Actuarial F-Test
Delta D ~ Chi-Square(Delta df) F = [(D0 - D1)/Delta df] / phi_hat
F ~ F(Delta df, n - p1)
Wald Tests and Score Tests
- Wald Test: Evaluates individual parameter significance via (or ). Computationally cheap because it requires fitting only the full model, but can suffer from numerical instability when coefficients are very large (the Hauck-Donner effect).
- Score Test (Lagrange Multiplier): Evaluates the slope of the log-likelihood function at the null hypothesis value. Requires fitting only the reduced model , making it popular for screening thousands of candidate variables in big data pipelines.
Information Criteria: AIC vs. BIC in Massive P&C Datasets
When comparing non-nested models (e.g., comparing a model with Territory Age against a model with Territory Vehicle Use), deviance tests cannot be applied. Actuaries use penalized likelihood information criteria:
Where:
- is the maximized likelihood of the model.
- is the total number of estimated parameters (including intercept and dispersion).
- is the total number of observations (policies or claims).
Why BIC Dominates in Actuarial Rate Filings with Big Data
Consider the parameter penalty terms of AIC and BIC:
- AIC penalty per parameter: (constant, independent of sample size).
- BIC penalty per parameter: (grows logarithmically with sample size).
| Dataset Size () | Insurance Context | AIC Penalty () | BIC Penalty () | Penalty Ratio (BIC / AIC) |
|---|---|---|---|---|
| Small commercial niche line | ||||
| Regional personal lines book | ||||
| State-wide personal auto | ||||
| National multi-state book |
The Overfitting Danger of AIC in Casualty Modeling
In an insurance portfolio with earned policies, . Under AIC, any variable that increases the log-likelihood by more than unit (corresponding to a trivial -value of ) will be retained in the model.
In massive insurance datasets, pure random noise or unrepeatable geographic micro-clusters easily achieve -values of or simply due to vast sample size. Using AIC in large P&C datasets results in severe overparameterization, adding dozens of spurious rating levels that fail out-of-time validation and trigger regulatory objections. BIC enforces parsimony, penalizing unnecessary parameters more severely than AIC and producing stable, defensible rate indications.
GLM Residual Diagnostics in Actuarial Practice
Because GLM response variables are non-normal and heteroscedastic, classical OLS residual analysis cannot be applied directly. Actuaries rely on specialized GLM residual definitions.
Summary of Actuarial Residual Formulations
- Raw Residual: .
- Unstandardized and scale-dependent. Its variance is , which increases directly with the mean. Raw residuals must never be plotted against fitted values to assess homoscedasticity.
- Pearson Residual:
- Divides the raw error by the estimated standard deviation. Notice that (the Pearson Chi-Square statistic). However, for skewed distributions (Poisson, Gamma), Pearson residuals remain distinctly skewed.
- Deviance Residual:
- Represents the signed square root of observation 's unit deviance contribution. Notice that . Deviance residuals transform skewed errors toward approximate symmetry, behaving much more like standard normal errors than Pearson residuals.
- Standardized (Studentized) Deviance Residual:
- Where is the leverage of observation (the -th diagonal element of the GLM hat matrix ). Standardizing adjusts for the fact that high-leverage points exert heavy pull on the regression surface, artificially depressing their unstandardized residuals.
Actuarial Diagnostic Plotting Workflows
Actuaries construct four core diagnostic plots to validate GLMs prior to filing rates with insurance regulators:
GLM DIAGNOSTIC WORKFLOW
│
┌─────────────────────────────┼─────────────────────────────┐
▼ ▼ ▼
Residuals vs. Fitted Residuals vs. Predictors Q-Q Plot
Detects Link Misspecification Detects Non-Linearity / Checks Distributional
& Wrong Variance Function Missing Splines Tail Fit
│
▼
Leverage vs. Cook's D
Identifies Distorting Shock
Losses / Outliers
1. Standardized Deviance Residuals vs. Linear Predictor ()
- Ideal Pattern: A uniform, horizontal band centered at zero with constant dispersion roughly between .
- Curved (Bowed) Pattern: Indicates link function misspecification (e.g., using an identity link when a log link is required) or omitting significant polynomial terms.
- Funnel / Fan Pattern: Indicates an incorrect variance function (e.g., using a Poisson model with when loss variance actually scales quadratically as Gamma ).
2. Residuals vs. Individual Rating Variables
- Plotting residuals against individual continuous variables (such as driver age, vehicle age, or building square footage) reveals uncaptured nonlinearities.
- If residuals for young drivers () are systematically positive while mature drivers are negative, the linear predictor fails to capture the youthful risk curve, signaling the need for piece-wise splines or category re-binning.
3. Normal Q-Q Plot of Standardized Deviance Residuals
- Compares empirical quantiles of against standard normal quantiles .
- In severity modeling, Q-Q plots reveal right-tail inadequacies: if points drift steeply above the 45-degree reference line in the upper right quadrant, empirical claims exceed Gamma tail expectations, warranting an Inverse Gaussian or Pareto distribution.
4. Leverage () and Cook's Distance ()
In commercial property and casualty lines, a single $15,000,000 explosion loss or massive multi-vehicle catastrophe can distort an entire territory or class relativity. Actuaries isolate influential claims using Cook's Distance for GLMs:
Where is the standardized Pearson residual and is leverage.
- High Leverage (): Identifies policies with extreme or unusual combinations of predictor variables (e.g., a 16-year-old driver operating a $250,000 commercial dump truck).
- High Influence ( or ): Identifies observations that single-handedly alter coefficient estimates. In actuarial practice, high-influence claims are not silently deleted; they are scrutinized for data errors, capped at basic limits, or assigned to excess/catastrophe layers.
Actuarial Exam Traps & Pitfalls
Warning
Trap 1: Using Total Deviance as an Absolute Goodness-of-Fit Test in Sparse Data Textbooks often state that . However, this asymptotic result requires individual observation means to be large. In insurance frequency data where claim occurrence is rare (e.g., ), the chi-square approximation for absolute deviance completely fails. However, the Likelihood Ratio Test for the difference between two nested models () remains highly accurate.
Warning
Trap 2: Comparing AIC/BIC Across Different Distributions or Data Subsets Information criteria are valid only when comparing models fit to the exact same dataset with the exact same definition of the likelihood (including all normalizing constants). Comparing the AIC of a Gamma GLM against an OLS regression on is invalid because OLS evaluates the density of , omitting the Jacobian transformation factor .
Warning
Trap 3: Relying on Raw Residuals to Evaluate Homoscedasticity Novice analysts frequently plot raw residuals against and claim the model is flawed because the scatter widens as increases. In insurance GLMs (Poisson, Gamma, Inverse Gaussian), variance is theoretically defined to increase with the mean! Homoscedasticity must be diagnosed using standardized deviance residuals .
Warning
Trap 4: Misinterpreting Degrees of Freedom in Analysis of Deviance When running an -test between nested models, candidates often divide by the total model degrees of freedom instead of the difference in parameters . The numerator in the -test must strictly isolate the incremental change in degrees of freedom.
An actuary compares two nested Gamma severity GLMs: Model 0 (baseline rating variables, p0 = 8 parameters, Deviance = 14,250) and Model 1 (adds 4 credit score tier indicators, p1 = 12 parameters, Deviance = 14,190). The models are estimated on n = 5,012 claims, and Model 1 has a Pearson dispersion estimate phi_hat = 0.75. What is the test statistic for evaluating whether credit score significantly improves severity prediction?
Likelihood Ratio Chi-Square statistic = (14,250 - 14,190) = 60.00 with 4 degrees of freedom.
Likelihood Ratio Chi-Square statistic = 60.00 / 0.75 = 80.00 with 12 degrees of freedom.
F-statistic = [(14,250 - 14,190) / 4] / 0.75 = 20.00, evaluated against an F-distribution with (4, 5,000) degrees of freedom.
F-statistic = [(14,250 - 14,190) / 12] / 0.75 = 6.67, evaluated against an F-distribution with (12, 5,000) degrees of freedom.
A casualty insurer builds a commercial property frequency GLM on a database of 1,200,000 earned policy years. Why does the actuarial team select the Bayesian Information Criterion (BIC) rather than Akaike Information Criterion (AIC) to finalize the rating structure for a regulatory rate filing?
BIC mathematically guarantees that all predicted claim frequencies remain strictly positive, whereas AIC can generate negative frequency relativities.
AIC cannot be computed for non-canonical link functions, whereas BIC is valid for all link functions.
BIC minimizes the mean squared prediction error on holdout data, whereas AIC maximizes the Gini coefficient.
Because ln(n) = ln(1,200,000) ≈ 14.0, BIC penalizes each additional parameter seven times more heavily than AIC (penalty of 2.0), preventing the inclusion of noise variables that appear artificially significant due to massive sample size.
During GLM diagnostic review of a commercial liability severity model, the actuary plots standardized deviance residuals against the linear predictor and observes a distinct bowed (U-shaped) curve. What modeling defect does this diagnostic plot indicate?
The link function is misspecified (e.g., using an identity or reciprocal link instead of a log link) or the model is missing quadratic/nonlinear predictor terms.
The model has an incorrect dispersion parameter phi that should be re-estimated using the deviance estimator.
The dataset contains extreme claim frequency overdispersion that requires a Negative Binomial distribution.
The observations were improperly weighted by earned vehicle exposure instead of policy count.
Sections you finish are checked off in the contents.