Efficient leave-one-out cross-validation for Bayesian non-factorized normal and Student-t models

Paul-Christian Bürkner, Jonah Gabry, Aki VehtariComput. Stat 2021

TL;DR

This paper introduces efficient methods for calculating leave-one-out cross-validation (LOO-CV) for complex Bayesian models where the standard factorization assumption doesn't hold. This allows for more reliable model evaluation and comparison in a wider range of applications, particularly in spatial and temporal statistics.

What Problem Does This Paper Address?

Evaluating the predictive accuracy of statistical models is crucial for tasks like model comparison, averaging, and selection. A common technique is Leave-One-Out Cross-Validation (LOO-CV), where the model is trained on all data except one observation, and then used to predict that held-out observation. The average of these predictions gives a measure of predictive accuracy. However, standard LOO-CV relies on a "factorized" observation model, meaning the likelihood of all observations can be expressed as a product of individual observation likelihoods. Many important models, especially in time series and spatial statistics, have a multivariate normal or Student-t distribution for their observations, which often do not factorize neatly. This non-factorizability makes exact LOO-CV computationally infeasible (requiring refitting the model N times, where N is the number of observations) and can lead to unstable approximations. This paper tackles the challenge of efficiently computing LOO-CV for these non-factorized models.

Methods

The core contribution of this paper is the derivation of efficient analytical formulas for computing the pointwise log-likelihoods required for LOO-CV in non-factorized multivariate normal and Student-t models.

  • Exact LOO-CV for Non-Factorized Models: The paper provides a general approach to compute exact LOO-CV by treating the held-out observation as a missing value and estimating it along with other model parameters. This is computationally intensive but serves as a gold standard for validation.
  • Approximate LOO-CV (PSIS-LOO-CV): Building on existing work, the paper shows how the derived pointwise log-likelihoods can be used with Pareto-smoothed importance sampling (PSIS) to obtain a fast and robust approximate LOO-CV. This method requires only a single model fit.
  • Analytical Solutions for Normal and Student-t Distributions: The paper derives specific formulas for the conditional mean and variance of a single observation given all others, for both multivariate normal and multivariate Student-t distributions. These formulas avoid the need for repeated matrix inversions, which are computationally expensive.
  • Lagged SAR Models as a Case Study: The authors demonstrate their methods using lagged simultaneous autoregressive (SAR) models, a common type of spatial model that often exhibits non-factorizable likelihoods. They show how to re-express these models to fit the derived framework.

Datasets

The paper uses a dataset of neighborhood crime in Columbus, Ohio, for a case study. This dataset includes variables like crime rates, housing values, and household income, along with spatial relationship information. The data was originally described by Anselin (1988) and is available in the spdep R package.

Key Insights and Ideas

  • Factorization is Not Always Necessary (or Desirable): While standard LOO-CV assumes factorization, this paper shows that it's possible to perform LOO-CV even when this assumption is violated. Furthermore, for some models where factorization is possible, a non-factorized formulation can be more numerically stable and efficient.
  • Efficient Computation via Matrix Properties: The key to efficiency lies in leveraging properties of multivariate normal and Student-t distributions. By deriving formulas for conditional means and variances that rely on a single inversion of the full covariance matrix (or its inverse), the computational burden is significantly reduced compared to naive approaches.
  • Problematic Observations Highlight Model Issues: The Pareto-k diagnostic from PSIS-LOO-CV can identify observations that are highly influential or problematic for the model. This is not just a technical issue for LOO-CV; it can signal potential problems with the model's fit or assumptions for that specific data point.
  • Student-t Models Offer Robustness: In the case study, a Student-t SAR model proved more robust than a normal SAR model, particularly in handling a problematic observation that was identified by the Pareto-k diagnostic in the normal model. This suggests that fatter-tailed distributions can be beneficial when dealing with potential outliers or unusual data points.

Key Results

  • The paper provides efficient analytical formulas for computing exact and approximate LOO-CV for non-factorized multivariate normal and Student-t models.
  • The proposed methods are demonstrated on lagged SAR models.
  • In the case study, the PSIS-LOO-CV approximation for a normal SAR model identified one problematic observation. After addressing this observation (either by exact LOO-CV or a corrected approximation), the results became very close to the exact LOO-CV.
  • A Student-t SAR model showed similar predictive performance to the normal SAR model but handled the problematic observation more gracefully, with no observations flagged as problematic by the Pareto-k diagnostic. The ELPD difference between the two models was negligible.

Limitations and Future Work

  • Computational Cost: While the proposed methods are efficient compared to brute-force refitting, the exact LOO-CV for non-factorized models can still be computationally demanding, especially for large datasets. The approximate PSIS-LOO-CV is much faster but relies on the assumption that the PSIS approximation is valid.
  • Pareto-k Diagnostic Thresholds: The paper notes that while PSIS-LOO-CV is robust up to Pareto-k values of 0.7, higher values indicate potential issues with the approximation's accuracy. The authors suggest that for such problematic observations, exact LOO-CV might be necessary for those specific folds.
  • Future Work: The paper implicitly suggests that extending these methods to other non-factorized distributions or more complex model structures would be valuable. The case study also hints at the broader implications of identifying problematic observations for model diagnostics and understanding data-model relationships.

Summary updated

BibTeX
@inproceedings{burkner2021efficient,
  author = {Paul-Christian Bürkner and Jonah Gabry and Aki Vehtari},
  title = {{Efficient leave-one-out cross-validation for Bayesian non-factorized normal and Student-t models}},
  booktitle = {Comput. Stat},
  year = {2021},
  url = {https://openreview.net/forum?id=GJJpcAu1OO},
}
Figure