# Understanding predictive information criteria for Bayesian models

- First Online:

- Received:
- Accepted:

DOI: 10.1007/s11222-013-9416-2

- Cite this article as:
- Gelman, A., Hwang, J. & Vehtari, A. Stat Comput (2014) 24: 997. doi:10.1007/s11222-013-9416-2

- 103 Citations
- 3.4k Downloads

## Abstract

We review the Akaike, deviance, and Watanabe-Akaike information criteria from a Bayesian perspective, where the goal is to estimate expected out-of-sample-prediction error using a bias-corrected adjustment of within-sample error. We focus on the choices involved in setting up these measures, and we compare them in three simple examples, one theoretical and two applied. The contribution of this paper is to put all these information criteria into a Bayesian predictive context and to better understand, through small examples, how these methods can apply in practice.

### Keywords

AIC DIC WAIC Cross-validation Prediction Bayes## 1 Introduction

Bayesian models can be evaluated and compared in several ways. Most simply, any model or set of models can be taken as an exhaustive set, in which case all inference is summarized by the posterior distribution. The fit of model to data can be assessed using posterior predictive checks (Rubin 1984), prior predictive checks (when evaluating potential replications involving new parameter values), or, more generally, mixed checks for hierarchical models (Gelman et al. 1996). When several candidate models are available, they can be compared and averaged using Bayes factors (which is equivalent to embedding them in a larger discrete model) or some more practical approximate procedure (Hoeting et al. 1999) or continuous model expansion (Draper 1999).

In other settings, however, we seek not to check models but to compare them and explore directions for improvement. Even if all of the models being considered have mismatches with the data, it can be informative to evaluate their predictive accuracy, compare them, and consider where to go next. The challenge then is to estimate predictive model accuracy, correcting for the bias inherent in evaluating a model’s predictions of the data that were used to fit it.

A natural way to estimate out-of-sample prediction error is cross-validation (see Geisser and Eddy 1979 and Vehtari and Lampinen 2002, for a Bayesian perspective), but researchers have always sought alternative measures, as cross-validation requires repeated model fits and can run into trouble with sparse data. For practical reasons alone, there remains a place for simple bias corrections such as AIC (Akaike 1973), DIC (Spiegelhalter et al. 2002; van der Linde 2005), and, more recently, WAIC (Watanabe 2010), and all these can be viewed as approximations to different versions of cross-validation (Stone 1977).

At the present time, DIC appears to be the predictive measure of choice in Bayesian applications, in part because of its incorporation in the popular BUGS package (Spiegelhalter et al. 1994, 2003). Various difficulties have been noted with DIC (see Celeux et al. 2006; Plummer 2008, and much of the discussion of Spiegelhalter et al. 2002) but there has been no consensus on an alternative.

One difficulty is that all the proposed measures are attempting to perform what is, in general, an impossible task: to obtain an unbiased (or approximately unbiased) and accurate measure of out-of-sample prediction error that will be valid over a general class of models and that requires minimal computation beyond that needed to fit the model in the first place. When framed this way, it should be no surprise to learn that no such ideal method exists. But we fear that the lack of this panacea has impeded practical advances, in that applied users are left with a bewildering array of choices.

The purpose of the present article is to explore AIC, DIC, and WAIC from a Bayesian perspective in some simple examples. Much has been written on all these methods in both theory and practice, and we do not attempt anything like a comprehensive review (for that, see Vehtari and Ojanen 2012). Our unique contribution here is to view all these methods from the standpoint of Bayesian practice, with the goal of understanding certain tools that are used to understand models. We work with three simple (but, it turns out, hardly trivial) examples to develop our intuition about these measures in settings that we understand. We do not attempt to derive the measures from first principles; rather, we rely on the existing literature where these methods have been developed and studied.

In some ways, our paper is similar to the review article by Gelfand and Dey (1994), except that they were focused on model choice whereas our goal is more immediately to estimate predictive accuracy for the goal of model comparison. As we shall discuss in the context of an example, given the choice between two particular models, we might prefer the one with higher expected predictive error; nonetheless we see predictive accuracy as one of the criteria that can be used to evaluate, understand, and compare models.

## 2 Log predictive density as a measure of model accuracy

One way to evaluate a model is through the accuracy of its predictions. Sometimes we care about this accuracy for its own sake, as when evaluating a forecast. In other settings, predictive accuracy is valued not for its own sake but rather for comparing different models. We begin by considering different ways of defining the accuracy or error of a model’s predictions, then discuss methods for estimating predictive accuracy or error from data.

### 2.1 Measures of predictive accuracy

Consider data *y*_{1},…,*y*_{n}, modeled as independent given parameters *θ*; thus \(p(y\mid\theta)=\prod_{i=1}^{n}p(y_{i}\mid\theta)\). With regression, one would work with \(p(y\mid\theta,x)=\prod_{i=1}^{n}p(y_{i}\mid\theta,x_{i})\). In our notation here we suppress any dependence on *x*.

Preferably, the measure of predictive accuracy is specifically tailored for the application at hand, and it measures as correctly as possible the benefit (or cost) of predicting future data with the model. Often explicit benefit or cost information is not available and the predictive performance of a model is assessed by generic scoring functions and rules.

Measures of predictive accuracy for point prediction are called scoring functions. A good review of the most common scoring functions is presented by Gneiting (2011), who also discusses the desirable properties for scoring functions in prediction problems. We use the squared error as an example scoring function for point prediction, because the squared error and its derivatives seem to be the most common scoring functions in predictive literature (Gneiting 2011).

Measures of predictive accuracy for probabilistic prediction are called scoring rules. Examples include the quadratic, logarithmic, and zero-one scores, whose properties are reviewed by Gneiting and Raftery (2007). Bernardo and Smith (1994) argue that suitable scoring rules for prediction are proper and local: propriety of the scoring rule motivates the decision maker to report his or her beliefs honestly, and locality incorporates the possibility that bad predictions for some \(\tilde{y}\) may be judged more harshly than others. The logarithmic score is the unique (up to an affine transformation) local and proper scoring rule (Bernardo 1979), and appears to be the most commonly used scoring rule in model selection.

### Mean squared error

A model’s fit to new data can be summarized numerically by mean squared error, \(\frac{1}{n}\sum_{i=1}^{n}(y_{i}-\mathrm{E}(y_{i}\mid\theta))^{2}\), or a weighted version such as \(\frac{1}{n}\sum_{i=1}^{n}(y_{i}-\mathrm{E}(y_{i}\mid\theta ))^{2}/\operatorname{var}(y_{i}\mid\theta)\). These measures have the advantage of being easy to compute and, more importantly, to interpret, but the disadvantage of being less appropriate for models that are far from the normal distribution.

### Log predictive density or log-likelihood

A more general summary of predictive fit is the log predictive density, log*p*(*y*∣*θ*), which is proportional to the mean squared error if the model is normal with constant variance. The log predictive density has an important role in statistical model comparison because of its connection to the Kullback-Leibler information measure (see Burnham and Anderson 2002, and Robert 1996). In the limit of large sample sizes, the model with the lowest Kullback-Leibler information—and thus, the highest expected log predictive density—will have the highest posterior probability. Thus, it seems reasonable to use expected log predictive density as a measure of overall model fit. The log predictive density is also sometimes called the log-likelihood or simply the log score.

Given that we are working with the log predictive density, the question may arise: why not use the log posterior? Why only use the data model and not the prior density in this calculation? The answer is that we are interested here in summarizing the fit of model *to data*, and for this purpose the prior is relevant in estimating the parameters but not in assessing a model’s accuracy.

We are not saying that the prior cannot be used in assessing a model’s fit to data; rather we say that the prior density is not relevant in computing *predictive* accuracy. Predictive accuracy is not the only concern when evaluating a model, and even within the bailiwick of predictive accuracy, the prior is relevant in that it affects inferences about *θ* and thus affects any calculations involving *p*(*y*∣*θ*). In a sparse-data setting, a poor choice of prior distribution can lead to weak inferences and poor predictions.

### 2.2 Log predictive density asymptotically, or for normal linear models

Under standard conditions, the posterior distribution, *p*(*θ*∣*y*), approaches a normal distribution in the limit of increasing sample size (see, e.g., DeGroot 1970). In this asymptotic limit, the posterior is dominated by the likelihood—the prior contributes only one factor, while the likelihood contributes *n* factors, one for each data point—and so the likelihood function also approaches the same normal distribution.

*n*→∞, we can label the limiting posterior distribution as

*θ*∣

*y*→N(

*θ*

_{0},

*V*

_{0}/

*n*). In this limit the log predictive density is

*c*(

*y*) is a constant that only depends on the data

*y*and the model class but not on the parameters

*θ*.

The limiting multivariate normal distribution for *θ* induces a posterior distribution for the log predictive density that ends up being a constant (equal to \(c(y)-\frac{1}{2}(k\log(2\pi) + \log\vert V_{0}/n\vert)\)) minus \(\frac{1}{2}\) times a \(\chi^{2}_{k}\) random variable, where *k* is the dimension of *θ*, that is, the number of parameters in the model. The maximum of this distribution of the log predictive density is attained when *θ* equals the maximum likelihood estimate (of course), and its posterior mean is at a value \(\frac{k}{2}\) lower. For actual posterior distributions, this asymptotic result is only an approximation, but it will be useful as a benchmark for interpreting the log predictive density as a measure of fit.

With singular models (e.g. mixture models and overparameterized complex models more generally) a set of different parameters can map to a single data model, the Fisher information matrix is not positive definite, plug-in estimates are not representative of the posterior, and the distribution of the deviance does not converge to a *χ*^{2} distribution. The asymptotic behavior of such models can be analyzed using singular learning theory (Watanabe 2009, 2010).

### 2.3 Expected pointwise out-of-sample predictive accuracy

*f*as the true model,

*y*as the observed data (thus, a single realization of the dataset

*y*from the distribution

*f*(

*y*)), and \(\tilde{y}\) as future data or alternative datasets that could have been seen. The out-of-sample predictive fit for a new data point \(\tilde{y}_{i}\) is then,

*y*. More generally, we use \(p_{\rm post}\) and \(\mathrm{E}_{\rm post}\) to denote any probability or expectation that averages over the posterior distribution of

*θ*.

*f*. A natural way to estimate the expected out-of-sample log predictive density would be to plug in an estimate for

*f*, but this will tend to imply too good a fit, as we discuss in Sect. 3. For now we consider the estimation of predictive accuracy in a Bayesian context.

*n*data points taken one at a time:

*y*into individual data points

*y*

_{i}. The advantage of using a pointwise measure, rather than working with the joint posterior predictive distribution, \(p_{\rm post}(\tilde{y})\) is in the connection of the pointwise calculation to cross-validation, which allows some fairly general approaches to approximation of out-of-sample fit using available data.

### 2.4 Evaluating predictive accuracy for a fitted model

*θ*is not known, so we cannot know the log predictive density log

*p*(

*y*∣

*θ*). For the reasons discussed above we would like to work with the posterior distribution, \(p_{\rm post}(\theta)=p(\theta\mid y)\), and summarize the predictive accuracy of the fitted model to data by

*θ*

^{s},

*s*=1,…,

*S*:

*S*is large enough to fully capture the posterior distribution; thus we shall refer to the theoretical value (4) and the computation (5) interchangeably as the log pointwise predictive density or lppd of the data.

As we shall discuss in Sect. 3, the lppd of observed data *y* is an overestimate of the elppd for future data (2). Hence the plan is to like to start with (5) and then apply some sort of bias correction to get a reasonable estimate of (2).

### 2.5 Choices in defining the likelihood and predictive quantities

*α*

_{1},…,

*α*

_{J}and hyperparameters

*ϕ*, factored as \(p(\alpha,\phi\mid y)\propto p(\phi)\prod_{j=1}^{J} p(\alpha_{j}\mid\phi) p(y_{j}\mid\alpha_{j})\), we can imagine replicating new data in existing groups (with the ‘likelihood’ being proportional to

*p*(

*y*∣

*α*

_{j})) or new data in new groups (a new

*α*

_{J+1}is drawn, and the ‘likelihood’ is proportional to

*p*(

*y*∣

*ϕ*)=∫

*p*(

*α*

_{J+1}∣

*ϕ*)

*p*(

*y*∣

*α*

_{J+1})

*dα*

_{J+1}). In either case we can easily compute the posterior predictive density of the observed data

*y*:

When predicting \(\tilde{y}\mid\alpha_{j}\) (that is, new data from existing groups), we compute \(p(y\mid\alpha_{j}^{s})\) for each posterior simulation \(\alpha_{j}^{s}\) and then take the average, as in (5).

When predicting \(\tilde{y}\mid\alpha_{J+1}\) (that is, new data from a new group), we sample \(\alpha_{J+1}^{s}\) from

*p*(*α*_{J+1}∣*ϕ*^{s}) to compute \(p(y\mid\alpha_{J+1}^{s})\).

Similar choices arise even in the simplest experiments. For example, in the model *y*_{1},…,*y*_{n}∼N(*μ*,*σ*^{2}), we have the option of assuming the sample size is fixed by design (that is, leaving *n* unmodeled) or treating it as a random variable and allowing a new \(\tilde{n}\) in a hypothetical replication.

We are not bothered by the nonuniqueness of the predictive distribution. Just as with posterior predictive checks (Rubin 1984), different distributions correspond to different potential uses of a posterior inference. Given some particular data, a model might predict new data accurately in some scenarios but not in others.

Vehtari and Ojanen (2012) discuss different prediction scenarios where the future explanatory variable \(\tilde{x}\) is assumed to be random, unknown, fixed, shifted, deterministic, or constrained in some way. Here we consider only scenarios with no *x*, \(p(\tilde{x})\) is equal to *p*(*x*), or \(\tilde{x}\) is equal to *x*. Variations of cross-validation and hold-out methods can be used for more complex scenarios. For example, for time series with unknown finite range dependencies, *h*-block cross-validation (Burman et al. 1994) can be used. Similar variations of information criteria have not been proposed. Regular cross-validation and information criteria can be used for time series in case of stationary Markov process and squared error or a scoring function or rule which is well approximated by a quadratic form (Akaike 1973; Burman et al. 1994). Challenges of evaluating structured models continue to arise in applied problems (for example, Jones and Spiegelhalter 2012).

## 3 Information criteria and effective number of parameters

For historical reasons, measures of predictive accuracy are referred to as *information criteria* and are typically defined based on the deviance (the log predictive density of the data given a point estimate of the fitted model, multiplied by −2; that is \(-2\log p(y\mid\hat {\theta})\)).

A point estimate \(\hat{\theta}\) and posterior distribution \(p_{\rm post}(\theta)\) are fit to the data *y*, and out-of-sample predictions will typically be less accurate than implied by the within-sample predictive accuracy. To put it another way, the accuracy of a fitted model’s predictions of future data will generally be lower, in expectation, than the accuracy of the same model’s predictions for observed data—even if the family of models being fit happens to include the true data-generating process, and even if the parameters in the model happen to be sampled exactly from the specified prior distribution.

We are interested in prediction accuracy for two reasons: first, to measure the performance of a model that we are using; second, to compare models. Our goal in model comparison is not necessarily to pick the model with lowest estimated prediction error or even to average over candidate models—as discussed in Gelman et al. (2003), we prefer continuous model expansion to discrete model choice or averaging—but at least to put different models on a common scale. Even models with completely different parameterizations can be used to predict the same measurements.

When different models have the same number of parameters estimated in the same way, one might simply compare their best-fit log predictive densities directly, but when comparing models of differing size or differing effective size (for example, comparing logistic regressions fit using uniform, spline, or Gaussian process priors), it is important to make some adjustment for the natural ability of a larger model to fit data better, even if only by chance.

### 3.1 Estimating out-of-sample predictive accuracy using available data

*f*. Instead we can consider various approximations. We know of no approximation that works in general, but predictive accuracy is important enough that it is still worth trying. We list several reasonable-seeming approximations here. Each of these methods has flaws, which tells us that any predictive accuracy measure that we compute will be only approximate.

*Within-sample predictive accuracy.*A natural estimate of the expected log predictive density for*new*data is the log predictive density for*existing*data. As discussed above, we would like to work with the Bayesian pointwise formula, that is, lppd as computed using the simulation (5). This summary is quick and easy to understand but is in general an overestimate of (2) because it is evaluated on the data from which the model was fit.*Adjusted within-sample predictive accuracy.*Given that lppd is a biased estimate of elppd, the next logical step is to correct that bias. Formulas such as AIC, DIC, and WAIC (all discussed below) give approximately unbiased estimates of elppd by starting with something like lppd and then subtracting a correction for the number of parameters, or the effective number of parameters, being fit. These adjustments can give reasonable answers in many cases but have the general problem of being correct at best only in expectation, not necessarily in any given case.*Cross-validation.*One can attempt to capture out-of-sample prediction error by fitting the model to training data and then evaluating this predictive accuracy on a holdout set. Cross-validation avoids the problem of overfitting but remains tied to the data at hand and thus can be correct at best only in expectation. In addition, cross-validation can be computationally expensive: to get a stable estimate typically requires many data partitions and fits. (At the extreme, leave-one-out cross-validation requires*n*fits except when some computational shortcut can be used to approximate the computations.)

### 3.2 Akaike information criterion (AIC)

In much of the statistical literature on predictive accuracy, inference for *θ* is summarized not by a posterior distribution \(p_{\rm post}\) but by a point estimate \(\hat{\theta}\), typically the maximum likelihood estimate. Out-of-sample predictive accuracy is then defined not by (1) but by \(\mbox{elpd}_{\hat{\theta}}=\mathrm{E}_{f} (\log p(\tilde{y}\mid\hat{\theta}(y)))\) defined in (3), where both *y* and \(\tilde{y}\) are random. There is no direct way to calculate (3); instead the standard approach is to use the log posterior density of the observed data *y* given a point estimate \(\hat{\theta}\) and correct for bias due to overfitting.

*k*be the number of parameters estimated in the model. The simplest bias correction is based on the asymptotic normal posterior distribution. In this limit (or in the special case of a normal linear model with known variance and uniform prior distribution), subtracting

*k*from the log predictive density given the maximum likelihood estimate is a correction for how much the fitting of

*k*parameters will increase predictive accuracy, by chance alone:

It makes sense to adjust the deviance for fitted parameters, but once we go beyond linear models with flat priors, we cannot simply add *k*. Informative prior distributions and hierarchical structures tend to reduce the amount of overfitting, compared to what would happen under simple least squares or maximum likelihood estimation.

For models with informative priors or hierarchical structure, the effective number of parameters strongly depends on the variance of the group-level parameters. We shall illustrate in Sect. 4 with the univariate normal model and in Sect. 6 with a classic example of educational testing experiments in 8 schools. Under the hierarchical model in that example, we would expect the effective number of parameters to be somewhere between 8 (one for each school) and 1 (for the average of the school effects).

There are extensions of AIC which have an adjustment related to the effective number of parameters (see Vehtari and Ojanen 2012, Sect. 5.5, and references therein) but these are seldom used due to stability problems and computational difficulties, issues that have motivated the construction of the more sophisticated measures discussed below.

### 3.3 Deviance information criterion (DIC) and effective number of parameters

*k*with a data-based bias correction. The new measure of predictive accuracy is,

*θ*over its posterior distribution. Expression (8) is calculated using simulations

*θ*

^{s},

*s*=1,…,

*S*as,

*θ*will produce the maximum log predictive density when it happens to be same as the mode, and negative \(p_{\rm DIC}\) can be produced if posterior mean is far from the mode.

*n*and can be derived from the asymptotic

*χ*

^{2}distribution (shifted and scaled by a factor of \(-\frac{1}{2}\)) of the log predictive density. For linear models with uniform prior distributions, both these measures of effective sample size reduce to

*k*. Of these two measures, \(p_{\rm DIC}\) is more numerically stable but \(p_{\rm DIC\ alt}\) has the advantage of always being positive. Compared to previous proposals for estimating the effective number of parameters, easier and more stable Monte Carlo approximation of DIC made it quickly popular.

### 3.4 Watanabe-Akaike information criterion (WAIC)

WAIC (introduced by Watanabe 2010, who calls it the widely applicable information criterion) is a more fully Bayesian approach for estimating the out-of-sample expectation (2), starting with the computed log pointwise posterior predictive density (5) and then adding a correction for effective number of parameters to adjust for overfitting.

Two adjustments have been proposed in the literature. Both are based on pointwise calculations and can be viewed as approximations to cross-validation, based on derivations not shown here.

*S*posterior draws

*θ*

^{s}:

*n*data points:

*y*

_{i}, that is, \(V_{s=1}^{S} \log p(y_{i}\mid\theta^{s})\), where \(V_{s=1}^{S}\) represents the sample variance, \(V_{s=1}^{S} a_{s} = \frac{1}{S-1}\sum_{s=1}^{S} (a_{s} - \bar{a})^{2}\). Summing over all the data points

*y*

_{i}gives the effective number of parameters:

In the present article, we evaluate both \(p_{\rm WAIC 1}\) and \(p_{\rm WAIC 2}\). For practical use, we recommend \(p_{\rm WAIC 2}\) because its series expansion has closer resemblance to the series expansion for leave-one-out cross-validation (LOO-CV) and also in practice seems to give results closer to LOO-CV.

As with AIC and DIC, we define WAIC as −2 times the expression (13) so as to be on the deviance scale. In Watanabe’s original definition, WAIC is the negative of the average log pointwise predictive density (assuming the prediction of a single new data point) and thus is divided by *n* and does not have the factor 2; here we scale it so as to be comparable with AIC, DIC, and other measures of deviance.

For a normal linear model with large sample size, known variance, and uniform prior distribution on the coefficients, \(p_{\rm WAIC 1}\) and \(p_{\rm WAIC 2}\) are approximately equal to the number of parameters in the model. More generally, the adjustment can be thought of as an approximation to the number of ‘unconstrained’ parameters in the model, where a parameter counts as 1 if it is estimated with no constraints or prior information, 0 if it is fully constrained or if all the information about the parameter comes from the prior distribution, or an intermediate value if both the data and prior distributions are informative.

Compared to AIC and DIC, WAIC has the desirable property of averaging over the posterior distribution rather than conditioning on a point estimate. This is especially relevant in a predictive context, as WAIC is evaluating the predictions that are actually being used for new data in a Bayesian context. AIC and DIC estimate the performance of the plug-in predictive density, but Bayesian users of these measures would still use the posterior predictive density for predictions.

Other information criteria are based on Fisher’s asymptotic theory assuming a regular model for which the likelihood or the posterior converges to a single point, and where maximum likelihood and other plug-in estimates are asymptotically equivalent. WAIC works also with singular models and thus is particularly helpful for models with hierarchical and mixture structures in which the number of parameters increases with sample size and where point estimates often do not make sense.

For all these reasons, we find WAIC more appealing than AIC and DIC. The purpose of the present article is to gain understanding of these different approaches by applying them in some simple examples.

### 3.5 Pointwise vs. joint predictive distribution

A cost of using WAIC is that it relies on a partition of the data into *n* pieces, which is not so easy to do in some structured-data settings such as time series, spatial, and network data. AIC and DIC do not make this partition explicitly, but derivations of AIC and DIC assume that residuals are independent given the point estimate \(\hat{\theta}\): conditioning on a point estimate \(\hat{\theta}\) eliminates posterior dependence at the cost of not fully capturing posterior uncertainty. Ando and Tsay (2010) have proposed an information criterion for the joint prediction, but its bias correction has the same computational difficulties as many other extensions of AIC and it can not be compared to cross-validation, since it is not possible to leave *n* data points out in the cross-validation approach.

### 3.6 Effective number of parameters as a random variable

It makes sense that \(p_{\rm DIC}\) and \(p_{\rm WAIC}\) depend not just on the structure of the model but on the particular data that happen to be observed. For a simple example, consider the model *y*_{i},…,*y*_{n}∼N(*θ*,1), with *n* large and *θ*∼*U*(0,∞). That is, *θ* is constrained to be positive but otherwise has a noninformative uniform prior distribution. How many parameters are being estimated in this model? If the measurement *y* is close to zero, then the effective number of parameters *p* is approximately \(\frac{1}{2}\), since roughly half the information in the posterior distribution is coming from the data and half from the prior constraint of positivity. However, if *y* is positive and large, then the constraint is essentially irrelevant, and the effective number of parameters is approximately 1. This example illustrates that, even with a fixed model and fixed true parameters, it can make sense for the effective number of parameters to depend on data.

### 3.7 ‘Bayesian’ information criterion (BIC)

There is also something called the Bayesian information criterion (a misleading name, we believe) that adjusts for the number of fitted parameters with a penalty that increases with the sample size, *n* (Schwarz 1978). The formula is \({\rm BIC} = -2 \log p(y\mid\hat{\theta }) +k \log n\), which for large datasets gives a larger penalty per parameter compared to AIC and thus favors simpler models. Watanabe (2013) has also proposed a widely applicable Bayesian information criterion (WBIC) which works also in singular and unrealizable cases. BIC and its variants differ from the other information criteria considered here in being motivated not by an estimation of predictive fit but by the goal of approximating the marginal probability density of the data, *p*(*y*), under the model, which can be used to estimate relative posterior probabilities in a setting of discrete model comparison. For reasons described in Gelman and Shalizi (2013), we do not typically find it useful to think about the posterior probabilities of models but we recognize that others find BIC and similar measures helpful for both theoretical and applied reason. For the present article, we merely point out that BIC has a different goal than the other measures we have discussed. It is completely possible for a complicated model to predict well and have a low AIC, DIC, and WAIC, but, because of the penalty function, to have a relatively high (that is, poor) BIC. Given that BIC is not intended to predict out-of-sample model performance but rather is designed for other purposes, we do not consider it further here.

### 3.8 Leave-one-out cross-validation

In Bayesian cross-validation, the data are repeatedly partitioned into a training set \(y_{\rm train}\) and a holdout set \(y_{\rm holdout}\), and then the model is fit to \(y_{\rm train}\) (thus yielding a posterior distribution \(p_{\rm train}(\theta)=p(\theta\mid y_{\rm train})\)), with this fit evaluated using an estimate of the log predictive density of the holdout data, \(\log p_{\rm train}(y_{\rm holdout})=\log\int p_{\rm pred}(y_{\rm holdout}\mid\theta)p_{\rm train}(\theta)d\theta\). Assuming the posterior distribution \(p(\theta\mid y_{\rm train})\) is summarized by *S* simulation draws *θ*^{s}, we calculate the log predictive density as \(\log (\frac{1}{S}\sum_{s=1}^{S} p(y_{\rm holdout}\mid\theta^{s}) )\).

For simplicity, we will restrict our attention here to leave-one-out cross-validation (LOO-CV), the special case with *n* partitions in which each holdout set represents a single data point. Performing the analysis for each of the *n* data points (or perhaps a random subset for efficient computation if *n* is large) yields *n* different inferences \(p_{{\rm post}(-i)}\), each summarized by *S* posterior simulations, *θ*^{is}.

*n*−1 data points, which causes underestimation of the predictive fit. For large

*n*the difference is negligible, but for small

*n*(or when using

*k*-fold cross-validation) we can use a first order bias correction

*b*by estimating how much better predictions would be obtained if conditioning on

*n*data points (Burman 1989):

*b*is rarely used as it is usually small, but we include it for completeness.

Cross-validation is like WAIC in that it requires data to be divided into disjoint, ideally conditionally independent, pieces. This represents a limitation of the approach when applied to structured models. In addition, cross-validation can be computationally expensive except in settings where shortcuts are available to approximate the distributions \(p_{{\rm post}(-i)}\) without having to re-fit the model each time (for the examples in this article such shortcuts are available, but we used the brute force approach for clarity.)

Under some conditions, different information criteria have been shown to be asymptotically equal to leave-one-out cross-validation (as *n*→∞, the bias correction can be ignored in the proofs). AIC has been shown to be asymptotically equal to LOO-CV as computed using the maximum likelihood estimate (Stone 1977). DIC is a variation of the regularized information criteria which have been shown to be asymptotically equal to LOO-CV using plug-in predictive densities (Shibata 1989).

Bayesian cross-validation works also with singular models, and Bayesian LOO-CV has been proven to asymptotically equal to WAIC (Watanabe 2010). For finite *n* there is a difference, as LOO-CV conditions the posterior predictive densities on *n*−1 data points. These differences can be apparent for small *n* or in hierarchical models, as we discus in our examples.

Other differences arise in regression or hierarchical models. LOO-CV assumes the prediction task \(p(\tilde{y}_{i}\mid\tilde{x}_{i},y_{-i},x_{-i})\) while WAIC estimates \(p(\tilde{y}_{i}\mid y,x)=p(\tilde{y}_{i}\mid y_{i},x_{i},y_{-i},x_{-i})\), so WAIC is making predictions only at *x*-locations already observed (or in subgroups indexed by *x*_{i}). This can make a noticeable difference in flexible regression models such as Gaussian processes or hierarchical models where prediction given *x*_{i} may depend only weakly on all other data points (*y*_{−i},*x*_{−i}). We illustrate with a simple hierarchical model in Sect. 6.

The cross-validation estimates are similar to the jackknife (Efron and Tibshirani 1993). Even though we are working with the posterior distribution, our goal is to estimate an expectation averaging over \(y^{\rm rep}\) in its true, unknown distribution, *f*; thus, we are studying the frequency properties of a Bayesian procedure.

### 3.9 Comparing different estimates of out-of-sample prediction accuracy

All the different measures discussed above are based on adjusting the log predictive density of the observed data by subtracting an approximate bias correction. The measures differ both in their starting points and in their adjustments.

AIC starts with the log predictive density of the data conditional on the maximum likelihood estimate \(\hat{\theta}\), DIC conditions on the posterior mean E(*θ*∣*y*), and WAIC starts with the log predictive density, averaging over \(p_{\rm post}(\theta)= p(\theta \mid y)\). Of these three approaches, only WAIC is fully Bayesian and so it is our preference when using a bias correction formula. Cross-validation can be applied to any starting point, but it is also based on the log pointwise predictive density.

## 4 Theoretical example: normal distribution with unknown mean

In order to better understand the different information criteria, we begin by evaluating them in the context of the simplest continuous model.

### 4.1 Normal data with uniform prior distribution

Consider data *y*_{1},…,*y*_{n}∼N(*θ*,1) with noninformative prior distribution, *p*(*θ*)∝1.

### AIC

### DIC

*θ*in its posterior distribution, which in this case is simply \(\mathrm{N}(\theta\mid\bar{y},\frac{1}{n})\). The relevant calculation is \(\mathrm{E}_{\rm post}((\bar{y}-\theta)^{2})=(\bar{y}-\bar{y})^{2} + \frac{1}{n}\), and then the expectation of (18) becomes,

### WAIC

*y*

_{i}∣

*θ*∼N(

*θ*,1) and \(p_{\rm post}(\theta)=\mathrm{N}(\theta\mid\bar{y},\frac {1}{n})\), and so we see that \(p_{\rm post}(y_{i})=\mathrm{N}(y_{i}\mid\bar {y},1+\frac{1}{n})\). Summing the terms for the

*n*data points, we get,

*y*

_{i}, we start with \(\log p(y_{i}\mid\theta)=\mbox{const}-\frac{1}{2}(y_{i}-\theta)^{2}\), and compute the variance of this expression, averaging over the posterior distribution, \(\theta\sim\mathrm{N}(\bar{y},\frac{1}{n})\). After the dust settles, we get

For this example, WAIC differs from AIC and DIC in two ways. First, we are evaluating the pointwise predictive density averaging each term log*p*(*y*_{i}∣*θ*) over the entire posterior distribution rather than conditional on a point estimate, hence the differences between (16) and (20). Second, the effective number of parameters in WAIC is not quite 1. In the limit of large *n*, we can replace \(s^{2}_{y}\) by its expected value of 1, yielding \(p_{\rm WAIC}\rightarrow1\).

WAIC is not so intuitive for small *n*. For example, with *n*=1, the effective number of parameters \(p_{\rm WAIC}\) is only 0.31 (for \(p_{{\rm WAIC} 1}\)) or 0.5 (for \(p_{{\rm WAIC} 2}\)). As we shall see shortly, it turns out that the value 0.5 is correct, as this is all the adjustment that is needed to fix the bias in WAIC for this sample size in this example.

### Cross-validation

### In expectation

As can be seen above, AIC, DIC, WAIC, and \(\mbox{lppd}_{\rm loo-cv}\) all are random variables, in that their values depend on the data *y*, even if the model is known. We now consider each of these in comparison to their target, the log predictive density for a new data set \(\tilde{y}\). In these evaluations we are taking expectations over both the observed data *y* and the future data \(\tilde{y}\).

*not*the same as E(lppd); the former is the expected log pointwise predictive density for future data \(\tilde{y}\), while the latter is this density evaluated at the observed data

*y*.

*n*=1 it is 0.5 and in the limit of large

*n*it goes to 1.

### In expectation: AIC and DIC

### In expectation: WAIC

*n*, the limits work out; the difference (28) and both versions of \(p_{\rm WAIC}\) all approach 1, which is appropriate for this example of a single parameter with noninformative prior distribution. At the other extreme of

*n*=1, the difference (28) and \(\mathrm{E}(p_{{\rm WAIC} 2})\) take on the value \(\frac{1}{2}\), while \(\mathrm{E}(p_{{\rm WAIC} 1})\) is slightly off with a value of 0.31. Asymptotic errors are

### In expectation: Cross-validation

*y*is,

*n*>1,

*n*−1 data points.

*n*>1,

### 4.2 Normal data with informative prior distribution

The above calculations get more interesting when we add prior information so that, in effect, less than a full parameter is estimated from any finite data set. We consider data *y*_{1},…,*y*_{n}∼N(*θ*,1) with a normal prior distribution, *θ*∼N(*μ*,*τ*^{2}). To simplify the algebraic expressions we shall write \(m=\frac{1}{\tau^{2}}\), the prior precision and equivalent number of data points in the prior. The posterior distribution is then \(p_{\rm post}(\theta)=\mathrm{N}(\theta\mid\frac{m\mu+n\bar{y}}{m+n},\frac {1}{m+n})\) and the posterior predictive distribution for a data point *y*_{i} is \(p_{\rm post}(y_{i}) =\mathrm{N}(y_{i}\mid\frac{m\mu+n\bar{y}}{m+n},1+\frac{1}{m+n})\).

### AIC

Adding a prior distribution does not affect the maximum likelihood estimate, so \(\log p(y\mid\hat{\theta}_{\rm mle})\) is unchanged from (16), and AIC is the same as before.

### DIC

*m*=0, so that \(p_{\rm DIC}=1\); at the other extreme, large values of

*m*correspond to prior distributions that are much more informative than the data, and \(p_{\rm DIC}\rightarrow0\).

### WAIC

A flat prior distribution (

*m*=0) yields \(p_{{\rm WAIC} 1}= \frac{n-1}{n+1}s^{2}_{y} +1-n\log (1+\frac{1}{n} )\) and \(p_{{\rm WAIC} 2}=\frac{n-1}{n}s^{2}_{y} + \frac{1}{2n}\), same as (21) and (22). In expectation, these are \(\mathrm{E}(p_{{\rm WAIC} 1})=\frac{n-1}{n+1}+1-n\log(1+\frac {1}{n})\) and \(\mathrm{E}(p_{{\rm WAIC} 2})=1-\frac{1}{2n}\), as before.A prior distribution equally informative as data (

*m*=*n*) yields \(p_{{\rm WAIC} 1}=\frac{n-1}{2n+1 }s^{2}_{y}+\frac {1}{4(2n+1)}(\bar{y}-\mu)^{2} + \frac{1}{2}- n\log(1+\frac{1}{2n})\) and \(p_{{\rm WAIC} 2}=\frac{n-1}{2n}s^{2}_{y} + \frac{1}{8}(\bar{y}-\mu )^{2} + \frac{1}{8n}\). In expectation, averaging over the prior distribution and the data model, these both look like \(\frac {1}{2}-o(n)\), approximately halving the effective number of parameters, on average, compared to the noninformative prior.A completely informative prior distribution (

*m*=∞) yields \(p_{\rm WAIC}=0\), which makes sense, as the data provide no information.

### Cross-validation

*y*)=

*μ*),

*m*=0 this is same as with uniform prior and it increases with increasing

*m*.

### 4.3 Hierarchical normal model

Next consider the balanced model with data *y*_{ij}∼N(*θ*_{j},1), for *i*=1,…,*n*;*j*=1,…,*J*, and prior distribution *θ*_{j}∼N(*μ*,*τ*^{2}). If the hyperparameters are known, the inference reduces to the non-hierarchical setting described above: the *J* parameters have independent normal posterior distributions, each based on *J* data points. AIC and DIC are unchanged except that the log predictive probabilities and effective numbers of parameters are summed over the groups. The results become more stable (because we are averaging \(s^{2}_{y}\) for *J* groups) but the algebra is no different.

For WAIC and cross-validation, though, there is a possible change, depending on how the data are counted. If each of the *nJ* observations is counted as a separate data point, the results again reduce to *J* copies of what we had before. But another option is to count each *group* as a separate data point, in which case the log pointwise predictive density (5) changes, as does \(p_{\rm WAIC}\) in (11) or (12), as all of these now are average over *J* larger terms corresponding to the *J* vectors *y*_{j}, rather than *nJ* little terms corresponding to the individual *y*_{ij}’s.

In a full hierarchical model with hyperparameters unknown, DIC and WAIC both change in recognition of this new source of posterior uncertainty (while AIC is not clearly defined in such cases). We illustrate in Sect. 6, evaluating these information criteria for a hierarchical model with *unknown* hyperparameters, as fit to the data from the 8-schools study.

## 5 Simple applied example: election forecasting

For simplicity, we predict *y* (vote share) solely from *x* (economic performance), using a linear regression, *y*∼N(*a*+*bx*,*σ*^{2}), with a noninformative prior distribution, *p*(*a*,*b*,log*σ*)∝1, so that the posterior distribution is normal-inverse-*χ*^{2}. Fit to all 15 data points in Fig. 1, the posterior mode \((\hat{a},\hat{b},\hat{\sigma})\) is (45.9,3.2,3.6). Although these data form a time series, we are treating them here as a simple regression problem, In particular, when considering leave-one-out cross-validation, we do not limit ourselves to predicting from the past; rather, we consider the elections as 15 independent data points.

### Posterior distribution of the observed log predictive density, *p*(*y*∣*θ*)

*χ*

^{2}. To get a sense of uncertainty in the log predictive density

*p*(

*y*

_{i}∣

*θ*), we compute it for each of

*S*=10,000 posterior simulation draws of

*θ*. Figure 2 shows the resulting distribution, which looks roughly like a \(\chi^{2}_{3}\) (no surprise since three parameters are being estimated—two coefficients and a variance—and the sample size of 15 is large enough that we would expect the asymptotic normal approximation to the posterior distribution to be pretty good), scaled by a factor of \(-\frac{1}{2}\) and shifted so that its upper limit corresponds to the maximum likelihood estimate (with log predictive density of −40.3, as noted earlier). The mean of the posterior distribution of the log predictive density is −42.0, and the difference between the mean and the maximum is 1.7, which is close to the value of \(\frac{3}{2}\) that would be predicted from asymptotic theory, given that 3 parameters are being estimated.

Figure 2 is reminiscent of the direct likelihood methods of Dempster (1974) and Aitkin (2010). Our approach is different, however, in being fully Bayesian, with the apparent correspondence appearing here only because we happen to be using a flat prior distribution. A change in *p*(*θ*) would result in a different posterior distribution for *p*(*y*∣*θ*) and thus a different Fig. 2, a different expected value, and so forth.

### Log predictive density of the observed data

For this simple linear model, the posterior predictive distribution of any data point has an analytic form (*t* with *n*−1 degrees of freedom), but it is easy enough to use the more general simulation-based computational formula (5). Calculated either way, the log pointwise predictive density is \({\rm lppd}=-40.9\). Unsurprisingly, this number is slightly lower than the predictive density evaluated at the maximum likelihood estimate: averaging over uncertainty in the parameters yields a slightly lower probability for the observed data.

### AIC

### DIC

The relevant formula is *p*_{DIC} = 2(log*p*(*y*∣E_{post}(*θ*))−E_{post}(log*p*(*y*∣*θ*))).

*S*of simulation draws.

*p*(

*a*,

*b*,log

*σ*)∝1, the posterior means of

*a*and

*b*are 45.9 and 3.2, the same as the maximum likelihood estimate. The posterior means of

*σ*,

*σ*

^{2}, and log

*σ*are E(

*σ*∣

*y*)=4.1, E(

*σ*

^{2}∣

*y*)=17.2, and E(log

*σ*∣

*y*)=1.4. Parameterizing using

*σ*, we get

*p*

_{DIC}=2(−40.5−(−42.0))=3.0, \(\widehat {\textnormal{elpd}}_{\mathrm{DIC}} = \log p(y\mid\mathrm{E}_{\mathrm{post}}(\theta)) - p_{\mathrm{DIC}} = -40.5 - 3.0 = -43.5\), and \(\textnormal{DIC} = -2\widehat{\textnormal{elpd}}_{\mathrm{DIC}} = 87.0\).

### WAIC

### Leave-one-out cross-validation

*S*times from the posterior distribution of the parameters and compute the log predictive density. The cross-validated pointwise predictive accuracy is

Given that this model includes two linear coefficients and a variance parameter, these all look reasonable as an effective number of parameters.

## 6 Simple applied example: meta-analysis of educational testing experiments

*No pooling*: Separate estimates for each of the eight schools, reflecting that the experiments were performed independently and so each school’s observed value is an unbiased estimate of its own treatment effect. This model has eight parameters: an estimate for each school.*Complete pooling*: A combined estimate averaging the data from all schools into a single number, reflecting that the eight schools were actually quite similar (as were the eight different treatments), and also reflecting that the variation among the eight estimates (the left column of numbers in Table 1) is no larger than would be expected by chance alone given the standard errors (the rightmost column in the table). This model has only one, shared, parameter.Table 1Observed effects of special preparation on test scores in eight randomized experiments. Estimates are based on separate analyses for the eight experiments. From Rubin (1981)

School

Estimated treatment effect,

*y*_{j}Standard error of effect estimate,

*σ*_{j}A

28

15

B

8

10

C

−3

16

D

7

11

E

−1

9

F

1

11

G

18

10

H

12

18

*Hierarchical model*: A Bayesian meta-analysis, partially pooling the eight estimates toward a common mean. This model has eight parameters but they are constrained through their hierarchical distribution and are not estimated independently; thus the effective number of parameters should be some number less than 8.

*θ*

_{j}∼N(

*μ*,

*τ*

^{2}), for

*j*=1,…,

*J*, where

*y*

_{j}and

*σ*

_{j}are the estimate and standard error for the treatment effect in school

*j*, and the hyperparameters

*μ*,

*τ*determine the population distribution of the effects in the schools. We assume a uniform hyperprior density,

*p*(

*μ*,

*τ*)∝1, and the resulting posterior distribution for the group-level scale parameter

*τ*is displayed in Fig. 3. The posterior mass is concentrated near 0, implying that the evidence is that there is little variation in the true treatment effects across the

*J*=8 schools.

Deviance (−2 times log predictive density) and corrections for parameter fitting using AIC, DIC, WAIC (using the correction \(p_{{\rm WAIC} 2}\)), and leave-one-out cross-validation for each of three models fitted to the data in Table 1. Lower values of AIC/DIC/WAIC imply higher predictive accuracy. Blank cells in the table correspond to measures that are undefined: AIC is defined relative to the maximum likelihood estimate and so is inappropriate for the hierarchical model; cross-validation requires prediction for the held-out case, which is impossible under the no-pooling model. The no-pooling model has the best raw fit to data, but after correcting for fitted parameters, the complete-pooling model has lowest estimated expected predictive error under the different measures. In general, we would expect the hierarchical model to win, but in this particular case, setting *τ*=0 (that is, the complete-pooling model) happens to give the best average predictive performance

No pooling ( | Complete pooling ( | Hierarchical model ( | ||
---|---|---|---|---|

AIC | \(-2\mbox{lpd} = -2 \log p(y\mid \hat{\theta }_{\rm mle})\) | 54.6 | 59.4 | |

| 8.0 | 1.0 | ||

\({\rm AIC}=-2\widehat{\rm elpd}_{\rm AIC}\) | 70.6 | 61.4 | ||

DIC | \(-2\mbox{lpd} = -2\log p(y\mid\hat{\theta }_{\rm Bayes})\) | 54.6 | 59.4 | 57.4 |

\(p_{\rm DIC}\) | 8.0 | 1.0 | 2.8 | |

\({\rm DIC}=-2\widehat{\rm elpd}_{\rm DIC}\) | 70.6 | 61.4 | 63.0 | |

WAIC | \(-2\mbox{lppd} = -2\sum_{i}\log p_{\rm post}(y_{i})\) | 60.2 | 59.8 | 59.2 |

\(p_{{\rm WAIC}1}\) | 2.5 | 0.6 | 1.0 | |

\(p_{{\rm WAIC}2}\) | 4.0 | 0.7 | 1.3 | |

\({\rm WAIC}=-2\widehat{\rm elppd}_{{\rm WAIC}2}\) | 68.2 | 61.2 | 61.8 | |

LOO-CV | −2lppd | 59.8 | 59.2 | |

\(p_{\rm loo-cv}\) | 0.5 | 1.8 | ||

\(-2{\rm lppd}_{\rm loo-cv}\) | 60.8 | 62.8 |

### AIC

The log predictive density is higher—that is, a better fit—for the no pooling model. This makes sense: with no pooling, the maximum likelihood estimate is right at the data, whereas with complete pooling there is only one number to fit all 8 schools. However, the ranking of the models changes after adjusting for the fitted parameters (8 for no pooling, 1 for complete pooling), and the expected log predictive density is estimated to be the best (that is, AIC is lowest) for complete pooling. The last column of the table is blank for AIC, as this procedure is defined based on maximum likelihood estimation which is meaningless for the hierarchical model.

### DIC

For the no-pooling and complete-pooling models with their flat priors, DIC gives results identical to AIC (except for possible simulation variability, which we have essentially eliminated here by using a large number of posterior simulation draws). DIC for the hierarchical model gives something in between: a direct fit to data (lpd) that is better than complete pooling but not as good as the (overfit) no pooling, and an effective number of parameters of 2.8, closer to 1 than to 8, which makes sense given that the estimated school effects are pooled almost all the way back to their common mean. Adding in the correction for fitting, complete pooling wins, which makes sense given that in this case the data are consistent with zero between-group variance.

### WAIC

This fully Bayesian measure gives results similar to DIC. The fit to observed data is slightly worse for each model (that is, the numbers for lppd are slightly more negative than the corresponding values for lpd, higher up in the table), accounting for the fact that the posterior predictive density has a wider distribution and thus has lower density values at the mode, compared to the predictive density conditional on the point estimate. However, the correction for effective number of parameters is lower (for no pooling and the hierarchical model, \(p_{\rm WAIC}\) is about half of \(p_{\rm DIC}\)), consistent with the theoretical behavior of WAIC when there is only a single data point per parameter, while for complete pooling, \(p_{\rm WAIC}\) is only a bit less than 1, roughly consistent with what we would expect from a sample size of 8. For all three models here, \(p_{\rm WAIC}\) is much less than \(p_{\rm DIC}\), with this difference arising from the fact that the lppd in WAIC is already accounting for much of the uncertainty arising from parameter estimation.

### Cross-validation

For this example it is impossible to cross-validate the no-pooling model as it would require the impossible task of obtaining a prediction from a held-out school given the other seven. This illustrates one main difference to information criteria, which assume new prediction for these same schools and thus work also in no-pooling model. For complete pooling and for the hierarchical model, we can perform leave-one-out cross-validation directly. In this model the local prediction of cross-validation is based only on the information coming from the other schools, while the local prediction in WAIC is based on the local observation as well as the information coming from the other schools. In both cases the prediction is for unknown future data, but the amount of information used is different and thus predictive performance estimates differ more when the hierarchical prior becomes more vague (with the difference going to infinity as the hierarchical prior becomes uninformative, to yield the no-pooling model). This example shows that it is important to consider which prediction task we are interested in and that it is not clear what *n* means in asymptotic results that feature terms such as *o*(*n*^{−1}).

### Comparing the three models

For this particular dataset, complete pooling wins the expected out-of-sample prediction competition. Typically it is best to estimate the hierarchical variance but, in this case, *τ*=0 is the best fit to the data, and this is reflected in the center column in Table 2, where the expected log predictive densities are higher than for no pooling or complete pooling.

That said, we still prefer the hierarchical model here, because we do not believe that *τ* is truly zero. For example, the estimated effect in school A is 28 (with a standard error of 15) and the estimate in school C is −3 (with a standard error of 16). This difference is not statistically significant and, indeed, the data are consistent with there being zero variation of effects between schools; nonetheless we would feel uncomfortable, for example, stating that the posterior probability is 0.5 that the effect in school C is larger than the effect in school A, given that data that show school A looking better. It might, however, be preferable to use a more informative prior distribution on *τ*, given that very large values are both substantively implausible and also contribute to some of the predictive uncertainty under this model.

In general, predictive accuracy measures are useful in parallel with posterior predictive checks to see if there are important patterns in the data that are not captured by each model. As with predictive checking, the log score can be computed in different ways for a hierarchical model depending on whether the parameters *θ* and replications *y*^{rep} correspond to estimates and replications of new data from the existing groups (as we have performed the calculations in the above example) or new groups (additional schools from the N(*μ*,*τ*^{2}) distribution in the above example).

## 7 Discussion

There are generally many options in setting up a model for any applied problem. Our usual approach is to start with a simple model that uses only some of the available information—for example, not using some possible predictors in a regression, fitting a normal model to discrete data, or ignoring evidence of unequal variances and fitting a simple equal-variance model. Once we have successfully fitted a simple model, we can check its fit to data and then alter or expand it as appropriate.

There are two typical scenarios in which models are compared. First, when a model is expanded, it is natural to compare the smaller to the larger model and assess what has been gained by expanding the model (or, conversely, if a model is simplified, to assess what was lost). This generalizes into the problem of comparing a set of nested models and judging how much complexity is necessary to fit the data.

In comparing nested models, the larger model typically has the advantage of making more sense and fitting the data better but the disadvantage of being more difficult to understand and compute. The key questions of model comparison are typically: (1) is the improvement in fit large enough to justify the additional difficulty in fitting, and (2) is the prior distribution on the additional parameters reasonable?

The second scenario of model comparison is between two or more nonnested models—neither model generalizes the other. One might compare regressions that use different sets of predictors to fit the same data, for example, modeling political behavior using information based on past voting results or on demographics. In these settings, we are typically not interested in *choosing* one of the models—it would be better, both in substantive and predictive terms, to construct a larger model that includes both as special cases, including both sets of predictors and also potential interactions in a larger regression, possibly with an informative prior distribution if needed to control the estimation of all the extra parameters. However, it can be useful to *compare* the fit of the different models, to see how either set of predictors performs when considered alone.

In any case, when evaluating models in this way, it is important to adjust for overfitting, especially when comparing models that vary greatly in their complexity, hence the value of the methods discussed in this article.

### 7.1 Evaluating predictive error comparisons

When comparing models in their predictive accuracy, two issues arise, which might be called statistical and practical significance. Lack of statistical significance arises from uncertainty in the estimates of comparative out-of-sample prediction accuracy and is ultimately associated with variation in individual prediction errors which manifests itself in averages for any finite dataset. Some asymptotic theory suggests that the sampling variance of any estimate of average prediction error will be of order 1, so that, roughly speaking, differences of less than 1 could typically be attributed to chance, but according to Ripley (1996), this asymptotic result does not necessarily hold for nonnested models. A practical estimate of related sampling uncertainty can be obtained by analyzing the variation in the expected log predictive densities \(\widehat{\rm elppd}_{i}\) using parametric or nonparametric approaches (Vehtari and Lampinen 2002).

Practical significance depends on the purposes to which a model will be used. Sometimes it may be possible to use an application-specific scoring function that is so familiar for subject-matter experts that they can interpret the practical significance of differences. For example, epidemiologists are used to looking at differences in area under receiver operating characteristic curve (AUC) for classification and survival models. In settings without such conventional measures, it is not always clear how to interpret the magnitude of a difference in log predictive probability when comparing two models. Is a difference of 2 important? 10? 100? One way to understand such differences is to calibrate based on simpler models (McCulloch 1989). For example, consider two models for a survey of *n* voters in an American election, with one model being completely empty (predicting *p*=0.5 for each voter to support either party) and the other correctly assigning probabilities of 0.4 and 0.6 (one way or another) to the voters. Setting aside uncertainties involved in fitting, the expected log predictive probability is log(0.5)=−0.693 per respondent for the first model and 0.6log(0.6)+0.4log(0.4)=−0.673 per respondent for the second model. The expected improvement in log predictive probability from fitting the better model is then 0.02*n*. So, for *n*=1000, this comes to an improvement of 20, but for *n*=10 the predictive improvement is only 2. This would seem to accord with intuition: going from 50/50 to 60/40 is a clear win in a large sample, but in a smaller predictive dataset the modeling benefit would be hard to see amid the noise.

In our studies of public opinion and epidemiology, we have seen cases where a model that is larger and better (in the sense of giving more reasonable predictions) does not appear dominant in the predictive comparisons. This can happen because the improvements are small on an absolute scale (for example, changing the predicted average response among a particular category of the population from 55 % Yes to 60 % Yes) and concentrated in only a few subsets of the population (those for which there is enough data so that a more complicated model yields noticeably different predictions). Average out-of-sample prediction error can be a useful measure but it does not tell the whole story of model fit.

### 7.2 Selection induced bias

Cross-validation and information criteria make a correction for using the data twice (in constructing the posterior and in model assessment) and obtain asymptotically unbiased estimates of predictive performance for a given model. However, when these methods are used for model selection, the predictive performance estimate of *the selected model* is biased due to the selection process (see references in Vehtari and Ojanen 2012).

If the number of compared models is small, the bias is small, but if the number of candidate models is very large (for example, the number of models grows exponentially as the number of observations *n* grows, or the number of covariates *p*≫ln(*n*) in covariate selection) a model selection procedure can strongly overfit the data. It is possible to estimate the selection induced bias and obtain unbiased estimates, for example by using another level of cross-validation. This does not, however, prevent the model selection procedure from possibly overfitting to the observations and consequently selecting models with suboptimal predictive performance. This is one reason we view cross-validation and information criteria as an approach for understanding fitted models rather than for choosing among them.

### 7.3 Challenges and conclusions

The current state of the art of measurement of predictive model fit remains unsatisfying. Formulas such as AIC, DIC, and WAIC fail in various examples: AIC does not work in settings with strong prior information, DIC gives nonsensical results when the posterior distribution is not well summarized by its mean, and WAIC relies on a data partition that would cause difficulties with structured models such as for spatial or network data. Cross-validation is appealing but can be computationally expensive and also is not always well defined in dependent data settings.

For these reasons, Bayesian statisticians do not always use predictive error comparisons in applied work, but we recognize that there are times when it can be useful to compare highly dissimilar models, and, for that purpose, predictive comparisons can make sense. In addition, measures of effective numbers of parameters are appealing tools for understanding statistical procedures, especially when considering models such as splines and Gaussian processes that have complicated dependence structures and thus no obvious formulas to summarize model complexity.

Thus we see the value of the methods described here, for all their flaws. Right now our preferred choice is cross-validation, with WAIC as a fast and computationally-convenient alternative. WAIC is fully Bayesian (using the posterior distribution rather than a point estimate), gives reasonable results in the examples we have considered here, and has a more-or-less explicit connection to cross-validation, as can be seen its formulation based on pointwise predictive density (Watanabe 2010; Vehtari and Ojanen 2012). A useful goal of future research would be a bridge between WAIC and cross-validation with much of the speed of the former and robustness of the latter.

## Acknowledgements

We thank two reviewers for helpful comments and the National Science Foundation, Institute of Education Sciences, and Academy of Finland (grant 218248) for partial support of this research.