Two Different Sources of Uncertainty
A prediction of a group’s latent effect is not a directly observed quantity. It is inferred from the group’s outcomes, the fixed effects, and the assumed distribution of random effects. Even when the fitted model is held fixed, the group’s effect remains uncertain because the group’s data are finite. In addition, the fitted model is itself uncertain: its fixed-effect coefficients and variance components were estimated from data.
These sources should not be confused. Latent-effect uncertainty describes uncertainty about a particular group effect conditional on the observed data and specified model parameters. Parameter uncertainty describes how uncertainty in estimated fixed effects and variance components affects the predicted group effect and its uncertainty. A plug-in prediction substitutes parameter estimates as though they were known; its conditional interval therefore does not, by itself, account for all uncertainty due to estimating those parameters.
For a GLMM, a standard setup has observations conditionally independent given the random effects, with a response distribution from the exponential family and a link relating its conditional mean to fixed and random effects. Random effects are assigned a distribution, commonly \(b\sim N(0,D)\). The parameter vector \(\theta\) includes the fixed-effect vector and parameters of \(D\), as well as any dispersion parameters in the response model. The distinction in this tutorial applies whether \(b_j\mid y,\hat{\theta}\) is obtained analytically or approximated numerically.
In a Bayesian analysis, uncertainty about parameters can be represented by a posterior distribution for \(\theta\). In a frequentist analysis, parameter uncertainty is instead assessed through the sampling variability of estimates and predictions. These frameworks do not make every interval interchangeable: a conditional posterior interval and a frequentist prediction interval have different probability interpretations. Both make it important to state what was held fixed.
What a Gaussian Plug-In Prediction Conditions On
A random-intercept model makes the distinction explicit. Suppose a hypothetical continuous outcome \(Y_{ij}\) for observation \(i\) in group \(j\) follows
Assume the errors are independent of one another and of the random effects, and that \(\beta,\tau^2,\sigma^2\) are known for the moment. For a group with \(n_j\) observations, the group mean satisfies \(\bar{Y}_j\mid b_j\sim N(\beta+b_j,\sigma^2/n_j)\). Combining this likelihood for \(b_j\) with its normal prior gives a normal conditional distribution.
The conditional mean is the familiar shrunken group deviation. The conditional variance measures remaining uncertainty about \(b_j\) given this group’s observed mean and the stated parameter values. When parameters are estimated, the plug-in version substitutes \(\hat{\beta},\hat{\tau}^2,\hat{\sigma}^2\). It is still a conditional calculation: it does not include the sampling uncertainty of those estimates.
Worked Example: A Conditional Interval With Parameters Held Fixed
Consider hypothetical data for one group with \(n_j=4\) and \(\bar{Y}_j=12\). For this calculation, suppose the model parameters are known to be \(\beta=10\), \(\tau^2=4\), and \(\sigma^2=9\). The group mean has residual variance \(\sigma^2/n_j=9/4=2.25\).
The shrinkage weight and conditional mean are
The conditional variance and standard deviation are
Because this Gaussian model gives an exact normal conditional distribution, a 95% conditional interval is \(1.28\pm1.96(1.20)\), or \((-1.072,\,3.632)\). Under the assumed known parameters, this interval describes conditional uncertainty about this group’s latent effect. It says nothing about uncertainty from estimating \(\beta,\tau^2,\) or \(\sigma^2\), since those quantities were stipulated to be known.
Parameter Uncertainty Changes the Prediction
When the parameters are estimated, the predicted conditional mean itself depends on the estimates. In the Gaussian example, write \(g(\theta)=\lambda_j(\bar{Y}_j-\beta)\). A first-order delta-method approximation describes variation in this plug-in mean as the estimates vary:
This is an approximation to parameter-related variability in the predictor, not the conditional variance of \(b_j\mid y,\hat{\theta}\). The latter answers a different question. If multiple parameters are estimated, their covariance terms matter; treating parameter estimates as independent when they are not can misstate the parameter contribution.
Worked Example: Approximate Parameter Uncertainty in the Predicted Mean
Use the same hypothetical group data as above: \(n_j=4\), \(\bar{Y}_j=12\), \(\hat{\beta}=10\), and \(\hat{\tau}^2=4\). For this illustration, take \(\sigma^2=9\) as known, and suppose \(\hat{\beta}\) and \(\hat{\tau}^2\) have standard errors 0.50 and 1.00, respectively, with estimated covariance zero. The zero covariance is a simplifying assumption for this calculation, not a general property of GLMM estimates.
Let \(a=\sigma^2/n_j=2.25\), so \(\lambda=\tau^2/(\tau^2+a)\) and \(g=(\bar{Y}_j-\beta)\lambda\). The derivatives evaluated at the estimates are
Thus the approximate parameter-related variance is
This 0.3401 is not a replacement for the conditional standard deviation 1.20 from the first example. It quantifies approximate variation in the predicted conditional mean due to uncertainty in \(\hat{\beta}\) and \(\hat{\tau}^2\), under the stated covariance assumptions. It omits uncertainty in \(\hat{\sigma}^2\), because \(\sigma^2\) was treated as known. In a full calculation, the covariance matrix for all estimated parameters and the sensitivity of the prediction to each parameter are relevant.
Combining the Sources: The Law of Total Variance
A parameter-integrated distribution accounts for the fact that the conditional distribution of \(b_j\) changes with \(\theta\). The law of total variance gives an exact decomposition in a Bayesian formulation, where both \(b_j\) and \(\theta\) have distributions conditional on the observed data:
The first term averages conditional latent-effect variance over parameter uncertainty. The second term is variation in the conditional mean as parameters vary. A plug-in conditional variance at \(\hat{\theta}\) generally equals neither the first term exactly nor the total variance. It also leaves out the second term. To justify the identity, write \(m(\theta)=E(b_j\mid y,\theta)\), then express \(b_j-E(b_j\mid y)\) as \([b_j-m(\theta)]+[m(\theta)-E(b_j\mid y)]\). The cross-product has expectation zero conditional on \(\theta,y\), since \(E[b_j-m(\theta)\mid y,\theta]=0\); taking variances yields the two terms above.
Worked Example: A Parameter-Integrated Uncertainty Calculation
Suppose a hypothetical binary GLMM analysis yields two equally weighted parameter settings after conditioning on the data. Under the first setting, approximate the conditional distribution of a particular group effect by a normal distribution with mean \(-0.50\) and variance \(0.16\). Under the second, use mean \(-1.10\) and variance \(0.36\). These are illustrative summaries; the calculation uses only their conditional means, variances, and weights.
The integrated mean is
The average conditional variance is \(\tfrac12(0.16)+\tfrac12(0.36)=0.26\). The variance of the two conditional means is
Therefore the integrated variance is \(0.26+0.09=0.35\), with standard deviation \(\sqrt{0.35}=0.5916\). The first component reflects conditional uncertainty about the effect; the second reflects how the predicted conditional mean changes across parameter settings. A calculation using just one parameter setting would not include the between-setting component. In a binary GLMM, the conditional distribution need not be normal; this variance decomposition remains valid regardless of its shape.
Interpretation, Diagnostics, and Alternatives
The conditional distribution \(b_j\mid y,\hat{\theta}\) is useful when the aim is to describe uncertainty about a group effect under a fitted model treated as fixed. It is not automatically an interval with nominal coverage for the latent effect across repeated samples in which the model parameters are re-estimated. Nor is it an interval for a future response: response prediction also involves outcome-level variation and, depending on the target, other sources of variation.
Several checks help reveal when a plug-in result deserves caution:
- Inspect parameter precision. Large standard errors, strong covariances, or flat likelihood profiles for fixed effects or variance components can make the predicted effect sensitive to parameter estimation.
- Check boundary estimates. If a random-effect variance is near zero, small changes in that estimate can substantially change the shrinkage calculation or make ordinary local approximations unreliable.
- Assess group information and distribution shape. Sparse groups can have broad conditional uncertainty. In binary GLMMs, conditional distributions may be skewed, so a symmetric normal interval can be a poor summary even if its center is reasonable.
- Compare conditional and parameter-integrated summaries when available. A substantial difference indicates that treating the fitted parameters as fixed is consequential for the target group prediction.
A plug-in conditional interval is simpler and can be informative when parameter estimates are precise and the conditional distribution is adequately represented. A parameter-integrated Bayesian analysis averages over parameter uncertainty directly. Frequentist approaches can instead assess the sampling uncertainty of the empirical Bayes predictor using its estimated covariance structure or resampling methods. These alternatives answer related but not identical inferential questions, so the target and interval interpretation should be stated explicitly.
A common mistake is to report the conditional standard deviation of \(b_j\mid y,\hat{\theta}\) as though it were the total uncertainty in the estimated prediction. The correction is to name what is conditioned on, then assess parameter uncertainty separately or integrate over it. Simply adding two standard errors is not generally justified: the relevant variance decomposition includes covariance and, in an integrated analysis, averages conditional variances over parameter values.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- In a plug-in distribution \(b_j\mid y,\hat{\theta}\), what uncertainty is represented, and what uncertainty is omitted?
- In the Gaussian random-intercept example, if \(\sigma^2/n_j\) increases while \(\tau^2\) stays fixed, what happens to the shrinkage weight \(\lambda_j\)?
- A conditional latent-effect variance is 0.25, and a parameter-integrated calculation adds a between-parameter-mean variance of 0.09. If the average conditional variance remains 0.25, find the integrated variance and standard deviation.
- Why can a symmetric normal interval be misleading for a group effect in a binary GLMM?
Solutions. (1) It represents uncertainty about \(b_j\) conditional on the observed data and the substituted parameter values. It omits the effect of estimating those parameters on the prediction and its distribution. (2) The denominator \(\tau^2+\sigma^2/n_j\) increases, so \(\lambda_j=\tau^2/(\tau^2+\sigma^2/n_j)\) decreases; the group mean receives less weight relative to the population mean. (3) The integrated variance is \(0.25+0.09=0.34\), and its standard deviation is \(\sqrt{0.34}=0.5831\). (4) The conditional distribution can be skewed, particularly with limited binary data, so a symmetric interval centered at a prediction may not represent its tails or central probability accurately.