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 n — 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 yi under model Mk with parameters θk:
where y−i denotes all observations except yi (conditioning on predictors x suppressed).
Using yi as a proxy for future data from the same distribution:
elpdLOO(Mk∣y)=i=1∑nlogpMk(yi∣y−i)(9.2)
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 n 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):
“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
the models are not too similar (with an absolute difference greater than 4),
the models are reasonably well specified with no outliers, and
the sample size is not too small (n>100 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 n, 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 log(female body mass). “The predictor and target are centered and
scaled to have unit variance.”
The models (rstanarm, normal(0,1) priors on coefficients, exponential(1) on the
residual scale):
Scenario 2 (misspecification) is fine: “Based on model checking and the distribution of pointwise
logpMk(yi∣y−i), the models seem to be reasonably specified.”
For M2 and M3: differences are tiny (Scenario 1) andn=17 (Scenario 3), so
“we may assume SE to be underestimated and the error distribution to be more
skewed than normal. However, since elpd is small, we can state that there is no
practical or statistical difference in the predictive performance.”
For M4: “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 SE 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 M4 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 M4, the 95% central posterior intervals for β1 and β2
are (1.1,3.7) and (−0.12,−0.04) — “which indicates that the data have information about the
parameters. The predictors neocortex and log(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, M3 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 k^ diagnostic exceeding 0.7 we
re-ran MCMC with reloo=TRUE in brms.”
Model
elpdLOO(Mk,M3)
SE
p(elpd(M3,Mk)>0)
M3
–
–
–
M2
−12.7
9.8
0.90
M1
−77.8
20.9
0.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 t data models (M1t,M2t,M3t). “Based on model checking, there is no
obvious model misspecification.”
First check the data model itself:
Model
elpd(M3,M3t)
SE
p(elpd(M3t,M3)>0)
M3t
–
–
–
M3
−41.7
13.4
0.999
“Although in this comparison M3 is misspecified, the better specified model M3t shows much
better predictive performance, and as we can expect SE to be inflated, the actual
probability that M3t is better than M3 is likely to be bigger than 0.999.”
Then compare within the t family:
Model
elpd(Mkt,M3t)
SE
p>0
M2t
−45.4
8.5
1.0
M1t
−119.1
15.9
1.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, M3t does indicate higher variation between
subjects than model M3. As M3t passes the model checking and has higher predictive performance,
we should continue looking at the posterior of model M3t.”
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 yi 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:M1 Poisson, M2 negative binomial, M3 zero-inflated negative binomial (“the zero
inflation is modeled using the same latent formula, with its own parameters”). All coefficients get
normal(0,1); the negative binomial shape parameter gets the brms default
inverse-gamma(0.4,0.3) (Vehtari 2024).
Two different PSIS-LOO repairs, chosen per model:reloo=TRUE for the Poisson (re-run MCMC for all
folds with k^>0.7), moment_match=TRUE for the negative binomial models (moment matching,
Paananen et al. 2021).
Model
elpd(Mk,M3)
SE
p(elpd(M3,Mk)>0)
M3 (ZINB)
–
–
–
M2 (NB)
−23.0
6.9
0.9996
M1 (Poisson)
−4633.2
684.9
1.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 M4 replacing the linear square root … with a
spline.”
Model
elpd(Mk,M4)
SE
p>0
M3
−2.4
3.0
0.79
“Model M4 (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)
Situation
Scheme
Reference
Default
LOO with PSIS — avoids refitting per point
Vehtari, Gelman, and Gabry 2017
”PSIS-LOO fails as diagnosed by many high Pareto k^ values”
K-fold-CV with re-running MCMC for each fold — “a robust alternative”
—
Predictive performance for new groups in a hierarchical model
leave-one-group-out
Merkle, Furr, and Rabe-Hesketh 2019
Time series
leave-future-out; but “in model comparison h-block-CV with joint log score is more efficient”
Bürkner, Gabry, and Vehtari 2020; Cooper, Simpson, et al. 2025
Spatial models
h-block-CV with joint log score
Cooper, Vehtari, and Forbes 2025
Connections
The three scenarios are, in effect, a severity analysis of the comparison itself — the same skeptical
posture Posterior Predictive Checking applies to model fit, applied to the model-comparison tool.
The primate-milk masking result is why Comparing Models Visually insists on plotting the quantity of
interest across models rather than reading coefficients.