Tutorials › Generalized Linear Mixed Models (GLMM) › Intervals for Latent Group Effects

Prediction of Random Effects · Tutorial 465 of 698

Intervals for Latent Group Effects

You will learn how posterior curvature gives an approximate interval for a group effect, how to calculate it, and what its conditional coverage does—and does not—mean.

Advanced 11 min read

What You'll Learn

  • Define a conditional interval for a group random effect with fitted model parameters fixed.
  • Derive the Laplace normal approximation around a conditional posterior mode.
  • Calculate an exact Gaussian interval and approximate intervals for binary and Poisson GLMMs.
  • Interpret interval coverage as conditional posterior probability, not as certainty about the parameter.
  • Diagnose when skewness or weak information makes a symmetric interval unreliable.
  • Distinguish Laplace intervals from numerical posterior quantile and highest-density intervals.

What Does an Interval for a Group Effect Describe?

A group random effect is latent: it is not directly observed, even when a group has many observations. An empirical Bayes prediction summarizes the conditional distribution of that effect given the group’s data and fitted model. An interval adds information about the spread and shape of that conditional distribution. It does not, by itself, account for uncertainty in the fitted fixed effects or variance components.

The distinction matters in interpretation. If an interval is constructed from the posterior distribution of \(b_j\) conditional on the observed data and fitted model parameters, its nominal coverage is a statement about that conditional distribution. It is not automatically a repeated-sampling confidence interval for an unknown fixed parameter.

Definition: For group \(j\), a conditional interval for the random effect \(b_j\) is an interval calculated from its conditional distribution given the observed data and specified model parameters. With fitted parameters \(\hat{\theta}\) treated as fixed, this distribution is written \(p(b_j\mid y,\hat{\theta})\). An equal-tailed \(100(1-\alpha)\%\) interval has conditional probability \(\alpha/2\) below its lower endpoint and \(\alpha/2\) above its upper endpoint. A Laplace interval instead uses a normal approximation to this distribution.

For a scalar random-intercept model with independent groups, the conditional density is proportional to the group’s likelihood times its random-effect density:

$$ p(b_j\mid y_j,\hat{\theta}) \propto p(y_j\mid b_j,\hat{\theta})\,p(b_j\mid\hat{\theta}). $$

Here \(\hat{\theta}\) collects the fitted model parameters, including fixed effects and variance components. The data \(y_j\) and model structure are held fixed when forming this distribution. The normal random-effects assumption supplies the prior density in this calculation; the observation likelihood is the GLMM likelihood conditional on \(b_j\).

Laplace Intervals From the Conditional Mode

Let \(\ell_j(b_j)\) be the log of the conditional density, up to an additive constant, and let \(\hat b_j\) be its mode. If the log density is sufficiently smooth and locally well approximated by a quadratic near that mode, a second-order Taylor expansion gives

$$ \ell_j(b_j) \approx \ell_j(\hat b_j) -\frac{1}{2}H_j(b_j-\hat b_j)^2, \qquad H_j=-\left.\frac{d^2\ell_j(b_j)}{db_j^2}\right|_{b_j=\hat b_j}. $$

The first derivative vanishes at an interior mode, and \(H_j\) is the negative second derivative there. If \(H_j>0\), exponentiating the quadratic approximation gives a normal density centered at \(\hat b_j\), with variance \(H_j^{-1}\). Thus a Laplace-based equal-tailed interval is

$$ \hat b_j \ \pm\ z_{1-\alpha/2}\sqrt{H_j^{-1}}, $$

where \(z_{1-\alpha/2}\) is the corresponding standard normal quantile. This is an approximation to conditional posterior quantiles, not a guarantee that the exact conditional density is normal. The Taylor expansion justifies the formula only to the extent that the local quadratic approximation describes the density over the interval’s relevant range.

1
Specify the conditional density.
Combine the group likelihood and random-effects density using the fitted parameters.
2
Find the conditional mode.
Maximize the log conditional density with respect to \(b_j\), obtaining \(\hat b_j\).
3
Calculate local curvature.
Evaluate the negative second derivative \(H_j\) at the mode. A positive curvature gives approximate variance \(H_j^{-1}\).
4
Form and interpret the interval.
Use the normal quantile formula, then describe it as conditional on the data and fitted parameters.

Worked Examples

Worked Example: An Exact Gaussian Conditional Interval

Suppose a hypothetical Gaussian random-intercept model has \(y_{ij}=10+b_j+\varepsilon_{ij}\), with \(b_j\sim N(0,9)\) and independent \(\varepsilon_{ij}\sim N(0,4)\). Treat these parameters as known fitted values. For one group, the four outcomes are 12, 13, 11, and 14. Find a 95% conditional interval for \(b_j\).

The group mean is \(\bar y_j=(12+13+11+14)/4=12.5\). In this Gaussian model, the conditional posterior is normal. Its precision is the prior precision plus the likelihood precision:

$$ \operatorname{Var}(b_j\mid y_j,\hat{\theta}) = \left(\frac{1}{9}+\frac{4}{4}\right)^{-1} = (1.1111)^{-1} = 0.9000. $$

The conditional mean is the posterior variance times the likelihood precision-weighted residual sum:

$$ E(b_j\mid y_j,\hat{\theta}) = 0.9000\left(\frac{(12-10)+(13-10)+(11-10)+(14-10)}{4}\right) = 0.9000\left(\frac{10}{4}\right) = 2.250. $$

The posterior standard deviation is \(\sqrt{0.9000}=0.9487\). Because this conditional distribution is exactly normal, its equal-tailed 95% interval is

$$ 2.250\pm1.96(0.9487) = 2.250\pm1.859 = (0.3906,\ 4.109). $$

Conditional on these four observations and the stated model parameters, the interval contains 95% of the posterior probability for this group’s intercept deviation. The effect is measured in the same units as the outcome: the group’s deviation from the fixed intercept of 10.

Worked Example: A Laplace Interval in a Binary GLMM

Consider a hypothetical group with 2 successes in 10 Bernoulli trials. Its random intercept has prior distribution \(b_j\sim N(0,1)\), and the fixed linear predictor is zero. Thus \(p_j=\operatorname{logit}^{-1}(b_j)\). Treat the parameters as fixed and construct a 95% Laplace interval.

Ignoring constants, the log conditional density is

$$ \ell_j(b_j) = 2b_j-10\log(1+e^{b_j})-\frac{b_j^2}{2}. $$

Its derivative is \(2-10p_j-b_j\). Solving \(2-10\operatorname{logit}^{-1}(b_j)-b_j=0\) gives a mode of approximately \(\hat b_j=-0.897\), where \(p_j\approx0.2897\). The negative second derivative is

$$ H_j=10p_j(1-p_j)+1 \approx 10(0.2897)(0.7103)+1 \approx 3.058. $$

The approximate standard deviation is \(\sqrt{1/3.058}=0.5719\). Therefore,

$$ -0.897\pm1.96(0.5719) = -0.897\pm1.121 \approx (-2.018,\ 0.224). $$

This is a 95% Laplace interval for the log-odds random intercept, conditional on the observed count and fitted parameters. Its symmetry is a property of the normal approximation, not necessarily of the exact conditional distribution. With only ten trials and a low success count, checking the conditional density for skewness is especially important.

Worked Example: A Laplace Interval in a Poisson GLMM

Suppose a hypothetical group has count \(y_j=3\), exposure 1, and log link. Let its linear predictor be \(b_j\), with \(b_j\sim N(0,0.25)\); the fixed contribution is zero. Find a 95% Laplace interval for the group effect, holding the parameters fixed.

The log conditional density, up to a constant, is \(\ell_j(b_j)=3b_j-e^{b_j}-b_j^2/(2(0.25))\). Its derivative is \(3-e^{b_j}-4b_j\). The root is approximately \(\hat b_j=0.383\), since \(3-e^{0.383}-4(0.383)\approx3-1.467-1.532=0.001\). The curvature and approximate variance are

$$ H_j=e^{\hat b_j}+4 \approx1.467+4 = 5.467, \qquad H_j^{-1}\approx0.1829. $$

Thus the standard deviation is \(\sqrt{0.1829}=0.4277\), and the interval is

$$ 0.383\pm1.96(0.4277) = 0.383\pm0.8383 \approx (-0.455,\ 1.221). $$

The interval is on the log-rate scale. Exponentiating its endpoints gives approximately \((0.634,\ 3.391)\), a conditional interval for the group’s multiplicative rate effect relative to the fixed contribution. It is not an interval for an absolute event rate unless the fixed contribution and exposure are incorporated as well.

Conditional Coverage and Alternative Intervals

An exact equal-tailed conditional interval \((L_j,U_j)\) is defined by

$$ P(b_j\le L_j\mid y,\hat{\theta})=\frac{\alpha}{2}, \qquad P(b_j\le U_j\mid y,\hat{\theta})=1-\frac{\alpha}{2}. $$

Consequently, its conditional posterior probability is \(1-\alpha\). This probability statement treats the observed data and \(\hat{\theta}\) as fixed and uses the specified conditional distribution for \(b_j\). It does not say that there is a 95% probability that an unknown fixed parameter lies in the realized interval. It also does not establish that intervals produced across repeated data sets will cover latent effects 95% of the time when the parameters themselves are estimated.

A Laplace interval substitutes a normal approximation for the exact conditional distribution. If the scalar conditional density can be evaluated numerically, an alternative is to integrate it and find its posterior quantiles directly. That approach can retain skewness that a symmetric Laplace interval misses. A highest posterior density interval is another option: it contains a specified posterior mass while prioritizing regions of greatest density, and need not have equal tail probabilities. These intervals answer related but distinct questions about the shape of the conditional distribution.

Diagnostics, Limitations, and Common Mistakes

Before relying on a Laplace interval, check that the fitted conditional mode is a genuine interior maximum and that \(H_j>0\). A nonpositive or extremely small curvature signals that the stated normal approximation is not supported by local curvature. Also inspect the conditional log density over the interval, rather than assuming that its curvature at one point describes both tails. Strong asymmetry, a long tail, or a substantial difference between numerical quantiles and Laplace endpoints indicates that the symmetric interval may be misleading.

  • Wrong reasoning: “The interval is 95%, so there is a 95% chance the fixed group effect is inside it.” Correction: The probability statement applies to the conditional distribution of the latent effect under the model, with observed data and fitted parameters held fixed.
  • Wrong reasoning: “The conditional mode is the interval’s center because the posterior must be symmetric.” Correction: The mode is the center of the Laplace approximation. The exact conditional distribution can be skewed, particularly with sparse binary data.
  • Wrong reasoning: “A narrow interval means all sources of uncertainty are small.” Correction: This interval describes conditional latent-effect uncertainty under fixed fitted parameters. It does not include uncertainty in those parameters.

The exact Gaussian calculation is preferable when its assumptions hold and the conditional distribution is available analytically. Laplace intervals are convenient when a local normal approximation is adequate. Numerical conditional quantiles are preferable when skewness matters and the density can be integrated reliably. None of these calculations repairs a poorly specified likelihood, an unsuitable random-effects distribution, or a lack of information in the group data.

Key takeaway: State the conditioning explicitly. A conditional interval summarizes uncertainty about a group’s latent effect under the observed data and fitted model; a Laplace interval approximates that summary using the mode and local curvature.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. A conditional distribution is approximately \(N(1.2,0.25)\), with the second argument denoting variance. Calculate its approximate 95% Laplace interval.
  2. For a scalar group effect, the negative second derivative of the log conditional density at its mode is 4. What are the approximate conditional variance and standard deviation?
  3. Why does a symmetric Laplace interval deserve extra scrutiny for a sparse binary group?
  4. What does a nominal 95% exact conditional interval mean when the fitted parameters are held fixed?

Solutions. (1) The standard deviation is \(\sqrt{0.25}=0.5\), so the interval is \(1.2\pm1.96(0.5)=1.2\pm0.98=(0.220,\ 2.180)\). (2) The approximate variance is \(H_j^{-1}=1/4=0.25\), and the standard deviation is \(\sqrt{0.25}=0.5\). (3) Sparse binary data can produce an asymmetric conditional density; local curvature at the mode does not establish that both tails are well approximated by a normal curve. Compare the approximation with the conditional density or numerical quantiles. (4) Under the specified conditional distribution, with the data and fitted parameters fixed, the interval contains 95% of the conditional posterior probability for the latent group effect; this is not a claim of 95% repeated-sampling coverage for a fixed parameter.

Clinical Biostats