Why GLM Setup Errors Matter
In a generalized linear model, several ingredients work together but play different roles. The response distribution describes the random outcome conditional on its predictors. The link function connects the conditional mean to a linear predictor. Confusing these roles can produce a model whose fitted values are impossible, or an interpretation that reports a link-scale number as though it were a response-scale mean.
The central check is simple: identify the response's possible values, determine the allowable range of its conditional mean, and then apply the inverse link to the linear predictor. This tutorial focuses on errors in those steps. It is aligned with the SOA Exam SRM (Statistics for Risk Modeling) syllabus.
Keep the Response Distribution and Link Separate
The response distribution is chosen to represent the nature of \(Y_i\), including its support and conditional variability. For example, a Bernoulli response takes values 0 and 1, a Poisson response is a nonnegative integer count, and a Gamma response is positive and continuous. A Gaussian response is continuous and can take any real value.
The link is a separate modeling choice. It transforms the conditional mean to the scale on which a linear predictor is specified. A logit link is often used for a Bernoulli conditional mean, and a log link is often used for a Poisson conditional mean. These familiar pairings do not mean that the distribution and link are the same thing, nor that every response distribution has only one possible link.
In the usual GLM setup, observations are conditionally independent given their predictors, and the conditional distribution belongs to an exponential-family model. Its mean and variance are related; in a common notation, \(\operatorname{Var}(Y_i\mid x_i)=\phi V(\mu_i)\), where \(\phi\) is a dispersion parameter and \(V\) is the variance function. The specific distribution determines the appropriate variance structure. The link does not change the response's support.
| Response type | Possible response values | Conditional mean must satisfy | Common link example |
|---|---|---|---|
| Bernoulli | 0 or 1 | \(0\leq\mu_i\leq1\) | Logit |
| Poisson count | 0, 1, 2, ... | \(\mu_i\geq0\) | Log |
| Gamma | Positive real values | \(\mu_i>0\) | Log |
| Gaussian | Any real value | \(\mu_i\) may be any real number | Identity |
The table gives mean restrictions implied by the response type. A model can be invalid even when its linear predictor is calculated correctly: it is the implied conditional mean that must be allowable. Conversely, a value outside the response's support is not automatically an invalid mean. A Poisson response cannot itself equal 2.4, but its conditional mean can equal 2.4.
Why the Inverse Link Is Required
The linear predictor is on the link scale, not generally on the response scale. Once the model gives \(\eta_i\), the conditional mean is obtained by undoing the link transformation. This is not an optional adjustment: it follows directly from the defining equation \(g(\mu_i)=\eta_i\).
Use the model coefficients and predictor values to obtain \(\eta_i=x_i^\mathsf{T}\beta\).
Write the link equation relating the conditional mean to \(\eta_i\).
Calculate \(\mu_i=g^{-1}(\eta_i)\), then check that the result is in the allowable mean range.
For example, the identity link has \(g(\mu)=\mu\), so its inverse leaves the predictor unchanged. The log link has \(g(\mu)=\log(\mu)\), so its inverse is the exponential function. The logit link for a mean between 0 and 1 is \(g(\mu)=\log\{\mu/(1-\mu)\}\), whose inverse is the logistic function.
Worked Examples: Check the Scale and the Mean Range
Worked Example: A Bernoulli Mean Is Not the Logit Predictor
A hypothetical insurer models whether a policyholder makes a claim during one year. Let \(Y_i=1\) for a claim and \(Y_i=0\) otherwise. Assume conditionally independent Bernoulli responses with claim probability \(\mu_i\), and use the logit link. For a policyholder with calculated linear predictor \(\eta_i=0.8\), find the fitted claim probability. Report the probability to four decimal places.
Method. The Bernoulli distribution is the random component, so the conditional mean is a probability and must be between 0 and 1. The logit link states \(\log\{\mu_i/(1-\mu_i)\}=\eta_i\). Its inverse, not the identity function, must be applied.
First calculate the exponential of the predictor:
Then convert the odds-scale quantity to a probability:
Rounded to four decimal places, the fitted claim probability is 0.6900. As a check, this is between 0 and 1. The common mistake is to report \(0.8\) as the probability; that treats the logit-scale predictor as the response-scale mean and skips the inverse link.
Worked Example: A Poisson Predictor Gives an Expected Count
A hypothetical service center models the number of calls received by a unit during a specified day. Assume conditionally independent Poisson responses and a log link. For a unit whose predictor values give \(\eta_i=0.8\), calculate the expected number of calls and the probability of no calls. Give probabilities to four decimal places.
Method. The Poisson distribution permits nonnegative integer outcomes, while its mean can be any positive real number. Under the log link, \(\log(\mu_i)=\eta_i\), so \(\mu_i=\exp(\eta_i)\).
The conditional expected count is
Thus the expected number of calls is approximately 2.2255 for the specified day. The mean need not be an integer even though each observed count is an integer.
For a Poisson random variable with mean \(\mu_i\), \(P(Y_i=0\mid x_i)=\exp(-\mu_i)\). Substituting the calculated mean,
The answer is an expected count of 2.2255 and a no-call probability of 0.1079. The common mistake is to report 0.8 as the expected count or as a probability. It is neither: it is the log-mean predictor. The inverse log link gives the count mean, and the Poisson probability formula gives the probability of zero calls.
Worked Example: An Identity Link Can Give an Impossible Probability
A hypothetical model predicts whether a device fails during a month. Assume conditionally independent Bernoulli responses and consider a proposed identity-link model with linear predictor \(\eta_i=-0.35+0.30x_i\), where \(x_i\) is a numerical device score. At \(x_i=5\), determine whether the proposed fitted mean is valid. Then calculate the mean if the same linear predictor is used with a logit link.
Method. For a Bernoulli response, the conditional mean is a probability in \([0,1]\). Under the identity link, \(\mu_i=\eta_i\). Under the logit link, the same \(\eta_i\) is converted by the inverse-logit function.
First calculate the predictor:
With the identity link, the fitted mean would be \(\mu_i=1.15\). Since \(1.15>1\), it is not a possible Bernoulli mean and therefore is not a valid fitted probability.
With the logit link, the predictor remains 1.15 but the response-scale mean is
The logit-link result is a valid probability. This calculation does not establish that the logit model fits the data well; it only shows that its inverse link respects the required mean range. The common mistake is to assume that any linear predictor is automatically an allowable mean. It is allowable only after applying the selected inverse link and checking the response's mean constraints.
Common Setup Errors and How to Catch Them
Most setup errors can be found by asking which part of the model produced a quantity. The distribution concerns the random response; the link concerns the conditional mean; the predictor is a linear combination of covariates. Keeping those roles explicit prevents a plausible-looking number from being assigned the wrong interpretation.
| Error | Why it fails | Correction |
|---|---|---|
| Calling the link the response distribution | A link does not specify the response's possible outcomes or conditional variance. | Name the response distribution and link separately. |
| Using an unrestricted identity link for a bounded mean | A linear predictor can fall outside the mean's allowable range. | Check the fitted mean range for every relevant predictor value, or choose a link whose inverse respects that range. |
| Reporting \(\eta_i\) as \(\mu_i\) | The predictor is on the link scale unless the identity link is used. | Calculate \(g^{-1}(\eta_i)\) before interpreting the mean. |
| Treating a count mean as a probability | A Poisson mean is an expected count and need not be at most 1. | Use the response distribution to interpret \(\mu_i\); use a probability formula for a particular event. |
| Assuming a familiar pairing is mandatory | A common link choice is not the definition of the response distribution. | Check the response support and the validity of the link separately. |
A useful qualification is that an identity link is not intrinsically wrong. It is natural for an unrestricted real-valued mean, as in a Gaussian identity-link model. But with a Bernoulli response, an identity-link model must be checked carefully because its linear predictor can exceed 1 or fall below 0. A link that maps the full real line into the required mean range avoids that particular problem, although link choice alone does not guarantee a good fit or sensible conclusions.
Likewise, a positive mean range does not mean that every positive-response model must use the log link. The essential requirement is that the link and its domain are compatible with the intended mean values. When using a link whose inverse does not automatically stay in the allowable range for every real predictor, one must verify the model's predictor range and resulting means.
Check Your Understanding
For each problem, identify the scale of the given predictor before interpreting the result.
- A hypothetical Bernoulli model uses a logit link and gives \(\eta=0\) for a particular risk class. Calculate the fitted probability to four decimal places. (Answer: 0.5000)
- A hypothetical Poisson model for daily repair requests uses a log link and gives \(\eta=\log(4)\). Find the conditional mean number of requests. (Answer: 4)
- A Bernoulli model with an identity link gives \(\eta=-0.06\) for one observation. Is this a valid conditional mean? State the relevant range. (Answer: No; a Bernoulli mean must be in \([0,1]\).)
- A hypothetical Bernoulli logit model has \(\eta=\log(3)\). Calculate the fitted probability and explain why the value 3 is not the fitted probability. (Answer: 0.7500; 3 is the odds, not the probability.)
- A hypothetical Poisson model with log link has \(\eta=1\). Calculate the mean to four decimal places and state whether it is an event probability. (Answer: Mean \(=2.7183\); no, it is an expected count.)