Tutorials › Generalized Linear Models › Alternating Mean and Correlation Estimation

Working Correlation Choices · Tutorial 868 of 981

Alternating Mean and Correlation Estimation

Follow a complete alternating GEE update, from fixed working correlation through residual-based variance and correlation updates to practical convergence checks.

Advanced 11 min read

What You'll Learn

  • Set up the mean, marginal variance, and working-correlation quantities used in alternating GEE estimation
  • Update regression coefficients while holding the working correlation fixed
  • Estimate a dispersion parameter and working correlation from current residuals
  • Recognize when a common scale parameter does not affect the coefficient update
  • Check convergence across all updated quantities without assuming global convergence

Why Alternate the Updates?

In generalized estimating equations (GEE), the regression mean and the within-cluster dependence are connected through the covariance matrix used to weight the estimating equation. The coefficient update needs a working correlation; the correlation update, in turn, uses residuals calculated from the current fitted means. Alternating updates let each part be estimated using the current values of the others.

This procedure is an iteration among estimating equations, not generally a likelihood-maximization algorithm. An update can change the next update, and convergence should be checked rather than presumed. In particular, one should track the regression coefficients, any estimated marginal variance or dispersion parameters, and the working-correlation parameters.

Setup and Update Equations

Suppose there are \(m\) independent clusters. Cluster \(i\) has \(n_i\) observed responses collected in \(Y_i\), and a mean model with regression parameter \(\beta\) gives fitted mean vector \(\mu_i(\beta)\). Let \(D_i(\beta)=\partial\mu_i(\beta)/\partial\beta^\mathsf{T}\). If the marginal variance has a dispersion parameter \(\phi\), write \(A_i(\beta,\phi)=\operatorname{diag}\{\phi v(\mu_{ij}(\beta))\}\), where \(v\) is the variance function. For a family with fixed dispersion, \(\phi\) is fixed rather than updated. The working covariance is \(V_i=A_i^{1/2}R_i(\alpha)A_i^{1/2}\), with working-correlation parameter \(\alpha\).

Definition: An alternating mean-and-correlation procedure repeatedly (1) estimates \(\beta\) by solving the GEE with the current \(\phi\) and \(\alpha\), (2) updates any estimated marginal variance parameters using current fitted means and residuals, and (3) updates \(\alpha\) using residuals from the current mean fit. At each step, quantities not named for update are held fixed.

The coefficient step solves

$$ U(\beta;\phi,\alpha) =\sum_{i=1}^m D_i^\mathsf{T}V_i^{-1}(Y_i-\mu_i)=0. $$

For a nonlinear mean model, this equation is usually solved iteratively, for example by a Fisher-scoring or Newton-type step, while using the current working covariance. A typical dispersion update for a model with a common scale is the Pearson estimate

$$ \hat\phi = \frac{\displaystyle\sum_{i=1}^m\sum_{j=1}^{n_i} \frac{(Y_{ij}-\hat\mu_{ij})^2}{v(\hat\mu_{ij})}} {\displaystyle N-p}, \qquad N=\sum_{i=1}^m n_i, $$

where \(p\) is the dimension of \(\beta\), provided \(N>p\). This is a common moment-based scale estimate, not a universal choice for every response family or variance model. A correlation update uses standardized residuals such as \(r_{ij}=(Y_{ij}-\hat\mu_{ij})/\sqrt{v(\hat\mu_{ij})}\), and applies the chosen correlation estimator to their within-cluster products. The exact moment formula depends on the working-correlation structure; for example, exchangeable correlation pools pairwise products, while an unstructured estimate uses products for each visit pair with observations available at both visits.

What Is Held Fixed?

A transparent implementation specifies the order of updates. One common cycle is: update \(\beta\) with \(\phi\) and \(\alpha\) fixed; update \(\phi\) with the new \(\beta\) fixed; then update \(\alpha\) using residuals from that new mean fit. When estimating correlation, the mean and marginal variance model are treated as fixed for that step. The updated parameters are then used in the next cycle.

1
Initialize.
Choose starting values \(\beta^{(0)}\), \(\phi^{(0)}\) if needed, and an admissible \(\alpha^{(0)}\).
2
Update the mean.
Solve \(U(\beta;\phi^{(k)},\alpha^{(k)})=0\) for \(\beta^{(k+1)}\), holding the current dispersion and working correlation fixed.
3
Update marginal variance.
With \(\beta^{(k+1)}\) fixed, update any estimated dispersion or marginal variance parameters from the fitted means and residuals.
4
Update working correlation.
With the new mean and marginal variance fit fixed, calculate standardized residuals and update \(\alpha\) using the selected moment estimator.
5
Check and repeat.
Compare all updated quantities with their values from the preceding cycle, check the estimating-equation residual, and continue if the stopping criteria are not met.

Two Useful Properties of the Iteration

The first property explains why a common dispersion scale often need not be known to update the regression coefficients.

Result: If \(V_i=\phi W_i\) for every cluster, where \(\phi>0\) is a common scalar and \(W_i\) does not depend on \(\phi\), then the roots of the GEE for \(\beta\) do not depend on \(\phi\).

Proof. Since \((\phi W_i)^{-1}=\phi^{-1}W_i^{-1}\), the estimating equation becomes

$$ U(\beta;\phi,\alpha) =\phi^{-1}\sum_{i=1}^m D_i^\mathsf{T}W_i^{-1}(Y_i-\mu_i). $$

Because \(\phi^{-1}\) is a nonzero scalar common to the whole sum, this equation equals zero exactly when \(\sum_iD_i^\mathsf{T}W_i^{-1}(Y_i-\mu_i)=0\). Its root is therefore unchanged by the value of \(\phi\). This cancellation does not apply if variance parameters alter the relative weights across observations or clusters. \(\square\)

The second property identifies what it means for an alternating procedure to have settled. Write the coefficient, dispersion, and correlation update rules as \(B(\phi,\alpha)\), \(S(\beta)\), and \(C(\beta,\phi)\), respectively, with each rule assumed to be defined for the inputs in question.

Result: A fixed point \((\beta^\ast,\phi^\ast,\alpha^\ast)\) of the stated update cycle satisfies all three update equations: \(\beta^\ast=B(\phi^\ast,\alpha^\ast)\), \(\phi^\ast=S(\beta^\ast)\), and \(\alpha^\ast=C(\beta^\ast,\phi^\ast)\). In particular, the coefficient component solves the GEE evaluated at the fixed-point variance and correlation parameters.

Proof. At a fixed point, one complete cycle leaves every component unchanged. The first step of that cycle replaces \(\beta^\ast\) by \(B(\phi^\ast,\alpha^\ast)\); since the cycle leaves \(\beta\) unchanged, this replacement must equal \(\beta^\ast\). The same reasoning for the second and third steps gives \(\phi^\ast=S(\beta^\ast)\) and \(\alpha^\ast=C(\beta^\ast,\phi^\ast)\). By definition, \(B\) returns a solution of the GEE with its supplied \(\phi\) and \(\alpha\), so the fixed-point coefficient solves that equation. This argument characterizes a fixed point; it does not establish that iteration reaches one. \(\square\)

Worked Updates

Worked Example: An Exchangeable Moment Update

Consider three Gaussian clusters, each with two observations, and an intercept-only mean. The observed pairs are \((1,2)\), \((2,4)\), and \((3,5)\). Use the Pearson scale estimate and the exchangeable residual-moment estimate \(\hat\alpha=\sum_i e_{i1}e_{i2}/\sum_i\{(e_{i1}^2+e_{i2}^2)/2\}\), where \(e_{ij}=Y_{ij}-\hat\mu_{ij}\).

The mean update is the grand mean: \(\hat\beta=(1+2+2+4+3+5)/6=17/6\approx2.8333\). The six residuals, in cluster order, are \(-11/6,-5/6;\ -5/6,7/6;\ 1/6,13/6\). Their squared sum is \((121+25+25+49+1+169)/36=390/36=65/6\). There are \(N=6\) observations and \(p=1\) fitted coefficient, so \(\hat\phi=(65/6)/5=13/6\approx2.1667\).

The sum of within-pair products is \((55-35+13)/36=33/36=11/12\). The denominator for the correlation moment is half the squared-residual sum, \(65/12\). Thus \(\hat\alpha=(11/12)/(65/12)=11/65\approx0.1692\). For these balanced pairs, the intercept estimate is unchanged by the exchangeable weighting. In a general design, changing \(\alpha\) can change the next coefficient update.

Worked Example: A Coefficient Update With Unequal Cluster Sizes

For a Gaussian identity-link mean, consider one two-visit cluster with response \((1,3)\) and design rows \((1,0)\), \((1,1)\), and one single-observation cluster with response \(4\) and design row \((1,1)\). Take a working exchangeable correlation \(\alpha=0.5\) for the pair, and marginal variance one for this coefficient update. The single observation has working variance one.

For the pair, \(R^{-1}=(1-0.5^2)^{-1}\begin{pmatrix}1&-0.5\\-0.5&1\end{pmatrix} =\begin{pmatrix}4/3&-2/3\\-2/3&4/3\end{pmatrix}\). Its contributions to \(X^\mathsf{T}V^{-1}X\) and \(X^\mathsf{T}V^{-1}Y\) are \(\begin{pmatrix}4/3&2/3\\2/3&4/3\end{pmatrix}\) and \(\begin{pmatrix}8/3\\10/3\end{pmatrix}\), respectively. The singleton contributes \(\begin{pmatrix}1&1\\1&1\end{pmatrix}\) and \(\begin{pmatrix}4\\4\end{pmatrix}\).

The GEE for this Gaussian identity model is the GLS normal equation. Adding the contributions gives \(\begin{pmatrix}7/3&5/3\\5/3&7/3\end{pmatrix}\hat\beta =\begin{pmatrix}20/3\\22/3\end{pmatrix}\). The determinant of the coefficient matrix is \(8/3\), and solving gives \(\hat\beta_0=5/4\) and \(\hat\beta_1=9/4\). The fitted values are \(1.25,3.50\) in the pair and \(3.50\) in the singleton. This is a coefficient update with \(\alpha\) fixed at \(0.5\); the residuals for these fitted values can be used in a subsequent dispersion and correlation update.

Worked Example: Checking Whether an Iteration Has Converged

Continue with the data in the preceding example. Suppose the starting values are \(\beta^{(0)}=(0,2)\), \(\phi^{(0)}=1\), and \(\alpha^{(0)}=0.5\). The coefficient update just calculated gives \(\beta^{(1)}=(1.25,2.25)\). The residuals are \((-0.25,-0.50)\) in the pair and \(0.50\) in the singleton.

For the Gaussian model with unit variance function, the Pearson scale update is \(\phi^{(1)}=(0.25^2+0.50^2+0.50^2)/(3-2)=0.5625\). The pair-product correlation update is \(\alpha^{(1)}=(-0.25)(-0.50)/\{(0.25^2+0.50^2)/2\}=0.125/0.15625=0.8\). Thus one cycle changes the estimates to \((1.25,2.25)\), \(0.5625\), and \(0.8\).

For an absolute tolerance of \(0.01\), this cycle is not converged: the coefficient changes have magnitudes \(1.25\) and \(0.25\), the scale changes by \(0.4375\), and the correlation changes by \(0.3\). These all exceed the tolerance. A new cycle must use the updated correlation and scale in the coefficient step, then recompute residual-based quantities. The calculation illustrates one update, not a claim that later cycles must converge.

Practical Convergence Checks and a Common Pitfall

A useful stopping rule checks more than the regression coefficients. For example, require the maximum scaled change across \(\beta\), \(\phi\), and \(\alpha\) to be small, and also require the GEE residual to be small. One possible scaled change for a parameter vector \(\theta\) is \(\|\theta^{(k+1)}-\theta^{(k)}\|_\infty/\{1+\|\theta^{(k)}\|_\infty\}\). A score check can use the norm of \(U(\beta^{(k+1)};\phi^{(k+1)},\alpha^{(k+1)})\), scaled to suit the problem. The tolerance should reflect numerical precision and the scale of the parameters. Correlation and variance updates must also remain in the parameter domain required by the chosen model.

Common mistake: Treating one coefficient update as the final fit because it solves the GEE for the starting correlation. That equation is conditional on the working covariance used in the update. Once the correlation is re-estimated from the new residuals, the coefficient equation has changed and may have a different root. The correction is to repeat the full cycle and assess changes in every updated parameter, not just whether the first coefficient equation was solved.

Alternation makes the dependence between mean, variance, and working correlation explicit. It does not, by itself, guarantee a unique fixed point, convergence from every starting value, or a monotone improvement criterion. Those properties should not be inferred from small changes in one component alone.

Check Your Understanding

Use the update order and distinctions in this tutorial to answer the following.

  1. During the coefficient update, which quantities are held fixed in the cycle described here?
  2. Why does a common positive dispersion multiplier cancel from the GEE root, and when would that cancellation fail?
  3. In a Pearson scale update, why must the fitted means be recalculated after a coefficient update?
  4. What two kinds of checks, beyond comparing successive coefficient estimates, can help assess convergence?
  5. Why does solving the coefficient GEE at the beginning of a cycle not establish that the full alternating procedure has converged?
Clinical Biostats