Tutorials › Exam PA - Predictive Analytics › The GLM Mean Structure And Linear Predictor

Exam PA · GLM Families and Model Construction · Tutorial 296 of 966

The GLM Mean Structure And Linear Predictor

Learn to move from predictor values to a GLM’s conditional mean while keeping the response, linear predictor, and link distinct.

Intermediate 10 min read

What You'll Learn

  • Distinguish an observed response from its conditional mean
  • Write a GLM linear predictor using coefficients and encoded predictors
  • Connect a linear predictor to a conditional mean through a link and its inverse
  • Calculate fitted means for identity, log, and logit links
  • Interpret main effects and interactions on the linear-predictor scale
  • Avoid confusing a predicted mean with an individual outcome or probability

From Predictor Values to a Conditional Mean

A generalized linear model (GLM) describes how the expected response changes with predictors. Its central task is not to predict an observed outcome with certainty. Instead, for specified predictor values, it defines a conditional mean and uses a link to relate that mean to a linear expression in model coefficients.

This distinction matters in actuarial work. A model might estimate the expected number of events for a policy with particular characteristics, or the expected cost for a specified risk profile. The estimate is conditional on those characteristics; it is not a promise about the individual policy’s realized outcome.

Definition: For observation \(i\), let \(Y_i\) be the response and let \(\mathbf{x}_i\) be its specified predictor values. The conditional response mean is \(\mu_i=E(Y_i\mid\mathbf{x}_i)\). A GLM mean structure relates this mean to a linear predictor \(\eta_i=\mathbf{x}_i^{T}\boldsymbol{\beta}\) through a link function \(g\): \(g(\mu_i)=\eta_i\). When the inverse link exists, the fitted conditional mean is \(\mu_i=g^{-1}(\eta_i)\). The expression \(\eta_i\), formed from the predictors and coefficients, is also called the systematic component.

The vector \(\mathbf{x}_i\) contains the model’s encoded predictors, including an intercept if one is included. The coefficient vector \(\boldsymbol{\beta}\) contains the corresponding model coefficients. “Linear” refers to the linear combination of these coefficients in \(\eta_i\); the predictors themselves can include transformed variables, indicators, or interaction terms.

The mean structure is only one part of a full GLM. It specifies how predictor values determine the conditional mean. A full model also specifies a response distribution and its variability. Those distributional details are separate from the calculations here: knowing \(\eta_i\) and \(g\) determines \(\mu_i\), but does not by itself describe the spread of \(Y_i\) around \(\mu_i\).

Why the Link and Linear Predictor Work Together

A linear expression such as \(\mathbf{x}_i^{T}\boldsymbol{\beta}\) can take any real value. A response mean may have a restricted range: for example, a probability must be between zero and one, while an expected count must be nonnegative. The link provides a scale on which the mean can be represented by that linear expression. Applying the inverse link returns the mean to the response scale.

$$ g(\mu_i)=\eta_i=\mathbf{x}_i^{T}\boldsymbol{\beta} \qquad\Longleftrightarrow\qquad \mu_i=g^{-1}(\mathbf{x}_i^{T}\boldsymbol{\beta}) $$

This relationship gives a short justification for the fitted-mean formula. Start with the GLM specification \(g(\mu_i)=\eta_i\). If \(g\) has an inverse over the relevant range, apply \(g^{-1}\) to both sides. Then \(g^{-1}(g(\mu_i))=g^{-1}(\eta_i)\), so \(\mu_i=g^{-1}(\eta_i)\). The predictors therefore determine the mean in two stages: first calculate \(\eta_i\), then transform it back using the inverse link.

When a predictor \(x_j\) enters only as a main effect, with coefficient \(\beta_j\), the link scale changes by \(\beta_j\) for a one-unit increase in that predictor, holding the other predictors fixed. On the response-mean scale, the change depends on the inverse link. If the inverse link is differentiable, the local rate of change is

$$ \frac{\partial \mu_i}{\partial x_{ij}} = (g^{-1})'(\eta_i)\,\beta_j $$

Thus a coefficient is generally not a direct additive change in the mean. It is an additive change in the linear predictor; the link determines what that means for the response.

Worked Examples

Worked Example: Identity Link for Expected Claim Cost

A hypothetical insurer models mean claim cost in thousands of dollars using an identity link. Let \(x\) be years of policy tenure beyond the first year, and let \(r=1\) indicate a rural address, with \(r=0\) otherwise. The fitted mean structure is \(\eta=24+1.6x-3r\) and \(g(\mu)=\mu\). Find the conditional mean for a policy with \(x=4\) and \(r=1\), and compare it with the mean for an otherwise identical urban policy.

Method. Calculate the linear predictor for each profile, then use the inverse identity link, which leaves the value unchanged.

For the rural policy, substitute \(x=4\) and \(r=1\):

$$ \eta=24+1.6(4)-3(1)=24+6.4-3=27.4 $$

Because \(g(\mu)=\mu\), the inverse link is also the identity, so \(\mu=27.4\) thousand dollars, or $27,400. For the otherwise identical urban policy, set \(r=0\):

$$ \eta=24+1.6(4)-3(0)=30.4 $$

The urban conditional mean is $30,400, which is $3,000 higher. A one-unit increase in tenure changes the modeled mean by 1.6 thousand dollars, or $1,600, holding rural status fixed. Check: the two fitted means differ by exactly the rural coefficient of 3 thousand dollars, as required by this identity-link model. The common mistake avoided is treating \(24+1.6x-3r\) as a predicted realized claim cost rather than a conditional mean.

Worked Example: Log Link for Expected Event Count

For a hypothetical portfolio, a model uses a log link for the conditional mean annual event count per policy. Let \(g(\mu)=\log(\mu)\), let \(g(\mu)=\eta=-1.2+0.3g+0.2t\), where \(g\) is a garage indicator and \(t\) is a territory indicator. Find the fitted mean for a policy with a garage and the reference territory, then find the mean for the same policy in the other territory and their ratio.

Method. Substitute the indicator values into the linear predictor and exponentiate, since the inverse of the natural logarithm is the exponential function.

For a policy with a garage in the reference territory, \(g=1\) and \(t=0\):

$$ \eta=-1.2+0.3(1)+0.2(0)=-0.9 $$

Therefore, \(\mu=\exp(-0.9)\approx0.4066\) events per policy-year. In the other territory, \(g=1\) and \(t=1\):

$$ \eta=-1.2+0.3(1)+0.2(1)=-0.7, \qquad \mu=\exp(-0.7)\approx0.4966 $$

The ratio of the second mean to the first is

$$ \frac{\exp(-0.7)}{\exp(-0.9)} =\exp(0.2) \approx1.2214 $$

The modeled mean is about 1.2214 times as large in the other territory, an increase of about 22.14%. Check: \(0.4066(1.2214)\approx0.4966\), allowing for rounding. The common mistake avoided is reporting the coefficient \(0.2\) as an increase of 0.2 events: it is an additive change on the log-mean scale, and the corresponding mean ratio is \(\exp(0.2)\). Also, an expected count is not a probability; a mean count can exceed one.

Worked Example: An Interaction in a Probability Model

A hypothetical binary response \(Y\) records whether a specified event occurs, with values zero or one. A model uses the logit link \(g(\mu)=\log\{\mu/(1-\mu)\}\), where \(\mu=E(Y\mid\mathbf{x})\). Let \(a=1\) identify an older age band and \(h=1\) identify a prior event. The linear predictor is \(\eta=-1.5+0.4a+0.8h+0.5ah\). Calculate the fitted event probability for all four combinations of \(a\) and \(h\), and interpret the interaction on the linear-predictor scale.

Method. Compute \(\eta\) for each pair of indicator values, then apply the inverse logit, \(\mu=1/(1+\exp(-\eta))\). For a binary response, the conditional mean equals the conditional probability of \(Y=1\).

For \(a=0,h=0\), the interaction term is zero and \(\eta=-1.5\). Thus \(\mu=1/(1+\exp(1.5))\approx0.1824\). For \(a=1,h=0\), \(\eta=-1.5+0.4=-1.1\), giving \(\mu=1/(1+\exp(1.1))\approx0.2497\). For \(a=0,h=1\), \(\eta=-1.5+0.8=-0.7\), giving \(\mu=1/(1+\exp(0.7))\approx0.3318\).

For \(a=1,h=1\), include every term, including the interaction:

$$ \eta=-1.5+0.4(1)+0.8(1)+0.5(1)(1)=0.2 $$

The fitted probability is \(1/(1+\exp(-0.2))\approx0.5498\). The age-band coefficient is 0.4 on the linear-predictor scale when \(h=0\), but \(0.4+0.5=0.9\) when \(h=1\). The interaction means that the age-band contrast depends on prior-event status on this scale. Check: the four probabilities are all between zero and one, and the both-indicators profile has the largest linear predictor and fitted probability. The common mistake avoided is dropping the product term \(ah\) when both indicators equal one.

Building and Reading the Mean Structure

A reliable calculation keeps three objects distinct: the observed response \(Y_i\), the linear predictor \(\eta_i\), and the conditional mean \(\mu_i\). The response is what is observed. The linear predictor is calculated from predictors and coefficients. The conditional mean is obtained by applying the inverse link to that predictor.

1
Specify the predictor profile.
Record the values and coding of every predictor for the observation of interest. In particular, identify the reference level represented by zero for an indicator.
2
Calculate the systematic component.
Substitute the predictor values into \(\eta_i=\mathbf{x}_i^{T}\boldsymbol{\beta}\), including any interaction terms present in the model.
3
Apply the inverse link.
Use the specified \(g^{-1}\) to convert \(\eta_i\) to the conditional mean \(\mu_i\). Do not assume the identity link unless the model specifies it.
4
Interpret on the right scale.
State whether a coefficient describes a change on the linear-predictor scale, and translate it to the mean scale using the link when needed.

Indicator variables and interactions are part of the design of the systematic component. With a reference-category coding, an indicator of zero means the reference level; an indicator of one means the comparison level. An interaction is a product of predictor values, so its contribution is zero unless the relevant values make that product nonzero. Always substitute the values before interpreting a coefficient in isolation.

When a predictor enters only as a main effect, its coefficient describes its one-unit effect on \(\eta_i\), holding other terms fixed. If the model includes an interaction involving that predictor, the effect on \(\eta_i\) also depends on the interacting predictor. In either case, translating this contrast to the mean scale requires the link. The example with the log link showed a multiplicative mean comparison, while the identity-link example gave an additive mean comparison.

Common Traps and a Final Check

  • Confusing the mean with an observed value. A fitted \(\mu_i\) describes an expected response conditional on predictors. It does not determine the actual response for a particular case.
  • Skipping the inverse link. Except with an identity link, \(\eta_i\) is not itself the response mean. Calculate the predictor first, then apply \(g^{-1}\).
  • Interpreting every coefficient as an additive mean change. A coefficient is a change on the linear-predictor scale. The link determines how that change translates to the mean.
  • Omitting an interaction. Evaluate each term in the specified predictor expression. A product of two indicators can contribute when both indicators equal one.
  • Calling a mean count a probability. An expected count can be greater than one. A conditional event probability is bounded between zero and one.
Key takeaway: A GLM mean structure has the form \(g(\mu_i)=\eta_i=\mathbf{x}_i^{T}\boldsymbol{\beta}\). Predictor values and coefficients determine the systematic component; the inverse link then determines the conditional response mean. Interpret coefficients on the scale on which they act, and distinguish the fitted mean from the outcome that is eventually observed.

Check Your Understanding

For each problem, calculate the requested quantity from the stated mean structure.

  1. A hypothetical model uses an identity link and \(\eta=12+2x-5z\), where \(x=3\) and \(z=1\). Find the conditional mean. (Answer: 13)
  2. A model for a nonnegative response uses a log link with \(\eta=-0.8+0.25x\). For \(x=2\), calculate the fitted mean to four decimal places. (Answer: 0.7408)
  3. An identity-link model has \(\eta=40+3x-8z+2xz\). Calculate the conditional mean when \(x=2\) and \(z=1\), showing the interaction contribution. (Answer: 42)
  4. A binary-response model uses the logit link and \(\eta=-2+0.5x\). For \(x=2\), calculate the fitted probability to four decimal places. (Answer: 0.2689)
  5. A log-link model has \(\eta=-1+0.4x\). By what factor does the fitted mean change when \(x\) increases by one unit, with other predictors held fixed? Give four decimal places. (Answer: 1.4918)
Clinical Biostats