Why predictions need a target
Separation can make maximum-likelihood estimates of fixed effects diverge, but a prediction is a probability, not a coefficient. A fitted probability for a well-supported observed pattern may approach zero or one as a coefficient grows. A prediction for a sparse pattern, a new cluster, or a covariate value outside the observed range can behave differently. Penalization and proper priors prevent the same unbounded coefficient movement, but the resulting probabilities can depend on the penalty or prior scale.
Before comparing predictions, specify what is being predicted. In a binary GLMM, a probability conditional on a particular cluster's random effect is not generally the same as a probability averaged over the random-effect distribution. A Bayesian posterior predictive probability also averages over uncertainty in the parameters; it is not simply the probability obtained by inserting posterior means into the link function.
What separation does to fitted probabilities
Assume the binary response model is correctly specified for the prediction target, the covariate values and cluster structure are defined, and the random-effect distribution is appropriate for the intended population. In a separated fixed-effect direction, the likelihood can improve as a coefficient moves farther from zero without attaining its maximum at any finite value. The earlier material on separation explains why this produces non-finite maximum-likelihood estimates. For prediction, the implication depends on the linear predictor: if its value tends to positive infinity, the inverse-logit tends to one; if it tends to negative infinity, it tends to zero.
That limiting behavior does not mean every prediction from a separated model is trustworthy. Predictions on the observed separating patterns may be nearly deterministic simply because the data separate those patterns. Predictions at unsupported covariate combinations can instead be highly sensitive to how the diverging direction is regularized. In a GLMM, the relevant prediction also depends on whether the random effect is held fixed, estimated for an observed cluster, or integrated over for a new cluster.
Worked Example: Maximum Likelihood and Ridge Predictions Under Complete Separation
Suppose hypothetical data contain four observations at \(x=-1\), all with \(Y=0\), and four at \(x=1\), all with \(Y=1\). Consider the logistic model with intercept fixed at zero, so \(\operatorname{logit}(p)=\beta x\). The two groups are perfectly separated.
At either observed value of \(x\), the probability of the observed outcome is \(\operatorname{logit}^{-1}(\beta)\). Thus the likelihood and log likelihood are $$ L(\beta)=\{\operatorname{logit}^{-1}(\beta)\}^{8},\qquad \ell(\beta)=8\log\{\operatorname{logit}^{-1}(\beta)\}. $$ As \(\beta\) increases, this likelihood increases toward one, but no finite \(\beta\) attains one. The maximum-likelihood estimate therefore diverges upward. The fitted probabilities on the two observed patterns tend to one at \(x=1\) and zero at \(x=-1\).
Now maximize the ridge-penalized log likelihood \(\ell(\beta)-\lambda\beta^2/2\). Its derivative is $$ 8\operatorname{logit}^{-1}(-\beta)-\lambda\beta. $$ For \(\lambda=0.5\), the finite maximizer solves \(8/(1+\exp(\beta))=0.5\beta\), giving approximately \(\hat{\beta}=1.966\). The predicted probabilities are \(\operatorname{logit}^{-1}(1.966)\approx0.8771\) at \(x=1\) and \(\operatorname{logit}^{-1}(-1.966)\approx0.1229\) at \(x=-1\). These are finite, but they are not implied by the separated data alone: the chosen penalty affects them.
Penalties and priors change probabilities through the linear predictor
A penalty or proper prior regularizes coefficient estimates by discouraging extreme values. In the example, a normal prior \(\beta\sim N(0,1/\lambda)\) gives a log-prior contribution of \(-\lambda\beta^2/2\), up to an additive constant. Consequently, its posterior mode coincides with the ridge estimate in that one-parameter setup. This equality of modes does not make a Bayesian prediction equal to the penalized plug-in prediction: a Bayesian prediction averages probabilities over the posterior distribution of \(\beta\).
The penalty's influence is most visible where changes to the linear predictor are consequential. Because the inverse-logit is nonlinear, a coefficient change does not produce a constant change in probability. Predictions near probability one-half can move appreciably on the probability scale, while predictions already near zero or one can appear numerically stable even as their odds change substantially. Extrapolations may be especially sensitive because the linear predictor multiplies the coefficient by a covariate value beyond the range that constrained its fit.
Worked Example: How Penalty Strength Changes an Extrapolated Prediction
Use the separated data from the preceding example. Compare \(\lambda=0.5\), which gave \(\hat{\beta}\approx1.966\), with a stronger penalty \(\lambda=2\). The stronger-penalty estimate solves \(8/(1+\exp(\beta))=2\beta\), giving approximately \(\hat{\beta}=1.042\). These values are penalized estimates, not maximum-likelihood estimates.
At the observed covariate value \(x=1\), the two predictions are $$ \operatorname{logit}^{-1}(1.966)\approx0.8771,\qquad \operatorname{logit}^{-1}(1.042)\approx0.7392. $$ The difference is about \(0.1379\), or 13.79 percentage points. At \(x=3\), which lies outside the observed covariate values, the predictions are $$ \operatorname{logit}^{-1}(3\times1.966)=\operatorname{logit}^{-1}(5.898)\approx0.9973, $$ $$ \operatorname{logit}^{-1}(3\times1.042)=\operatorname{logit}^{-1}(3.126)\approx0.9580. $$ Both extrapolated probabilities are high, but they differ by about 3.93 percentage points. A small probability difference near one can conceal a much larger change in odds; here the odds are \(\exp(5.898)\) versus \(\exp(3.126)\). Thus a probability that looks close to one should not be taken as evidence that an extrapolated prediction is insensitive to regularization.
Cluster-conditional and population-average predictions
For an observed cluster, a conditional prediction can use an estimate or posterior distribution for that cluster's \(b_j\). For a new cluster, its random effect is unknown, so a population-average prediction integrates over the random-effect distribution. In general, \(\operatorname{logit}^{-1}(\mathbf{x}^{\mathsf T}\boldsymbol{\beta})\) is not that average. The inverse-logit is nonlinear, so averaging after applying it differs from applying it after averaging.
Worked Example: Integrating Over a New Cluster's Random Intercept
Suppose a hypothetical fitted random-intercept model has fixed linear predictor \(\eta=1\) for a specified covariate pattern and \(b_j\sim N(0,3)\). The prediction at \(b_j=0\) is \(\operatorname{logit}^{-1}(1)\approx0.7311\). For a new cluster, use the three-point normal quadrature rule with nodes \(0,3,-3\) and weights \(2/3,1/6,1/6\), respectively. These nodes are scaled for variance \(3\).
The quadrature approximation to the population-average probability is $$ \frac{2}{3}\operatorname{logit}^{-1}(1)+ \frac{1}{6}\operatorname{logit}^{-1}(4)+ \frac{1}{6}\operatorname{logit}^{-1}(-2). $$ Substituting \(\operatorname{logit}^{-1}(1)\approx0.7311\), \(\operatorname{logit}^{-1}(4)\approx0.9820\), and \(\operatorname{logit}^{-1}(-2)\approx0.1192\) gives $$ (2/3)(0.7311)+(1/6)(0.9820)+(1/6)(0.1192) \approx0.4874+0.1637+0.0199=0.6709. $$ The new-cluster average, approximately \(0.6709\), is not the prediction \(0.7311\) at a zero random effect. It is also a quadrature approximation, not an exact value; more nodes may be needed if the integrand varies sharply.
Bayesian predictions average over uncertainty
For a Bayesian GLMM, a posterior predictive probability averages the response probability over the posterior distribution of fixed effects and variance parameters, and over a new random effect when predicting for a new cluster. For example, for covariate vector \(\mathbf{x}\), the new-cluster target is $$ P(Y=1\mid\text{data},\mathbf{x})= \int \operatorname{logit}^{-1}(\mathbf{x}^{\mathsf T}\boldsymbol{\beta}+b) \,p(\boldsymbol{\beta},\sigma_b,b\mid\text{data})\, d\boldsymbol{\beta}\,d\sigma_b\,db. $$ A proper prior can yield a proper posterior under separation, but that fact alone does not guarantee prior-insensitive predictions. If the separated data provide little information about a coefficient, changing its prior scale can change posterior predictions, particularly at sparse or extrapolated covariate patterns.
Worked Example: Posterior Averaging Is Not a Plug-In Prediction
Suppose three equally weighted draws from a hypothetical posterior for a slope are \(\beta=1,2,3\), and the intercept is zero. For an existing cluster with random effect fixed at zero and \(x=1\), the posterior predictive probability is approximated by averaging the three draw-specific probabilities: $$ \{ \operatorname{logit}^{-1}(1)+\operatorname{logit}^{-1}(2)+\operatorname{logit}^{-1}(3)\}/3 $$ $$ \approx(0.7311+0.8808+0.9526)/3=0.8548. $$ The posterior mean slope is \(2\), whose plug-in probability is only \(\operatorname{logit}^{-1}(2)\approx0.8808\). For \(x=3\), the corresponding posterior average is $$ \{\operatorname{logit}^{-1}(3)+\operatorname{logit}^{-1}(6)+\operatorname{logit}^{-1}(9)\}/3 \approx(0.9526+0.9975+0.9999)/3=0.9833. $$ These are illustrative posterior draws, not estimates calculated from a particular data set. With a new cluster, each draw must also average over that draw's random-effect distribution. The calculations show why applying the inverse-logit to an average coefficient is not a substitute for averaging predicted probabilities.
Comparison, diagnostics, and limitations
| Approach | Prediction calculation | Main sensitivity under separation |
|---|---|---|
| Maximum likelihood | Plug in the fitted coefficients and specify a cluster-conditional or integrated target. | Separating coefficients may diverge; predictions can tend to zero or one on separated patterns and be unstable elsewhere. |
| Penalized likelihood | Plug in finite penalized estimates; integrate random effects if the target is a new cluster. | Penalty choice affects coefficient shrinkage and thus probabilities, especially for weakly supported patterns. |
| Bayesian | Average predicted probabilities over posterior parameter uncertainty and, when needed, new random effects. | Prior choice can matter where the likelihood is weak; the posterior predictive target differs from a posterior-mode plug-in. |
Useful diagnostics compare predictions rather than coefficients alone. Refit with defensible penalty strengths or prior scales and inspect predicted probabilities at observed, sparse, and scientifically relevant covariate patterns. For GLMM predictions, state whether the target is an existing or new cluster and whether uncertainty in its random effect is included. Check that numerical integration is accurate by increasing the quadrature order or comparing against simulation; large changes indicate that the reported marginal prediction may be numerically unreliable.
A prediction near zero or one is not automatically a failure: it may reflect strong information at that pattern. The warning signs are dependence on arbitrary regularization choices, large changes at plausible covariate values, implausible extrapolations, and apparent certainty despite sparse data. Also check model structure and covariate support. Regularization stabilizes estimation; it does not create observations in empty cells, repair misspecification, or establish that the chosen prediction target is scientifically appropriate.
Check Your Understanding
Answer each question, then compare with the solutions below.
- Why can a separated maximum-likelihood coefficient diverge while the fitted probabilities at observed patterns approach finite limits?
- A penalized model gives \(\hat{\beta}=1\) and zero intercept. What is its conditional probability at \(x=2\), for a cluster with \(b_j=0\)?
- Why is \(\operatorname{logit}^{-1}(\mathbf{x}^{\mathsf T}\boldsymbol{\beta})\) generally not the probability for a new cluster?
- In a Bayesian analysis, why can a posterior predictive probability differ from the probability evaluated at the posterior mean coefficient?
- Name two checks that can reveal prediction sensitivity or numerical problems under separation.
Solutions. (1) The linear predictor can tend to positive or negative infinity, while the inverse-logit tends to one or zero, respectively; no finite coefficient is required for that probability limit. (2) The linear predictor is \(2(1)+0=2\), so the probability is \(\operatorname{logit}^{-1}(2)=1/(1+\exp(-2))\approx0.8808\). (3) A new cluster has an unknown random effect, so its probability averages \(\operatorname{logit}^{-1}(\mathbf{x}^{\mathsf T}\boldsymbol{\beta}+b)\) over the random-effect distribution. Nonlinearity means this is generally not the inverse-logit at \(b=0\). (4) The inverse-logit is nonlinear, so averaging draw-specific probabilities need not equal applying it to an average coefficient; posterior uncertainty must be integrated. (5) Examples include comparing predictions across defensible penalty strengths or prior scales, checking predictions at sparse and extrapolated patterns, verifying cluster-specific versus new-cluster targets, and increasing quadrature order to check numerical integration.