Model Selection Using Predictive Performance

Summary

The quantitative machinery for comparing models: the expected log predictive density (elpd) estimated by LOO-CV, its standard error, and a normal approximation to the difference that yields “the probability that one model is better.” The section’s most useful content is the list of three scenarios in which that normal approximation is not calibrated — very similar predictions, model misspecification, and small — worked through on three real datasets, each chosen to exhibit one of them. The recurring practical judgment: when the difference is small, say there is no practical difference rather than reaching for the probability.

Overview

Predictive checking already is model selection (Ch. 9.4, pp. 162-163)

“If predictive checking reveals problems with a model, and then we build and keep a new model which performs better in the predictive checking, we have done model selection.

Even though posterior predictive checking is using the data twice, it can be safe to discard models which show clear discrepancies between predictions and data. Trusting a model that does not show discrepancies is harder. As discussed in Section 8.3, cross validation predictive checking can detect smaller discrepancies, and so it is often superior to or should be used in comparison with ordinary posterior predictive checks.”

Note the asymmetry, which recurs throughout: a failed check is much more informative than a passed one.

Main Content

The elpd machinery

LOO-CV predictive density and elpd (Eq. 9.1-9.2, Ch. 9.4, p. 163)

For observation under model with parameters :

where denotes all observations except (conditioning on predictors suppressed).

Using as a proxy for future data from the same distribution:

Why cross validation at all: “Ideally we would compare the predictive distribution from the model to future data. When that is not yet available, we can use cross validation, which uses existing data as proxy for future data, to provide almost unbiased estimates of the expected predictive performance” (Vehtari and Ojanen 2012).

Comparing two models, with uncertainty (Eq. 9.3-9.5)

“and associated uncertainty due to having only proxy observations. If we model the future data distribution with a flat Dirichlet process, for which the mean and variance of the posterior are available analytically, then we can use the following normal approximation” (Sivula et al. 2025):

where the standard error is the sample standard error of the pointwise differences:

“When this normal approximation is well calibrated, it can be used to compute the probability that one model is better than the other in average predictive performance.”

Three scenarios where the normal approximation fails (Sivula et al. 2025)

The approximation “is well calibrated, if

  1. the models are not too similar (with an absolute difference greater than 4),
  2. the models are reasonably well specified with no outliers, and
  3. the sample size is not too small ( in this case).”

The three worked examples below are chosen deliberately: “We cover all three scenarios that can affect the calibration of the normal approximation: very similar predictions, model misspecification, and small sample size.”

Computation. MCMC with 4 chains, 1000 warmup and 1000 sampling iterations; LOO-CV via the loo package using fast PSIS-LOO (Vehtari, Gelman, and Gabry 2017).

Example 1 — Primate milk (small , small differences)

Masking, collinearity, and 17 primates (McElreath 2020; Ch. 9.4, pp. 164-165)

The question, in McElreath’s words: “A popular hypothesis has it that primates with larger brains produce more energetic milk, so that brains can grow quickly … The question here is to what extent energy content of milk, measured here by kilocalories, is related to the percent of the brain mass that is neocortex … We’ll end up needing female body mass as well, to see the masking that hides the relationships among the variables.”

The data. 17 primate species. Target: energy content of milk (kcal/g). Predictors: percent of brain mass that is neocortex, and (female body mass). “The predictor and target are centered and scaled to have unit variance.”

The models (rstanarm, priors on coefficients, on the residual scale):

Model
–––
0.60.16
1.20.60
2.40.96

Reading the table under the three scenarios.

  • Scenario 2 (misspecification) is fine: “Based on model checking and the distribution of pointwise , the models seem to be reasonably specified.”
  • For and : differences are tiny (Scenario 1) and (Scenario 3), so “we may assume to be underestimated and the error distribution to be more skewed than normal. However, since is small, we can state that there is no practical or statistical difference in the predictive performance.”
  • For : “This difference (4.2) is big enough that we are fine with respect to Scenario 1, but the number of observations is small (Scenario 3).”

The conservative correction: “If we multiply by 2, following the heuristic based on the limit of equations in Bengio and Grandvalet (2004) to make a more conservative estimate, the probability that model has better predictive performance is bigger than 0.81. Considering we have only 17 observations, this is good. Collecting more data is, however, recommended.”

The masking explained. Under , the 95% central posterior intervals for and are and — “which indicates that the data have information about the parameters. The predictors neocortex and (mass) are collinear, which causes correlation in the posterior of the coefficients, which could make the marginal posteriors overlap zero, even if the joint posterior does not. If so, looking at the predictive performance is useful. In this case, neither predictor alone is enough, and the useful predictive information is along the second principal component of their joint distribution, which explains why the models that include only one of the predictors are no better than the intercept-only model.”

This is the whole point of the example: two individually useless predictors that are jointly informative. Neither marginal posterior nor single-predictor elpd would find it.

Predictive comparison carries more uncertainty than the posterior

“As the predictive distribution includes the aleatoric uncertainty (modeled by the data model), there is often more uncertainty in the predictive performance model comparison than in the posterior distribution” (Wang and Gelman 2015). “In simple models, we can also look at the posterior for the quantities of interest.”

Example 2 — Sleep study (outliers, then a fix)

Chronic sleep restriction (Belenky et al. 2003; Ch. 9.4, p. 165)

The data. From the lme4 package: average reaction times (ms) for 18 subjects with sleep restricted to 3 hours per night for 7 consecutive nights (days 0 and 1 were adaptation and training, removed). Analyzed in detail in Prior Specification for Regression Models - Sleep Study (Ch. 17).

The models (brms, default priors — uniform on the Days coefficient; half-normal on varying-effect scales; LKJ on the correlation):

The rationale for comparing anyway: “Based on the study design, is the appropriate model for the analysis. But even when we know the target model by design, comparing models is useful for assessing how much information the data has about the varying intercepts and slopes.”

A computational note: “For a few LOO-folds with the Pareto diagnostic exceeding 0.7 we re-ran MCMC with reloo=TRUE in brms.”

Model
–––
9.80.90
20.90.9999

The catch (Scenario 2): “Model checking reveals that two observations are clear outliers with respect to these models, making the normal approximation likely to be poorly calibrated.”

The fix — switch to data models (). “Based on model checking, there is no obvious model misspecification.”

First check the data model itself:

Model
–––
13.40.999

“Although in this comparison is misspecified, the better specified model shows much better predictive performance, and as we can expect to be inflated, the actual probability that is better than is likely to be bigger than 0.999.”

Then compare within the family:

Model
8.51.0
15.91.0

“The models appear sufficiently well specified, the number of observations is bigger than 100, and the differences are not small, so we can assume that the normal approximation is well calibrated.”

The substantive coda — a comparison that does not change the conclusion, and why it still matters: “In this case, the effect of days with sleep constrained to 3 hours is so big that the main conclusion stays the same with all the models. Still, for example, does indicate higher variation between subjects than model . As passes the model checking and has higher predictive performance, we should continue looking at the posterior of model .”

Example 3 — Roaches (huge differences, then a tiny one)

Pest management in urban apartments (Gelman and Hill 2007 §8.3; Ch. 9.4, pp. 166-167)

The experiment: “treatment and control were applied to 160 and 104 apartments, respectively, and the outcome in each apartment was the number of roaches caught in a set of traps. Different apartments had traps for different numbers of days.”

The latent regression:

y ~ sqrt_roach1 + treatment + senior + offset(log(exposure2))

with sqrt_roach1 the square root of pre-treatment roach count, senior an indicator for buildings restricted to elderly residents, and the offset the log number of trap-days.

The models: Poisson, negative binomial, zero-inflated negative binomial (“the zero inflation is modeled using the same latent formula, with its own parameters”). All coefficients get ; the negative binomial shape parameter gets the brms default inverse-gamma (Vehtari 2024).

Two different PSIS-LOO repairs, chosen per model: reloo=TRUE for the Poisson (re-run MCMC for all folds with ), moment_match=TRUE for the negative binomial models (moment matching, Paananen et al. 2021).

Model
(ZINB)–––
(NB)6.90.9996
(Poisson)684.91.0

“Based on model checking, the Poisson model is underdispersed, which indicates Scenario 2, but the difference is so big that we can be certain that the zero-inflated negative binomial model is better.”

Then a fourth model, and the opposite verdict. “As we used an ad hoc square-root transformation of pre-treatment number of roaches, we also fitted a model replacing the linear square root … with a spline.”

Model
3.00.79

“Model (with spline) seems to be slightly better, but now the difference is so small that the normal approximation is likely to be not perfectly calibrated. As the difference is small, we can proceed with either model.” Discussed further in LOO Model Checking and Comparison - Roaches (Ch. 24).

Note the discipline across all three examples: the authors never treat a probability near 0.8 as a decision. When the difference is small they say “no practical difference” and move on.

Other cross validation variants

Choosing the CV scheme (Ch. 9.4, p. 167)

SituationSchemeReference
DefaultLOO with PSIS — avoids refitting per pointVehtari, Gelman, and Gabry 2017
”PSIS-LOO fails as diagnosed by many high Pareto values”-fold-CV with re-running MCMC for each fold — “a robust alternative”—
Predictive performance for new groups in a hierarchical modelleave-one-group-outMerkle, Furr, and Rabe-Hesketh 2019
Time seriesleave-future-out; but “in model comparison -block-CV with joint log score is more efficient”Bürkner, Gabry, and Vehtari 2020; Cooper, Simpson, et al. 2025
Spatial models-block-CV with joint log scoreCooper, Vehtari, and Forbes 2025

Connections

See Also