LOCO CRT: Conditional Randomization Test
- LOCO–CRT is a method for assessing conditional independence in the model-X framework by evaluating the impact of omitting individual covariates.
- It computes predictive loss differences between full and leave-one-out models to yield robust, finite-sample valid p-values for each variable.
- The approach reduces computational cost through model reuse and supports analytic solutions in Gaussian covariate cases, enhancing its practical applicability.
The leave-one-covariate-out conditional randomization test (LOCO–CRT) is a computationally efficient methodology for assessing conditional independence within the model-X framework. It tests the null hypothesis that a response variable is independent of a given covariate conditional on all other covariates , under the assumption that the marginal distribution of the covariate vector is known or can be accurately sampled. LOCO–CRT yields valid -values useful for error-rate control in variable selection, minimizing algorithmic randomness and enabling practical application even in high-dimensional settings (Katsevich et al., 2020).
1. Statistical Formulation and Model-X Framework
The setup assumes i.i.d. samples , , with and arbitrary . The model-X assumption requires that the joint distribution of 0 is fully known or directly sampleable, while 1 remains unrestricted. For each variable 2, the test targets
3
where 4 denotes all features except 5. This hypothesis asserts that, conditional on 6, 7 carries no information regarding 8.
2. LOCO Test Statistic
Given a loss function 9, e.g., squared loss for regression or logistic loss for classification, define:
- 0: any fitted predictor trained on 1,
- 2: the same model class fitted using 3.
The observed LOCO statistic for coordinate 4 is: 5 6 quantifies the change in predictive loss incurred by omitting 7. Under 8, 9 is expected to be small; under the alternative, it should be large.
3. Algorithmic Procedure and P-value Calculation
The LOCO–CRT algorithm uses null randomization to obtain a valid 0-value for each variable. For each 1:
- Fit both 2 (on 3) and 4 (on 5).
- Compute 6 as the average loss difference.
- For 7:
- For each 8, sample 9.
- Construct 0.
- Compute 1, the analogous test statistic using the null-resampled 2.
- Calculate
3
Because 4 are exchangeable under 5, 6 is valid in finite samples. For simultaneous inference across coordinates, conventional multiplicity corrections (Bonferroni, Holm, Benjamini–Hochberg) can be applied.
4. Theoretical Guarantees
The principal theoretical result is finite-sample validity of LOCO–CRT 7-values: 8 given correct randomization from 9 and i.i.d. sampling. Under the null, 0 is a super-uniform 1-value. Familywise error rate (FWER) can be controlled at level 2 by rejecting all 3 with 4. The computational efficiency is achieved by fitting 5 and 6 only once per variable; null sampling changes only 7, not the fitted models.
5. L1ME–CRT Variant for L1-regularized M-Estimators
For L1-regularized estimators (e.g., Lasso, elastic net), refitting after each variable exclusion is computationally intensive. The L1ME–CRT modification capitalizes on the empirical observation that, for coordinates 8 with 9 in the full-data fit, the cross-validated penalty parameter 0 is typically stable after exclusion, under restricted eigenvalue and Lipschitz loss conditions: 1 Hence, for the “inactive” set 2, the same 3 can be reused for 4, obviating additional cross-validations. This reduces computational overhead to near the number of “active” variables, 5 in sparse regimes.
6. Closed-form Solution in the Multivariate Gaussian Covariate Case
Assuming 6, the conditional law
7
with 8, enables analytic computation. With squared error loss and ordinary least squares,
9
where 0 and 1 are fitted values excluding and including 2. Under 3, 4 follows a 5 distribution, and the 6-value is given by
7
recovering the classical partial 8-test or 9-test for a single coefficient in normal linear regression, with no need for Monte Carlo.
7. Computational and Practical Considerations
Let 0 denote the cost of fitting a model and 1 the cost of scoring 2 samples:
- A single LOCO–CRT test requires 3.
- Testing all 4 features costs 5, but with L1ME–CRT, the actual model refits may be far fewer than 6 due to reuse for inactive features.
Typically, 7 is 8 for OLS or 9 for Lasso; 0 is 1. Monte Carlo sample sizes 2–2000 are common, balancing 3-value granularity and computational burden.
Implementation suggestions include precomputing random seeds for reproducibility, vectorizing null-feature sampling when feasible, and using persistent model objects in languages like R or Python to avoid redundant refitting. These practicalities further enhance runtime efficiency.
For foundational and related methodologies, see "Panning for gold: 'model-X' knockoffs for high-dimensional controlled variable selection” (Candès, Fan, Janson & Lv), “Gene hunting with hidden Markov model knockoffs” (Sesia, Candès & Sabatti), and “Multiple testing with the conditional randomization test” (Li & Barber) in addition to the primary development of LOCO–CRT (Katsevich et al., 2020).