Tutorials › Generalized Linear Mixed Models (GLMM) › Taylor Linearization Of The Binary Mean

Penalized Quasi-Likelihood and Its Limitations · Tutorial 210 of 698

Taylor Linearization Of The Binary Mean

Learn how the binary conditional mean is linearized at current fixed- and random-effect estimates, and how the size and curvature of the predictor change govern the approximation error.

Advanced 11 min read

What You'll Learn

  • Write the binary GLMM predictor and conditional mean at current estimates.
  • Expand the mean in changes to both fixed and random effects.
  • Derive the first-order term and the exact second-order remainder.
  • Calculate logistic mean approximations and compare them with exact means.
  • Diagnose when a local linearization may be inaccurate or leave the probability range.
  • Distinguish conditional-mean linearization from marginalization over random effects.

Why Linearize a Binary Mean?

In a binary generalized linear mixed model, the conditional success probability is a nonlinear function of a predictor that includes both fixed and random effects. Penalized quasi-likelihood (PQL) makes this nonlinear structure more manageable by replacing the mean locally with a linear approximation. The key is that the approximation is local: its accuracy depends on the expansion point, the size of the predictor change, and the curvature of the mean function.

This tutorial derives that approximation for a general binary inverse link and then specializes to the logit link. The expansion is for the conditional mean at fixed covariates and random effects. It is not an expansion of the observed binary outcome, nor does it integrate over the random-effects distribution.

Definition: For observation \(j\) in cluster \(i\), let \(Y_{ij}\) be binary and let its conditional mean be \(\mu_{ij}=E(Y_{ij}\mid \mathbf{b}_i)=h(\eta_{ij})\), where \(h\) is the inverse link and \(\eta_{ij}=\mathbf{x}_{ij}^{\mathsf T}\boldsymbol\beta+\mathbf{z}_{ij}^{\mathsf T}\mathbf{b}_i\). Here \(\mathbf{x}_{ij}\) and \(\mathbf{z}_{ij}\) are fixed design vectors, \(\boldsymbol\beta\) is the fixed-effect vector, and \(\mathbf{b}_i\) is the cluster random-effect vector.

For the usual Bernoulli model, \(Y_{ij}\mid\mathbf{b}_i\) has a Bernoulli distribution with success probability \(\mu_{ij}\). The Taylor identity below is a statement about the function \(h\); it does not require a particular distribution for \(\mathbf{b}_i\). A model may additionally assume, for example, that \(\mathbf{b}_i\sim N(\mathbf{0},\mathbf{D})\), and that outcomes are conditionally independent given the random effects and covariates.

Expansion at Current Fixed- and Random-Effect Estimates

Suppose the current values are \(\boldsymbol\beta^{(0)}\) and \(\mathbf{b}_i^{(0)}\). Define the current predictor and current conditional mean by

$$ \eta_{ij}^{(0)} =\mathbf{x}_{ij}^{\mathsf T}\boldsymbol\beta^{(0)} +\mathbf{z}_{ij}^{\mathsf T}\mathbf{b}_i^{(0)}, \qquad \mu_{ij}^{(0)}=h\!\left(\eta_{ij}^{(0)}\right). $$

For candidate values \(\boldsymbol\beta\) and \(\mathbf{b}_i\), their predictor change from this expansion point is

$$ \Delta\eta_{ij} =\eta_{ij}-\eta_{ij}^{(0)} =\mathbf{x}_{ij}^{\mathsf T}\!\left(\boldsymbol\beta-\boldsymbol\beta^{(0)}\right) +\mathbf{z}_{ij}^{\mathsf T}\!\left(\mathbf{b}_i-\mathbf{b}_i^{(0)}\right). $$

Thus the first-order expansion includes changes in both components. Holding the random effect fixed would omit the second term; holding the fixed effects fixed would omit the first. Neither omission is appropriate when both are being updated.

Theorem: If \(h\) is twice continuously differentiable on an interval containing \(\eta_{ij}^{(0)}\), \(\eta_{ij}^{(0)}+\Delta\eta_{ij}\), and the entire segment between them, then $$ \mu_{ij} =h\!\left(\eta_{ij}^{(0)}\right) +h'\!\left(\eta_{ij}^{(0)}\right)\Delta\eta_{ij} +R_{ij}, \qquad R_{ij}=(\Delta\eta_{ij})^2 \int_0^1(1-t)h''\!\left(\eta_{ij}^{(0)}+t\Delta\eta_{ij}\right)\,dt. $$ The first-order linearization discards \(R_{ij}\), giving \(\mu_{ij}\approx\mu_{ij}^{(0)}+h'(\eta_{ij}^{(0)})\Delta\eta_{ij}\).

The integral expression is an exact remainder, not an additional approximation. It follows by applying the fundamental theorem of calculus twice to \(g(t)=h(\eta_{ij}^{(0)}+t\Delta\eta_{ij})\). Since \(g'(t)=\Delta\eta_{ij}h'(\eta_{ij}^{(0)}+t\Delta\eta_{ij})\) and \(g''(t)=(\Delta\eta_{ij})^2h''(\eta_{ij}^{(0)}+t\Delta\eta_{ij})\), the second-order integral identity for \(g(1)\) gives the displayed formula. If \(h''\) is continuous, the same remainder can also be written as \(\tfrac12 h''(\eta_{ij}^{(0)}+\theta\Delta\eta_{ij})(\Delta\eta_{ij})^2\) for some \(0<\theta<1\) when \(\Delta\eta_{ij}\ne0\).

The segment condition matters: differentiability only in a small neighborhood of the expansion point is not enough if the candidate predictor lies outside that neighborhood. A useful bound follows if \(|h''(u)|\le M\) everywhere on the segment:

$$ |R_{ij}| \le (\Delta\eta_{ij})^2 M\int_0^1(1-t)\,dt =\frac{M}{2}(\Delta\eta_{ij})^2. $$

This makes the local nature explicit. With bounded curvature, the discarded error is at most of second order in the predictor change.

Logit Mean and Its Local Slope

For the logit link, \(h(\eta)=\exp(\eta)/(1+\exp(\eta))\). Its derivatives are

$$ h'(\eta)=h(\eta)\{1-h(\eta)\}, \qquad h''(\eta)=h(\eta)\{1-h(\eta)\}\{1-2h(\eta)\}. $$

The linearized mean therefore uses the current success probability as its intercept and the current probability slope as its multiplier:

$$ \mu_{ij}\approx \mu_{ij}^{(0)} +\mu_{ij}^{(0)}\{1-\mu_{ij}^{(0)}\} \left[ \mathbf{x}_{ij}^{\mathsf T}(\boldsymbol\beta-\boldsymbol\beta^{(0)}) +\mathbf{z}_{ij}^{\mathsf T}(\mathbf{b}_i-\mathbf{b}_i^{(0)}) \right]. $$

The slope is largest at a mean of \(0.5\) and becomes small near 0 or 1. The second derivative changes sign at \(\mu=0.5\): the logistic mean is locally convex when \(\eta<0\), locally concave when \(\eta>0\), and has zero second derivative at \(\eta=0\). Consequently, the tangent line can lie below or above the true mean depending on the portion of the predictor scale being traversed.

Worked Example: Logistic Linearization at a Current Predictor

Suppose a hypothetical binary observation has current predictor \(\eta_{ij}^{(0)}=-1.3900\), and a candidate update changes it by \(\Delta\eta_{ij}=0.4000\). Compare the first-order approximation with the exact logistic mean at the updated predictor.

At the expansion point, \(\mu_{ij}^{(0)}=h(-1.3900)\approx0.1994\). The derivative is \(h'(-1.3900)=0.1994(1-0.1994)\approx0.1596\). Thus the first-order approximation is

$$ \mu_{ij}\approx0.1994+0.1596(0.4000) =0.1994+0.06384 =0.2632. $$

The updated predictor is \(-1.3900+0.4000=-0.9900\). Its exact logistic mean is \(h(-0.9900)\approx0.2709\). The first-order approximation is lower by about \(0.2709-0.2632=0.0077\). This direction is consistent with positive curvature over the interval from \(-1.3900\) to \(-0.9900\), where the logistic mean is below \(0.5\).

The approximation error here is modest, but it is not zero. It is the discarded curvature contribution, not a discrepancy caused by the binary observation taking only values zero and one.

How Fixed- and Random-Effect Changes Enter

The expansion can be applied directly to the parameter and random-effect updates. It does not require introducing a separate approximation for each part: their changes first add on the predictor scale, and the derivative of \(h\) then converts that total change to the mean scale.

Worked Example: Combining a Fixed-Effect Update and a Random-Effect Update

Consider a hypothetical observation with \(\mathbf{x}_{ij}=(1,2)^{\mathsf T}\), \(\mathbf{z}_{ij}=1\), current fixed effects \(\boldsymbol\beta^{(0)}=(0.20,-0.10)^{\mathsf T}\), and current random effect \(b_i^{(0)}=0.30\). Candidate changes are \(\boldsymbol\beta-\boldsymbol\beta^{(0)}=(0.05,-0.02)^{\mathsf T}\) and \(b_i-b_i^{(0)}=-0.10\).

The current predictor is \(0.20+2(-0.10)+0.30=0.30\). Its mean is \(h(0.30)\approx0.5744\), and its slope is \(0.5744(1-0.5744)\approx0.2445\). The fixed-effect contribution to the predictor change is \(0.05+2(-0.02)=0.0100\); the random-effect contribution is \(-0.1000\). Therefore,

$$ \Delta\eta_{ij}=0.0100-0.1000=-0.0900, \qquad \mu_{ij}\approx0.5744+0.2445(-0.0900)=0.5524. $$

The updated predictor is \(0.30-0.09=0.21\), giving the exact mean \(h(0.21)\approx0.5523\). The approximation is close in this case. The calculation also shows why it is important to include both updates: the small positive fixed-effect change partly offsets the larger negative random-effect change.

When the Tangent Approximation Is Not Adequate

A small remainder is not guaranteed merely because the inverse link is smooth. A large predictor change can cross a region of substantial curvature, and the local slope may poorly represent the mean farther from the expansion point. The next calculation illustrates that problem.

Worked Example: A Large Change Produces a Poor Linear Approximation

For a hypothetical observation, take a current logit predictor of \(-2.000\) and a change of \(1.500\). The current mean is \(h(-2)\approx0.1192\), and the slope is \(0.1192(1-0.1192)\approx0.1050\). The first-order result is

$$ 0.1192+0.1050(1.500)=0.2767. $$

The updated predictor is \(-0.500\), whose exact logistic mean is \(h(-0.500)\approx0.3775\). The approximation is low by about \(0.1008\). The segment from \(-2\) to \(-0.5\) remains in the convex part of the logistic curve, so the tangent at the left endpoint lies below the curve along this segment. This is a warning against treating a first-order expression as an exact global replacement.

Several checks help identify when the linearization is being used beyond its reliable range:

  • Inspect predictor changes. Large values of \(|\Delta\eta_{ij}|\) make the second-order remainder more consequential, especially where \(|h''|\) is appreciable.
  • Compare with the exact mean. At a candidate update, calculate \(h(\eta_{ij})\) as well as the linearized value. A large discrepancy signals that the local approximation should not be interpreted as accurate at that update.
  • Check the probability range. The exact binary mean lies between zero and one, but a tangent line need not. A linearized value outside \([0,1]\) is a clear sign that the approximation is not a valid probability at that point.
  • Check the expansion point. The derivative must be evaluated at the current predictor \(\eta_{ij}^{(0)}\), and the remainder condition must cover the entire segment to the candidate predictor.

What This Linearization Does—and Does Not Do

Taylor linearization is a local approximation to the conditional mean as the fixed and random effects change. It is one component of the PQL approximation described in the earlier material on Penalized Quasi-Likelihood. It does not by itself specify the full estimation procedure, its criterion, or the updates used to fit a working mixed model.

It is also distinct from marginalizing over random effects. The quantity expanded here is \(h(\mathbf{x}_{ij}^{\mathsf T}\boldsymbol\beta+\mathbf{z}_{ij}^{\mathsf T}\mathbf{b}_i)\) at a particular random-effect value. The marginal mean would instead involve an expectation such as \(E_{\mathbf b}[h(\mathbf{x}_{ij}^{\mathsf T}\boldsymbol\beta+\mathbf{z}_{ij}^{\mathsf T}\mathbf b)]\), which generally is not obtained by simply applying \(h\) to the mean predictor. No marginalization occurs in the Taylor identity above.

The main alternative at a given candidate parameter value is to evaluate the nonlinear conditional mean directly, rather than replace it by a tangent line. That preserves the exact inverse-link relationship but does not supply the local linear surrogate used by PQL. A second-order Taylor approximation retains the quadratic curvature term, but it remains an approximation and requires the same care about the interval and remainder. The first-order version is computationally useful precisely because it is simpler; its limitation is that it discards curvature.

Common pitfall: “The inverse link is smooth, so the first-order formula is valid for any predictor change.” Smoothness alone does not make the tangent accurate, and the Taylor remainder requires differentiability across the full segment between the expansion and candidate predictors. Use the first-order expression as a local approximation, check the change and curvature, and retain the remainder when reasoning about accuracy.

Check Your Understanding

Answer each question using the expansion point and conditional-mean interpretation carefully. Solutions follow the questions.

  1. Write \(\Delta\eta_{ij}\) when both \(\boldsymbol\beta\) and \(\mathbf b_i\) change.
  2. For the logit link, what multiplier converts a small predictor change into a first-order change in the mean?
  3. At a current logit mean of \(0.80\), is the second derivative positive or negative? What does that indicate about local curvature?
  4. Why is differentiability only near the current predictor insufficient if the candidate predictor is far away?
  5. Does the Taylor expansion of the conditional mean automatically give the marginal mean over the random-effects distribution?

Solutions. (1) \(\Delta\eta_{ij}=\mathbf{x}_{ij}^{\mathsf T}(\boldsymbol\beta-\boldsymbol\beta^{(0)})+\mathbf{z}_{ij}^{\mathsf T}(\mathbf b_i-\mathbf b_i^{(0)})\). (2) The multiplier is \(h'(\eta_{ij}^{(0)})=\mu_{ij}^{(0)}(1-\mu_{ij}^{(0)})\). (3) Since \(h''(\eta)=h(\eta)\{1-h(\eta)\}\{1-2h(\eta)\}\), the second derivative is negative when the mean is \(0.80\); the logistic curve is locally concave. (4) Taylor’s remainder uses the second derivative along the whole segment between predictor values, so the differentiability condition must cover that segment. (5) No. The expansion is conditional at a specified random-effect value; marginalization requires taking an expectation over the random-effects distribution.

Clinical Biostats