Table of Contents
Fetching ...

Plotting correlated data

Lukas Koch

TL;DR

The paper addresses the misinterpretation risk when plotting correlated uncertainties using only marginal error bars. It advocates embedding correlation information directly into plots through full correlation matrices, correlation lines between neighboring data points, principal component analysis to highlight dominant covariance directions, and conditional uncertainties to reveal intrinsic variance under fixed others, all with specified formulas such as $C = \sum_i \lambda_i \bm{u}_i \bm{u}_i^T$ and $K = C - s^2 \lambda_1 \bm{u}_1 \bm{u}_1^T$ and $\mathrm{Var}[y_i|y_j] = \sigma_i^2(1-\rho_{ij}^2)$. The proposed methods improve model-data assessment under correlation, provide actionable visualization strategies (including Hinton diagrams for accessibility), and are implemented in the NuStatTools package for practical use. These contributions offer a more faithful representation of uncertainty structure and help identify model deficiencies arising from correlated errors. The work has practical impact for high-stakes data analyses where off-diagonal covariances significantly influence inference and decision-making.

Abstract

A very common task in data visualization is to plot many data points with some measured y-value as a function of fixed x-values. Uncertainties on the y-values are typically presented as vertical error bars that represent either a Frequentist confidence interval or Bayesian credible interval for each data point. Most of the time, these error bars represent a 68\% confidence/credibility level, which leads to the intuition that a model fits the data reasonably well if its prediction lies within the error bars of roughly two thirds of the data points. Unfortunately, this and other intuitions no longer work when the uncertainties of the data points are correlated. If the error bars only show the square root of diagonal elements of some covariance matrix with non-negligible off-diagonal elements, we simply do not have enough information in the plot to judge whether a drawn model line agrees well with the data or not. In this paper we will demonstrate this problem and discuss ways to add more information to the plots to make it easier to judge the agreement between the data and some model prediction in the plot, as well as glean some insight where the model might be deficient. This is done by explicitly showing the contribution of the first principal component of the uncertainties, and by displaying the conditional uncertainties of all data points.

Plotting correlated data

TL;DR

The paper addresses the misinterpretation risk when plotting correlated uncertainties using only marginal error bars. It advocates embedding correlation information directly into plots through full correlation matrices, correlation lines between neighboring data points, principal component analysis to highlight dominant covariance directions, and conditional uncertainties to reveal intrinsic variance under fixed others, all with specified formulas such as and and . The proposed methods improve model-data assessment under correlation, provide actionable visualization strategies (including Hinton diagrams for accessibility), and are implemented in the NuStatTools package for practical use. These contributions offer a more faithful representation of uncertainty structure and help identify model deficiencies arising from correlated errors. The work has practical impact for high-stakes data analyses where off-diagonal covariances significantly influence inference and decision-making.

Abstract

A very common task in data visualization is to plot many data points with some measured y-value as a function of fixed x-values. Uncertainties on the y-values are typically presented as vertical error bars that represent either a Frequentist confidence interval or Bayesian credible interval for each data point. Most of the time, these error bars represent a 68\% confidence/credibility level, which leads to the intuition that a model fits the data reasonably well if its prediction lies within the error bars of roughly two thirds of the data points. Unfortunately, this and other intuitions no longer work when the uncertainties of the data points are correlated. If the error bars only show the square root of diagonal elements of some covariance matrix with non-negligible off-diagonal elements, we simply do not have enough information in the plot to judge whether a drawn model line agrees well with the data or not. In this paper we will demonstrate this problem and discuss ways to add more information to the plots to make it easier to judge the agreement between the data and some model prediction in the plot, as well as glean some insight where the model might be deficient. This is done by explicitly showing the contribution of the first principal component of the uncertainties, and by displaying the conditional uncertainties of all data points.
Paper Structure (9 sections, 6 equations, 9 figures)

This paper contains 9 sections, 6 equations, 9 figures.

Figures (9)

  • Figure 1: Some correlated data as it is usually presented. The vertical error bars represent the square root of the diagonals of the covariance matrix. Without any additional context, the model prediction M2 looks like it is describing the data much better than the model prediction M1. Only a look at the actual squared M-distances and degrees of freedom in the legend reveals that M2 describes the data much worse.
  • Figure 2: Examples of colour maps used to plot correlation matrices and their names in the Matplotlib libraryMDT2025. Divergent maps like \ref{['fig:coolwarm']} show a clear distinction between positive and negative values, but they do not work without the colour information \ref{['fig:coolwarm-gray']}. Perceptually uniform sequential colour maps like \ref{['fig:cividis']} and \ref{['fig:gray']} work well even in monochrome, but they make it harder to distinguish small positive from small negative values. The correlation matrix is taken from the $\delta p_T$ result in Abe2018Abe2018e.
  • Figure 3: Examples of Hinton plots and the names of the used colour maps in the Matplotlib libraryMDT2025. In these, the absolute value of the matrix elements is reflected as the area of the circles, while the colour of the circles represents the sign of the value. Positive values are easily distinguishable from negative values even for small absolute values and a complete lack of colour information. The correlation matrix is taken from the $\delta p_T$ result in Abe2018Abe2018e.
  • Figure 4: The example data with error bars representing the square root of the diagonal elements of the covariance matrix together with its correlation matrix. The strong correlations visible in the matrix explain the very bad performance of the model M2. This combination of plots contains all the information available about the uncertainties, but it is inconvenient that it is spread over two separate plots. Especially with larger number of data points, it can get difficult to interpret the correlation matrix in terms of what it means for the allowed variations in the data plot.
  • Figure 5:
  • ...and 4 more figures