Testing goodness-of-fit and conditional independence with approximate co-sufficient sampling

Rina Foygel Barber, Lucas Janson

Abstract

Goodness-of-fit (GoF) testing is a cornerstone of statistical inference, yet testing composite null hypotheses remains challenging due to the need for test statistics with tractable distributions across the entire parameter space. Co-sufficient sampling (CSS) provides a solution by conditioning on sufficient statistics, but its applicability is limited to a narrow class of models. This paper introduces Approximate Co-Sufficient Sampling (aCSS), leveraging approximate sufficiency to extend valid GoF testing to nearly any parametric model with an asymptotically efficient estimator. We demonstrate that aCSS maintains valid Type I error control for any choice of test statistic, with inflation vanishing under standard maximum likelihood asymptotics.

Introduction

A fundamental challenge in statistics is determining whether a dataset follows a proposed model, a task known as Goodness-of-Fit (GoF) testing. While simple null hypotheses are easily tested, most practical applications involve composite nulls with unknown nuisance parameters. Traditional approaches often require the test statistic to have a known distribution regardless of the parameter values, which severely limits the choice of statistics.

Co-Sufficient Sampling (CSS) offers a theoretically elegant alternative: by conditioning the data on a sufficient statistic, the remaining randomness becomes parameter-independent. This allows for the generation of "null" data copies to which the observed data can be compared. However, CSS is often "degenerate" in complex models—like logistic regression with continuous predictors—where the only sufficient statistic is the data itself, leaving no room for resampling.

The aCSS Framework

To address the limitations of exact CSS, we propose Approximate Co-Sufficient Sampling (aCSS). The core innovation is conditioning on an approximately sufficient statistic, specifically a noisy version of the Maximum Likelihood Estimator (MLE).

The aCSS procedure involves:

  1. Noisy Estimation: Calculating the MLE and adding a small amount of Gaussian noise ($\sigma$).
  2. Conditional Sampling: Generating synthetic data copies from the distribution of the data conditioned on this noisy estimator.
  3. Inference: Comparing a user-defined test statistic $T(X)$ from the observed data against the distribution of $T$ from the synthetic copies to derive a p-value.

This conditioning step is the key differentiator from the standard parametric bootstrap. While the bootstrap simply "plugs in" estimated parameters, aCSS uses conditioning to ensure the test remains valid even when using highly customized or "black-box" test statistics.

Results and Discussion

The validity of aCSS is supported by both theoretical proofs and extensive simulations. The authors prove that the distance to exchangeability—and thus the Type I error inflation—vanishes as the sample size $n$ grows.

In simulations across various models, including logistic regression and multivariate t-distributions, aCSS consistently outperformed traditional methods in terms of flexibility and reliability. A key finding is the comparison of p-value distributions under the null hypothesis. As shown below, the standard parametric bootstrap can lead to significant p-value distortion, resulting in inflated false-positive rates. In contrast, conditioning-based methods like CSS (and the proposed aCSS) maintain the uniform distribution required for valid testing.

Comparison of p-value distributions under the null hypothesis. The parametric bootstrap (left) shows significant distortion, while co-sufficient sampling (right) maintains a uniform distribution.

This flexibility allows researchers to use domain-specific test statistics to detect particular types of model departures without the burden of deriving their null distributions analytically.

Conclusion

Approximate Co-Sufficient Sampling provides a robust and flexible framework for goodness-of-fit testing in a wide array of parametric models. By bridging the gap between exact sufficiency and practical estimation, aCSS allows for the use of arbitrary test statistics while maintaining rigorous error control. Future research will focus on improving the computational efficiency of the required MCMC sampling and extending the theoretical guarantees to high-dimensional settings.

Summary updated

Abstract

Goodness-of-fit (GoF) testing is ubiquitous in statistics, with direct ties to model selection, confidence interval construction, conditional independence testing, and multiple testing, just to name a few applications. While testing the GoF of a simple (point) null hypothesis provides an analyst great flexibility in the choice of test statistic while still ensuring validity, most GoF tests for composite null hypotheses are far more constrained, as the test statistic must have a tractable distribution over the entire null model space. A notable exception is co-sufficient sampling (CSS): resampling the data conditional on a sufficient statistic for the null model guarantees valid GoF testing using any test statistic the analyst chooses. But CSS testing requires the null model to have a compact (in an information-theoretic sense) sufficient statistic, which only holds for a very limited class of models; even for a null model as simple as logistic regression, CSS testing is powerless. In this paper, we leverage the concept of approximate sufficiency to generalize CSS testing to essentially any parametric model with an asymptotically efficient estimator; we call our extension “approximate CSS” (aCSS) testing. We quantify the finite-sample Type I error inflation of aCSS testing and show that it is vanishing under standard maximum likelihood asymptotics, for any choice of test statistic. We apply our proposed procedure both theoretically and in simulation to a number of models of interest to demonstrate its finite-sample Type I error and power.
BibTeX
@article{barber2022testing,
  author = {Rina Foygel Barber and Lucas Janson},
  title = {{Testing goodness-of-fit and conditional independence with approximate co-sufficient sampling}},
  journal = {The Annals of Statistics},
  year = {2022},
  doi = {10.1214/22-aos2187},
}
Figure