Model-X Sequential Testing for Conditional Independence via Testing by Betting

Shalev ShaerAISTAT 2026

TL;DR

This paper introduces e-CRT, a novel sequential test for conditional independence that allows for online data analysis and early stopping, while rigorously controlling Type I errors. It combines the strengths of model-X conditional randomization tests and betting-based hypothesis testing, offering a powerful and flexible tool for analyzing streaming data.

What Problem Does This Paper Address?

In many real-world scenarios, data arrives sequentially (e.g., in clinical trials, online learning, or financial markets). Researchers are often interested in determining if a particular feature is conditionally independent of a response variable, given other covariates. Traditional statistical tests for conditional independence (CI) are typically "offline," meaning they require all data to be collected before analysis. Applying these offline tests naively to a data stream by repeatedly checking p-values leads to an inflated Type I error rate (falsely concluding a feature is important when it's not). The challenge is to develop a sequential testing procedure that can analyze data as it arrives, stop data collection as soon as a significant result is detected, and crucially, maintain strict control over the Type I error rate at any stopping time. This is essential for efficiency and avoiding unnecessary data collection costs.

Methods

The proposed method, e-CRT, is built upon two key statistical frameworks:

  • Model-X Conditional Randomization Test (CRT): This offline test for CI is powerful because it makes minimal assumptions about the relationship between the response and covariates. It works by generating "dummy" features that are conditionally independent of the response by construction and comparing the statistical properties of the original features to these dummies. The "model-X" aspect means it assumes the distribution of the features (X) given the covariates (Z), denoted $P_{X|Z}$, is known or can be well-approximated.
  • Testing by Betting: This is a "game-theoretic" approach to sequential hypothesis testing. It frames hypothesis testing as a game where a player starts with "toy money" and places bets against the null hypothesis. The player's wealth (a "test martingale") increases if their bets are correct and decreases if they are wrong. If the wealth reaches a certain threshold (related to the significance level $\alpha$), the null hypothesis is rejected. This framework naturally supports early stopping and provides a rigorous way to control Type I errors.

e-CRT combines these by:

  1. Generating dummy features: Similar to CRT, it generates dummy features $\tilde{X}_t$ from the assumed $P_{X|Z}$ distribution.
  2. Betting score: It computes a "betting score" $W_t$ based on the difference between a test statistic evaluated on the original data $(X_t, Y_t, Z_t)$ and the dummy data $(\tilde{X}_t, Y_t, Z_t)$. This score is designed to be positive on average when the null hypothesis is false and zero on average when the null is true.
  3. Test Martingale: The betting scores are used to update a "wealth process" or test martingale $S_t$. This martingale is designed to grow when evidence against the null hypothesis accumulates.
  4. Mixture Method: To improve robustness and power, e-CRT uses a "mixture method" where it averages over multiple base martingales, each corresponding to a different betting strategy (i.e., different amounts of toy money risked). This is inspired by universal portfolio strategies.
  5. Online Learning: The predictive model used to compute the test statistic is updated online using machine learning algorithms, allowing the test to adapt to the incoming data stream efficiently.
  6. De-randomization: To reduce the randomness introduced by generating single dummy features, the method averages betting scores from multiple independent dummy features.

Datasets

The paper uses the following datasets:

  • Synthetic Data: Generated to evaluate the performance of e-CRT under controlled conditions, including scenarios with known and unknown conditional distributions, varying numbers of covariates, and different correlation structures.
  • Real-World Data:
    • Fund Replication Data: Daily log returns of stocks in the S&P 500 and a technology sector index fund (XLK). This data is used to identify stocks contributing to index fund performance.
  • HIV Drug Resistance Data: Genetic mutation data for HIV type-I and associated drug resistance levels. This is used to detect mutations associated with resistance to the Lopinavir protease inhibitor.

Key Insights and Ideas

  • Bridging Offline and Online CI Testing: The core innovation is successfully adapting the powerful, assumption-light model-X CRT to the online setting using the game-theoretic framework of testing by betting. This allows for early stopping without sacrificing Type I error control.
  • Betting as a Sequential Decision Rule: The "testing by betting" framework provides an intuitive and mathematically sound way to aggregate evidence sequentially. The wealth process naturally captures the accumulation of evidence against the null.
  • Mixture Method for Robustness and Power: Averaging over different betting strategies (represented by the parameter $v$) significantly improves the test's performance, making it less sensitive to the choice of a single strategy and generally more powerful.
  • Online Learning for Efficiency: Integrating online learning for the predictive model allows the test to adapt to the data stream efficiently, avoiding the need to retrain models from scratch on the entire dataset at each step.
  • De-randomization Improves Power: Using multiple dummy features and averaging their betting scores demonstrably increases the power of the test, making it more likely to detect true associations.

Key Results

  • Type I Error Control: e-CRT rigorously controls the Type I error rate at any desired level $\alpha$ for any stopping time, as demonstrated in synthetic experiments and illustrated by the flat Type I error curves in Figure 2 (left) and Figure 5(c).
  • Empirical Power: e-CRT shows competitive or superior empirical power compared to existing sequential methods (like ADDIS-CRT/HRT) and offline methods (CRT/HRT) when the sample size grows. For instance, in Figure 2 (middle), e-CRT outperforms ADDIS methods for all $t$ and catches up to offline methods for larger sample sizes.
  • Early Stopping Advantage: e-CRT tends to reject the null hypothesis earlier than other sequential methods (e.g., ADDIS-CRT), as shown by the histogram of stopping times in Figure 2 (right), indicating better sample efficiency.
  • Real-World Applicability: The method successfully identified important stocks in index funds and mutations associated with HIV drug resistance, demonstrating its practical utility. In the fund replication task, e-CRT correctly identified stocks within the technology sector and avoided flagging those outside it, often with early stopping. Similarly, for HIV mutations, it correctly identified those with known major or accessory effects on drug resistance.
  • Robustness: Experiments show that e-CRT is reasonably robust to errors in estimating $P_{X|Z}$, especially when more data is used for initial training.

Limitations and Future Work

  • Assumption of $P_{X|Z}$: The model-X framework still relies on having access to or being able to accurately estimate the conditional distribution $P_{X|Z}$. While the paper discusses use cases where this is feasible (e.g., controlled experiments, large unlabeled datasets) and notes robustness to estimation errors, it remains a key assumption.
  • Theoretical Analysis of Robustness: The authors suggest further theoretical analysis of the robustness of e-CRT to errors in $P_{X|Z}$ estimation.
  • More Robust Betting Scores: Exploring betting scores that are more robust to estimation errors or leverage ideas from doubly robust literature is proposed.
  • Improved Predictive Models: Investigating more powerful betting scores by incorporating dummy features into the training of predictive models (similar to recent work on HRT) is a promising direction.
  • Comparison with Grünwald et al. (2022): The paper includes a comparison with a concurrent work by Grünwald et al. (2022) which also proposes a sequential CI test. The authors note that their method might be more suitable when $P_{Y|X,Z}$ is harder to estimate, while Grünwald et al.'s might be preferred when $P_{X|Z}$ is well-behaved. Further exploration of these trade-offs is implied.

Summary updated

BibTeX
@inproceedings{shaer2026model,
  author = {Shalev Shaer},
  title = {{Model-X Sequential Testing for Conditional Independence via Testing by Betting}},
  booktitle = {AISTAT},
  year = {2026},
  url = {https://openreview.net/forum?id=xj5zN8nAXC},
}
Figure