Papers › Nearest-Neighbor Sampling Based Conditional Independence Testing

Nearest-Neighbor Sampling Based Conditional Independence Testing

9 Apr 2023arXiv:2304.04183archive 2025-07-28

Shuai Li, Ziqi Chen, Hongtu Zhu, Christina Dan Wang, Wang Wen

The conditional randomization test (CRT) was recently proposed to test whether two random variables X and Y are conditionally independent given random variables Z. The CRT assumes that the conditional distribution of X given Z is known under the null hypothesis and then it is compared to the distribution of the observed samples of the original data. The aim of this paper is to develop a novel alternative of CRT by using nearest-neighbor sampling without assuming the exact form of the distribution of X given Z. Specifically, we utilize the computationally efficient 1-nearest-neighbor to approximate the conditional distribution that encodes the null hypothesis. Then, theoretically, we show that the distribution of the generated samples is very close to the true conditional distribution in terms of total variation distance. Furthermore, we take the classifier-based conditional mutual information estimator as our test statistic. The test statistic as an empirical fundamental information theoretic quantity is able to well capture the conditional-dependence feature. We show that our proposed test is computationally very fast, while controlling type I and II errors quite well. Finally, we demonstrate the efficiency of our proposed test in both synthetic and real data analyses.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2304.04183")

Code

Syntology Ran 14 of 17 code samples harvested from 2 repositories linked to this paper; 3 have no recorded run. Of those that ran: 2 ran · honoured contract; 1 ran · violated contract; 3 ran · our draft was wrong; 7 ran · fixture could not drive it; 1 ran with no contract checked.

By repository: official repository: 10 samples from 1 repository, 7 ran; community (archive-listed): 7 samples from 1 repository, 7 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

yanfeng-yang-0316/cdcit mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

17 samples harvested; 14 ran; 2 honoured the contract we drafted; 3 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · honoured contract
1ran · violated contract
3ran · our draft was wrong
7ran · fixture could not drive it
1ran
3unverified

Licence: 7 of the 17 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

Classifier_MI LeeShuai-kenwitch/NNSCIT/nnscit.py official repository ran MIT (permissive) · c1217da7a5cae4e9 · report
cmi LeeShuai-kenwitch/NNSCIT/nnscit.py official repository ran · fixture could not drive it MIT (permissive) · a4d77d7acb32bcbd · report
cmiPoint LeeShuai-kenwitch/NNSCIT/nnscit.py official repository ran · fixture could not drive it MIT (permissive) · ea70a8cbed456c11 · report
countNeighbors LeeShuai-kenwitch/NNSCIT/nnscit.py official repository ran · fixture could not drive it MIT (permissive) · f296fd45532342e3 · report
getKnnDist LeeShuai-kenwitch/NNSCIT/nnscit.py official repository ran · fixture could not drive it fingerprinted MIT (permissive) · 4fcba4386338d35d · report
getPointCoordDists LeeShuai-kenwitch/NNSCIT/nnscit.py official repository ran · fixture could not drive it MIT (permissive) · 8ad2e4cb5226410c · report
miPoint LeeShuai-kenwitch/NNSCIT/nnscit.py official repository ran · fixture could not drive it MIT (permissive) · 3be01708e9d6e355 · report
CCMI LeeShuai-kenwitch/NNSCIT/nnscit.py official repository unverified MIT (permissive) · e2f76cd7cfe3762c · report
GMCIT LeeShuai-kenwitch/NNSCIT/nnscit.py official repository unverified MIT (permissive) · 2bd870923dab2981 · report
getPairwiseDistArray LeeShuai-kenwitch/NNSCIT/nnscit.py official repository unverified MIT (permissive) · 8d372150d6881632 · report
NNCMI yanfeng-yang-0316/cdcit/nnlscit.py community (archive-listed) ran · fixture could not drive it no licence file found · pointer only · f76c631904de0f95 · report
log_mean_exp_numpy yanfeng-yang-0316/cdcit/nnlscit.py community (archive-listed) ran · our draft was wrong fingerprinted no licence file found · pointer only · 32a3583764c247db · report
mimic_knn yanfeng-yang-0316/cdcit/nnlscit.py community (archive-listed) ran · our draft was wrong fingerprinted no licence file found · pointer only · 574abf7fc64476b5 · report
normalize_data yanfeng-yang-0316/cdcit/nnlscit.py community (archive-listed) ran · honoured contract fingerprinted no licence file found · pointer only · c6a3311cea14cc5a · report
split_XYZ yanfeng-yang-0316/cdcit/nnlscit.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 99c16e627e3d00e2 · report
split_train_test yanfeng-yang-0316/cdcit/nnlscit.py community (archive-listed) ran · honoured contract fingerprinted no licence file found · pointer only · aeb422e5bb499306 · report
xgb_classifier yanfeng-yang-0316/cdcit/nnlscit.py community (archive-listed) ran · violated contract fingerprinted no licence file found · pointer only · ae462d71cbe417e2 · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Test

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections