Recommendations for visual predictive checks in Bayesian workflow

Authors
Affiliation

Teemu Säilynoja

Aalto University

Andrew R. Johnson

Aalto University

Osvaldo A. Martin

Aalto University

Aki Vehtari

Aalto University

NoteAbstract
Introduction

A key step in the Bayesian workflow for model building is the graphical assessment of model predictions, whether these are drawn from the prior or posterior predictive distribution. The goal of these assessments is to identify whether the model is a reasonable (and ideally accurate) representation of the domain knowledge and/or observed data. There are many commonly used visual predictive checks which can be misleading if their implicit assumptions do not match the reality. Thus, there is a need for more guidance for selecting, interpreting, and diagnosing appropriate visualizations. As a visual predictive check itself can be viewed as a model fit to data, assessing when this model fails to represent the data is important for drawing well-informed conclusions.

Demonstration

We provide guidance for visual predictive checks for continuous and discrete, and mixed data. This includes diagnostics for identifying discrete components, estimating bounds, and assessing goodness-of-fit for density plots. We also offer recommendations for visual checks tailored to binary, ordinal, categorical, and count data.

Conclusion

We offer recommendations and diagnostic tools to mitigate ad-hoc decision-making in visual predictive checks. These contributions aim to improve the robustness and interpretability of Bayesian model criticism practices.

Materials

The source code implementing the visualization functions and probabilistic models, as well as extended case-studies and the data for the examples are provided online. The version of these materials used in this article is available in Zenodo, and the latest version at https://github.com/TeemuSailynoja/visual-predictive-checks/tree/main/code.

1 Introduction

Assessing the sensibility of model predictions and their fit to observations is a key part of most model building workflows. These assessments may reveal that the model predictions poorly represent (or replicate) the observed data, prompting the modeller to either improve their model, or adjust their confidence in the predictions accordingly. In this paper, we focus on examples rising from Bayesian workflows (Gabry et al. 2019; Gelman, Vehtari, et al. 2020), such as posterior predictive checking [PPC; Box (1980); Rubin (1984); Gelman et al. (1996); Gelman et al. (2013)], and visualizations of data, posterior, and posterior predictive distributions. Visualization of data distribution is useful even if we do not do any modeling. In Bayesian inference, the posterior distribution presents the uncertainty in the parameter values after conditioning on data, and the posterior predictive distribution presents the uncertainty in the predictions for new observations. The posterior inference is often performed using Monte Carlo methods (Štrumbelj et al. 2024), and posterior and posterior predictive distributions are then represented with draws from these distributions. In the same way as we visualize data distributions, we can visualize posterior and predictive distributions. In posterior predictive checking, we compare the data distribution to the posterior predictive distribution. The predictive distribution is not expected to coincide exactly with the observed data. For example, the posterior predictive distribution of a Bayesian model typically exhibits heavier tails than the true underlying data-generating distribution. Consequently, effective visual comparisons should focus on whether the predictive distribution is consistent with observed data rather than on exact agreement. If these distributions are not similar, the model is misspecified and we should consider improving the model. These visualizations are also applicable to prior predictive checking, where one might compare prior predictive samples to some reference values rising from domain knowledge (Wesner and Pomeranz 2021), and to cross-validation predictive checking where data are compared to cross-validation predictive distributions to avoid double use of data.

The purpose of this paper is to illustrate common issues in visual predictive checking, to provide better recommendations for different use cases, and to provide diagnostics to automatically warn if a useless or misleading visualization is used. Together we have decades of experience in teaching visual predictive checking and helping modellers use popular visual predictive checking tools such as those implemented in bayesplot (Gabry and Mahr (2024)) and ArviZ (Martin et al. (2026)). We have seen many times students and modellers use commonly recommended visualizations without realizing that, in their context, the specific visualization is incorrect, useless, or even misleading. Backed up with arguments from recent studies in uncertainty visualization, we provide a summary of methods we recommend. These methods are aimed to offer an informed basis for decision-making, be it for the modeller to improve on the model or for the end user to set expectations on the performance of the model.

The visualizations we discuss should be considered as broadly-applicable tools aimed to give insight into the overall goodness of model fit to the observations, as well as to possible deviations in certain parts of the predictive density. Most modeling workflows benefit from additional visualizations tailored to their specific use cases, as there is no general visual or numeric check that would reveal every aspect of the predictive capabilities of any given model. Some commonly-used methods for visualizing model predictions have risen from comparisons of continuous variables, and as such have varying degrees of usability for assessing predictions with discrete values. Some may not work with all continuous cases, in case of sharp upper or lower bounds in the set of possible values the prediction can take.

In Section 2, we inspect the common use of kernel density estimates (KDE), histograms and quantile dot plots in summarizing the predictive distribution and the observed data. In Section 3, we focus on predictive checks for binary data. We showcase tools that expand the visualizations beyond the typical bar graphs and binned calibration plots and instead allow for a more robust assessment of the calibration of the predictive probabilities. In Section 4 and Section 5, we show how the visual predictive checks described for binary predictions can be extended to discrete predictions with a small or medium number of individual cases. In Section 6, we discuss the use of visualizations assuming continuous data when the data and predictions are in reality discrete, but have a high number of unique values. We also discuss an alternate way of visualizing count data, when the number of cases is large, but still small enough for the modeller to be interested in attempting to assess the predictions as individual counts. Finally, in Section 7 we propose an automated goodness-of-fit test to alert the modeller of the presence of conflict between the data and the visualization done with KDEs, histograms or quantile dot plots.

The discussed methods and recommendations in this work have been implemented in the software packages bayesplot (Gabry and Mahr (2024)) and ArviZ (Martin et al. (2026)) to facilitate their use.

2 Visual predictive checks for continuous data

In this section, we consider visualizations for observations from a continuous or almost everywhere continuous distribution. We focus on three data visualizations; histograms, KDEs and quantile dot plots (Kay et al. 2016). The first two are the most commonly used visualizations for summarizing unidimensional distributions and there are common choices for initial visual predictive checks (VPCs) (Wickham (2016);Gabry and Mahr (2024); Martin et al. (2026); Kay (2024); Martin et al. (2025)). We see quantile dots plots as a useful alternative in many cases. Table 1 summarizes the main advantages and disadvantages of these three visualizations, and Figure 1 shows a side-by-side comparison of these visualizations. Histograms and KDEs are implemented in various commonly used software packages for data visualization.

A histogram with 30 equally spaced bins showing a sample from normal distribution.
(a) Histogram
A kernel density plot of a sample from normal distribution.
(b) KDE Density plot
A quantile dot plot of a sample from normal distribution. The plot shows 100 vertically stacked dots at the x-axis positions of their respective quantiles.
(c) Quantile dot plot
Figure 1: Three visualizations of the same sample from a smooth continuous distribution. a) Histogram with 30 equally spaced bins. b) Density plot using a Gaussian kernel and bandwidth 0.37 computed through the implementation of the method by Sheather and Jones (1991). c) Quantile dot plot with 100 quantiles as implemented in ggdist by Kay (2024).
Visualization Advantages Disadvantages
Histogram
  • Familiar to most users.
  • Can show discontinuities with right binning choice for the data.
  • Requires users to select bin width.
  • Challenges in comparing multiple histograms.
  • Artefacts with non-discrete valued distributions.
KDE plot
  • Familiar to most users.
  • Clear visual summary when sample adequately smooth.
  • Easy to overlay multiple plots for comparison.
  • Tendency to over smooth.
  • Challenges with discontinuities.
  • Boundaries need to be handled with care
  • Selected kernel bandwidth can greatly impact the visualization.
Quantile dot plot
  • Dot position adaptive to local smoothness of sample.
  • Easily quantifiable tail probability estimation.
  • Not familiar to most users.
  • If area fixed and dots are restricted to circles, the aspect ratio is locked, unless vertical space is added between dots.
  • Exceptions for discrete distributions need to be implemented.
Table 1: Summary of advantages and disadvantages of the three density visualizations discussed in the article.

Histogram

Here, we consider the most commonly used histograms, which are centered over the data, and where all of the bins have an equal width (see an example in Figure 1 (a)). These bin widths are either chosen by the modeller, or through a heuristic, such as the Freedman-Diaconis rule (Freedman and Diaconis 1981). Often, instead of choosing the bin width directly, the modeller inputs a desired amount of bins and an equal partitioning of the data range is computed with an adequate number of breaks.

KDE-based density plot

The most typical KDE-based density plot, often simply called a density plot, is a line or filled area representing a density approximation obtained through convolution of the data with some kernel function (see an example in Figure 1 (b)). Most commonly, a Gaussian kernel is used for the approximation, and a kernel bandwidth is selected through one of the widely used algorithms (Sheather and Jones 1991; Scott 1992; Silverman 1986). As the default implementation of the KDE plot in most visualization software packages is usually enough to produce aesthetically pleasing smooth summaries of the data, KDE plots are a very popular method of visually summarizing data.

Quantile dot plot

In a quantile dot plot (Kay et al. 2016), dots are used to represent a predefined number of quantiles, see an example in Figure 1 (c). This results in a visual density estimator with a low bias and high variance similar to that of a histogram (Wilkinson 1999). Kay et al. (2016) show that a quantile dot plot with one hundred quantiles performs very similarly to a KDE-based density plot for tasks of estimating probabilistic predictions from visualizations.

Advantages and disadvantages of the three visualizations

In Table 1 we have collected what we see as the main advantages and disadvantages of histograms, KDE density plots, and quantile dot plots for visualizing observations and assessing the quality of model predictions. Both the histogram and the KDE density plot have commonly recognized drawbacks, summarized by a trade-off between over and under smoothing.

The choice of bin width and breakpoints causes histograms to suffer from binning artefacts (Dimitriadis et al. 2021). Additionally, comparing the histogram of observations to multiple histograms visualizing predictive samples may be difficult.

Density plots from KDEs, as shown in Section 7.3, Section 7.4, and Section 7.5, have a tendency to either hide details such as discontinuities in the observation distribution if the chosen bandwidth is too large, or over-fit to the sample when the bandwidth is too small. When over-fitting, comparing multiple density plots may be difficult, as there is more variation on the estimate of the underlying distribution. These drawbacks are common in the standard implementations of KDE density plots. More specialized software often implement measures, such as automated boundary detection and less conservative bandwidth selection algorithms, to mitigate these issues (Martin et al. 2026; Kay 2024).

Quantile dot plots offer a low-overhead approach for visualizing distributions without requiring the specification of a binning scheme. Compared to KDEs, quantile dot plots have the added benefit of allowing for fast visual probability estimation in the tails of the distribution. In our experience, and as shown in Section 7.5 and Section 7.3 in case of discontinuities and outliers, quantile dot plots also offer a better visualization than KDEs and histograms. A potential drawback is their relative lack of familiarity among some audiences, however, this limitation is expected to become less of a problem as quantile-based visualizations become more widely adopted.

While histograms, KDEs, and quantile dot plots can each be useful in different settings, their effectiveness depends on how well the chosen visualization method, and their associated parameters, capture salient features of the data. In Section Section 7, we introduce a method for assessing the goodness of fit of these visualizations, allowing users to evaluate whether a given choice provides an adequate representation of the predictive distribution for their data, or whether alternative visualizations or parameter settings should be considered.

Visual predictive checking with overlaid plots

One common approach to comparing observed data with model predictions is to overlay visualizations of the data and of draws from the predictive distribution within the same plot. KDEs are typically used for this purpose, as multiple density curves can be easily distinguished when displayed together. The choice of bandwidth plays a critical role in such comparisons: a bandwidth that is too small can lead to highly variable estimates even for repeated draws from the same distribution, whereas an overly large bandwidth can oversmooth the densities and obscure important distributional features.

With histograms, and quantile dot plots, overlaid plots are rarely used, as the bin boundaries and dot locations depend on the model prediction and the resulting overlaid figure becomes difficult to read. A common solution for histograms, shown in Figure 2 (b) and later in Section 6, is to use a shared set of bins for the predictions and data, and to increase readability only show the predictions through per bin summary statistics, such as mean and quantile based intervals. A drawback with this approach is, that the per bin summaries don’t show dependency between the bins, making it harder to assess the global shape of the density. To compare multiple quantile dot plots to a reference plot, we propose overlaying the reference plot with just the top dots of each stack in the quantile dot plots of the predictive samples. Figure 2 (c) shows the resulting plot,which illustrates the variation in the overall form of the predictive distribution. Again, when summarizing the quantile dot plots of the predictive draws, we lose information on the dependency between heights of the stacks and the overall shape of the predictive density.

A line graph showing multiple KDEs. A dark blue line depicts the observations and multiple light blue lines represent draws predictive draws. The dark blue line lies within the variation presented by the light blue lines.
(a) KDE Overlay
A light blue histogram overlaid with dark blue point intervals. The heights of the histogram bins are within the intervals.
(b) Histogram Overlay
A dark blue quantile dot plot overlaid with multiple light blue dots. The light blue dots follow the shape of the tops of the dark blue dot plot, but show vertical and horizontal variation in the dot locations.
(c) Quantile dot plot overlay
Figure 2: Overlaid predictive checks. Observed data is showed in black and the predictive distribution draws in light blue. KDE plots can easily be overlaid and the resulting visualization is straightforward to read. The histogram for the data is overlaid with means and central 90% quantiles of the histogram bins of the posterior predictive draws, when using the binning from the histogram of the observation. For the quantile dot plot, the top dot of each stack of dots in each posterior draw is overlaid to the full quantile dot plot of the observation, visualizing the variation in the shape of the predictive distributions.

Overlaying facilitates comparisons by plotting model predictions and observed data on the same axes, allowing direct visual assessment. However, it can introduce overlap that may obscure information for the viewer, in particular for histograms and quantile dot plots as previously mentioned. Alternative strategies include juxtaposition, nested juxtaposition, and explicit encoding as mentioned by (Guo et al. 2025) and briefly discussed next.

In juxtaposition or nested juxtaposition, predictive draws and observed data are placed side by side or close together on aligned axes. This reduces overlap and can make local differences easier to detect, but it requires the viewer to mentally align distributions, which can be challenging.

Explicit encoding involves transforming the data and predictions, for example by computing summary statistics for each. This approach removes overlap entirely, representing the observed data (or domain knowledge) as points or lines and the predictive distribution as a single summary distribution, which highlights systematic discrepancies while abstracting from the full distribution Gabry et al. (2019).

Finally, faceting can be combined with any of these strategies to examine subsets of the data, for instance we may want to overlay plots per group in hierarchical models, or covariate in regression models.

Other predictive checking strategies for continuous data

Overlaid plots, particularly those based on KDEs, are generally easy to interpret, but they do not provide a quantitative measure of the differences between distributions. For a more formal assessment, we recommend using LOO-PIT-ECDF plots to diagnose calibration of pointwise predictive distributions, as discussed by Tesso and Vehtari (2026). Leave-one-out cross-validation (LOO-CV) avoids using the same observations for both fitting the model and assessing the predictive calibration. This is particularly important for flexible models and a small number of observations. If one were not to use cross-validation, the PIT values would tend to be too close to 0.5 and would not be close to uniform even for a well-calibrated model. For fast LOO-CV computation, we recommend using Pareto smoothed importance sampling (PSIS) (Vehtari et al. 2024). This method estimates the leave-one-out predictive distributions without the need for refitting the model for each left out observation. In the case of well-calibrated predictive distributions, LOO-PIT values are close to uniform but dependent. Tesso and Vehtari (2026) present uniformity tests that are efficient and works well for testing LOO-PIT uniformity. The approach also includes graphical diagnostics for the LOO-PIT-ECDF, indicating parts of the ECDF that mostly explain any non-uniformity to give insight into the nature of the possible issues in model fit.

So far, the methods discussed provide global assessments, like detection of over or underdispersion. Thus these methods are often complemented with evaluations conditional on individual predictors. Residual-based diagnostics play an important role in this context, as residual plots are commonly used to assess systematic deviations between observations and model predictions across covariate values, identify heteroscedasticity, and revealing local model misspecification that may not be apparent in marginal or aggregate checks (Gelman, Hill, et al. 2020; Gelman et al. 2013; Agresti 2013). Residual-based diagnostics are widely used and well understood for continuous data, so we do not discuss them further here, but we will discuss them in the next section in the context of binary data, where computation of residuals is not that straightforward.

3 Visual predictive checks for binary data

In this section, we focus on predictive checking when working with binary observations. Assessing the calibration of binary predictions is a common task made difficult by the discreteness of the observed outcome. Below, we walk through two usual approaches, and introduce an alternative offered by PAV-adjusted calibration plots (Dimitriadis et al. 2021). The three discussed methods are summarized in Figure 3.

A bar plot of observed counts of 100 zeros and 160 ones. Overlaid on the barplot are vertical point intervals of the expectations and credble intervals of the predicted counts. Both predictive means deviate from the observed counts, but the bars are within the credible intervals.
(a) Bar graph
A binned calibration plot. x and y axes ranging from 0 to 1 with predicted probability on x and observed relative event rate on y axis. Between x = 0.5 and x = 0.9, the plot shows 7 equally spaced vertical point intervals. The first point interval is completely below a diagonal y=x reference line.
(b) Binned calibration plot
PAV-adjusted calibration plot. x and y axes ranging from 0 to 1 with predicted probability on the x axis and conditional event probability on the y axis. A diagonal dashed reference line for y = x is shown. The plot shows a red stepped calibration line overlaid on a light blue consistency ribbon. A quantile dot plot of the predicted probabilities is shown on the x axis. The calibration line starts from y = 0 at x = 0.25 and reaches the right top corner. At x = 0.6, the calibration line is briefly outside the consistency ribbon. The quantile dot plot shows that 90% of the predicted probabilities are between 0.5 and 0.9.
(c) PAV-adjusted calibration plot
Figure 3: Calibration of estimated probability of observing a non-zero number of roaches. (a) & (b) commonly used bar and binned calibration plots, (c) the PAV-adjusted calibration plot, with 95% consistency bands computed from predictive samples.

We use the roaches example, which focuses on estimating the effect of integrated pest management on cockroach levels in urban apartments (Gelman, Hill, et al. 2020). We consider three models for predicting if one or more roaches will be observed:

  1. An intercept-only model estimating the overall probability of observing one or more roaches,
  2. A negative binomial regression model.
  3. A zero-inflated version of Model 2 using the covariates to additionally model the probability of not observing any roaches.

Bar graphs

A bar graph consists of bars representing the frequencies of the observed values, and point intervals of the predictive means and central quantiles. These elements are positioned over each state of the observation distribution. Figure 4 shows bar graphs summarizing the predictions of the intercept-only and negative binomial models for predicting the binary outcome of observing one or more roaches. Both bar graphs show the model predictions agreeing with the observations, and no clear difference in the predictions of the models can be seen.

A bar plot of observed counts of 0 and 1 events. Overlaid are vertival point intervals of the predictive expectations and credible intervals of the event counts. The predictive means are at the same height as the bars for the observed counts.

Intercept-only model

A bar plot of observed counts of 0 and 1 events. Overlaid are vertival point intervals of the predictive expectations and credible intervals of the event counts. The predictive means deviate from the observed counts, but both bars are within the credible intervals.

Negative binomial model
Figure 4: We cannot see a difference in the predictive performance of the two models from the bar graphs. For both models, the observed event frequency falls within the 95% credible interval with the mean predicted frequency of the intercept only model aligning exactly with the observation. Bar plots are almost always useless for predictive checking in case of binary data.

Bar graphs are a common choice when summarizing discrete binary, categorical, or ordinal data and predictions, but they are not that useful for visual predictive checking. In the extreme case of binary data, even a model with one parameter corresponding to the proportion of one class, can perfectly model the proportion, and the overlaid posterior predictive checking bar plots are useless (and KDE plots are even worse with misleading smoothing). Additionally, as shown in Figure 4 and Figure 5 below, any assessment that is more advanced than inspecting the relative frequencies of the discrete states, is impossible with the bar graphs. For example, under- and overconfidence, and symmetric confusion between states, is not visible in a graph, for that we recommend calibration plots over bar graphs.

Calibration plots for binary data

A calibration plot is a graphical tool for assessing the agreement between predicted probabilities and observed frequencies in probabilistic prediction tasks. Calibration plots can be used for any type of data. For binary data, however, calibration cannot be evaluated at the level of individual observations: each prediction is associated with a single binary outcome, and the true event probability must be inferred by pooling observations with comparable predicted probabilities.

One approach to deal with binary data is the use of binned calibration plots (Niculescu-Mizil and Caruana 2005), also called calibration curves or reliability diagrams (DeGroot and Fienberg 1983). In these visualizations, the binary observations are divided into a predetermined number of uniform bins, based on the event probabilities predicted by the model. Comparing the mean predicted probability to the observed event rate within each bin allows assessing the calibration, or reliability, of the model. Typically, binned calibration plots include binomial confidence intervals of the observed event rates.

Figure 5 shows the binned calibration plots for the predictive distributions visualized previously through bar graphs. It is immediately clear that even though the probabilities predicted by the intercept-only model are calibrated, the model has no ability to discriminate between the cases where one is more or less likely to observe roaches. We can also see, that although the negative binomial model is better at discriminating the cases, it suffers from calibration issues and is especially under-confident at predicting cases where no roaches will be observed.

Binned calibration plot. Only a single vertical point interval is displayed. The interval is relatively narrow and centered on the diagonal reference line.

Intercept-only model

A binned calibration plot. Between x = 0.5 and x = 0.9, the plot shows 7 equally spaced vertical point intervals. The first point interval is completely below a diagonal y=x reference line.

Negative binomial model
Figure 5: The intercept only model has no ability to discriminate between the observations, while the negative binomial model can recognize cases where we are more likely to observe roaches. Still, the negative binomial model the model is under-confident in predicting cases of no roaches observed.

While potentially useful, binned calibration plots suffer from drawbacks similar to those of histograms: the choice of binning is left to the user and can cause the resulting plots to differ substantially, as shown by (Dimitriadis et al. 2021). For that reason in the next section we discuss an alternative method that does not require binning decisions from the user and thus provides a much robust alternative to be used as the default method for visual predictive checking when working with binary data.

PAV-adjusted calibration plots

The ad-hoc binning decision has the potential to play a major role in the conclusions drawn from binned calibration plots. To address this, Dimitriadis et al. (2021) propose a method where the observed binary events are replaced with conditional event probabilities (CEP), that is the probability that a certain event occurs given that the classifier has assigned a specific predicted probability. To compute the CEPs, the authors use the pool adjacent violators (PAV) algorithm (Ayer et al. 1955), which provides a non-parametric maximum likelihood solution to the problem of assigning CEPs that are monotonic with respect to the model predictions. This monotonicity assumption is reasonable for calibrated models, where higher predicted probabilities should correspond to higher actual event probabilities.

To aid in the calibration assessment, we employ the point-wise consistency bands introduced by (Dimitriadis et al. 2021). These intervals show, how much variation should be expected from the calibration plot even if the model was perfectly calibrated.

Figure 6 shows this PAV-adjusted calibration plot with 95% point-wise consistency bands computed from the posterior predictive distribution. First, we compute the CEPs using the posterior predictive means for each observation. Then we form the consistency bands by using the corresponding posterior predictive draws to determine the 95% credible intervals for CEPs of draws from the predictive distribution. With flexible models, we recommend the use of LOO predictive distributions to assess the calibration of the ou-of-sample predictions.

PAV-adjusted calibration plot. The red calibration line starts from y = 0 at x = 0.25 and reaches the right top corner. At x = 0.6, the calibration line is briefly outside the consistency ribbon. The quantile dot plot shows that 90% of the predicted probabilities are between 0.5 and 0.9.

Negative binomial model

PAV-adjusted calibration plot. The red calibration line starts from y = 0 at x = 0.1 and reaches the right top corner. The calibration line stays within the consistency ribbon. The quantile dot plot shows that the predictions are quite evenly spread along the x-axis.

Zero-inflated model
Figure 6: Comparison of two models for predicting if roaches will be observed. As noted before, the negative binomial model is under confident when predicting cases where no roaches are observed. In the PAV-adjusted calibration plot of the zero-inflated negative binomial model, we see the calibration curve staying within the consistency bands, and also observe a wider range of predicted event probabilities. Together these two qualities indicate the zero-inflated model to be better calibrated and additionally have higher ability to discriminate the observations with no roaches.

Residual plots

While PAV-adjusted calibration plots are useful for assessing the overall predictive calibration of a model, practitioners are often also interested in model behavior conditional on individual predictors. As discussed for continuous data, residual plots are commonly used to assess deviations between observations and predictions. While residuals are straightforward to compute and visualize for continuous outcomes, this is more challenging for binary data.

To compute the residuals we can use binning to transform discrete outcomes into relative event frequencies, enabling residual-like diagnostics in this setting. But as already discussed ad-hoc choices of binning may result in vastly different plots, and thus we propose the use of PAV-adjusted CEPs, computed with regards to the predicted probabilities, in place of the discrete observations. Figure 7 shows an example of a PAV-adjusted residual plot for the roaches example.

Two graphs, on the left a binned residual plot. On the right, PAV-adjusted residual plot. The binned residual plot shows the binned average prediction errors versus the baseline roach count through 9 vertical point intervals. At zero the point showing the average error is negative and outside the confiidence interval, at 70 baseline roache count, the average error is positive and much higher than the upper limit of the confidence interval. The PAV-adjusted residual plot shows a schatterplot of the per observation difference between the CEP and the prediction. Overlaid is a consistency ribbon and observations outside the ribbon are highlighted in red. Again, for low roach counts the residuals are below the ribbon and  for low to mid level counts, some residuals are above the consistency ribbon.

Two graphs, on the left a binned residual plot. On the right, PAV-adjusted residual plot. At 70 baseline roaches, the average error is positive and much higher than the upper limit of the confidence interval. In the PAV-adjusted residual plot, only one observation is highlighted red. Otherwise, the residuals are within the consistency bands.

Figure 7: Residual plots of the two models against the baseline roach count observed at the start of the study. The binned calibration plots on the left are commonly used, while the PAV-adjusted residuals on the right offer a non-parametric alternative that doesn’t require a binning choice. Here, we use the consistency bands of the PAV-adjusted calibration plot in Figure 6 and highlight the observations falling outside these intervals. From both visualizations, one can see the tendency of the simpler model without zero-inflation to overestimate the probability of observing roaches, when the baseline roach count is very low, as well as the tendency of overestimating the probability of observing roaches after the treatment in low to medium baseline counts.

4 Visual predictive checks for categorical data

When the number of categories is relatively low, the methods presented for the binary case in Section 3 extend to the categorical case. In the same way as for binary data, even the simplest model is likely to have such parameters that the predictive probabilities match the observed frequencies and bar plots are useless. However, we can use the calibration of the binomial one-versus-others (OVO) distributions for each of the categorical cases. With a large number of categories, investigating one plot for each OVO calibration can be unwieldy, but scalar summaries of miscalibration for each category could be used to filter the set of individual cases before graphical inspection.

Figure 8 shows a predictive check using bar graphs for a predictive model with three distinct categories. Figure 9 shows both binned and PAV-adjusted calibration plots for the same model. No immediate calibration issues are visible for the model when predicting category A, but one can also see that cases, where the model would estimate the probability of any single category to be larger than 0.7 are rare – only one to three quantile dots are at values larger than 0.7. Additionally, both plots types show that the model confuses classes B and C, and is over confident in its predictions concerning these classes.

A bar graph showing the proportion of three classes: A, B, and C. Overlaid is the poin interval for the proportion of predicted classifications, showing the predictive mean and a credible interval. The observed proportions are very close to the predictive means.
Figure 8: A bar graph of the observed counts overlaid with posterior predictive means and 95% credible intervals. As in the earlier examples of using bar charts, everything seems to be in order with the model predictions.

A binned calibration plot titled A versus others. The graph shows predicted probabilities binned to 9 equally spaced bins with wide credible intervals for the last 2 bins, at x = 0.75 and x = 0.9. All intervals overlap the diagonal reference line.

A PAV-adjusted calibration plot titled A versus others. The red calibration line is fully inside the blue consistency bands, and the quantile dot plot shows that most predicted probabilities fall between 0 and 0.6.

A binned calibration plot titled B versus others. The graph shows predicted probabilities binned to 10 equally spaced bins between 0 and 1. The credible intervals of the 2 rightmost bins are wide. The second point interval, at x = 0.15, is fully above the diagonal reference line, while the 7th and 8th are below it.

A PAV-adjusted calibration plot titled B versus others. The red calibration line has a pronunced step, where the line overshoots the blue consistency bands at small predicted probabilities and dips under the bands between x = 0.5 and x = 0.75. The quantile dot plot shows that most predicted probabilities fall between 0 and 0.6.

A binned calibration plot titled C versus others. The graph shows predicted probabilities binned to 9 equally spaced bins between 0 and 0.9. The credible interval of the rightmost bin is wide. The first two point intervals, are fully above the diagonal reference line, while the last lies below it.

A PAV-adjusted calibration plot titled C versus others. The red calibration line has a pronunced step, where the line overshoots the blue consistency bands at small predicted probabilities and repeatedly dips under the bands between x = 0.5 and x = 0.9. The quantile dot plot shows that most predicted probabilities fall between 0 and 0.6.

Figure 9: Comparison between binned calibration plots and PAV-adjusted calibration plots for one versus others comparisons. We see that the predictions are well calibrated for class A, but the model seems to be confusing observations of classes B and C. The sharp rises at the extreme predictions indicate that the model is over-confident in its predicted probabilities for these classes.

5 Visual predictive checks for ordinal data

Models for ordinal data often have such parameters that predictive probabilities of even the simplest model match the observed frequencies, which renders bar plots useless (KDE plots are even worse with misleading smoothing). In the case of ordinal predictions, instead of looking at the OVO distributions, a natural approach is to assess the calibration of the cumulative conditional event probabilities. This allows us to again use the toolset presented for binomial predictive checks in Section 3, now resulting in M-1 plots, where M is the number of possible distinct discrete cases.

Figure 11 shows a PPC using bar graphs for two models without any sign of calibration issues in either predictive distribution. Figure 12 shows the PAV-adjusted calibration plots for each cumulative event probability. The diagrams for model 1 on the left show a calibration issue, with the calibration curves exhibiting an S-shape, indicative of under confidence in predicted probabilities.

A line graph with 5 lines numbered from 1 to 5. x-axis ranges form 0 to 6 and the y-axis, titled proportion, ranges from 0 to 1. Lines 2, 3, and 4 form three consecutive distinct modes at x=2,3,and 4 respectively. Lines 1 and 5 obtain values close to 1 at the respective ends of the 0 to 6 interval. Between the modes, the two adjacent lines share most of the displayed proportion.
Figure 10: True proportions of the five possible values given value of the covariate x.
Two bar graphs, titled model 1 and model 2, showing the observed counts of five distinct classes. The counts are fairly even and overlaid on top of them are predictive means and credible intervals of the counts of observations calssified to each category. The observation for class 2 is barely outside the credible interval for model 1 and jsut inside the respective interval for model 2. Other observations are withing their credible intervals.
Figure 11: Again, the bar graph doesn’t indicate meaningful difference between the predictive distributions.

A PAV-adjusted calibration plot. The red calibration curve exhibits an S-shape, leavind the consistency interval away from x = 0.5. The quantile dot plot shows that roughly 80% of the predicted probabilities are close to 0, while the rest are evenly spread between 0 and 0.9.