Histogram uniformity testing is a common statistical task usually performed using Pearson's chi-square test. This paper proposes a new test based on the discrete total variation that is easy to compute and, for comb-like (alternating) deviations, achieves up to 67% higher statistical power than Pearson's chi-square test, making it a complement to standard tests. The exact null distribution is computed via dynamic programming, and a gamma approximation with Monte Carlo estimation extends the test to arbitrarily large sample sizes. Experiments on simulated ADC alternating differential nonlinearity and on rounding bias detection in scientific data confirm the claims. The Python source code and precomputed data are available at https://github.com/DiscreteTotalVariation/CombTest.
翻译:直方图均匀性检验是一项常见的统计任务,通常采用皮尔逊卡方检验完成。本文提出一种基于离散总变差的新检验方法,该方法计算简便,在处理梳状(交替型)偏差时,统计功效比皮尔逊卡方检验最高提升67%,成为标准检验的有力补充。通过动态规划计算精确零分布,并采用蒙特卡洛估计的伽马近似将检验推广至任意大样本量。在模拟ADC交替微分非线性及科学数据舍入偏差检测实验中的结果验证了上述结论。Python源代码与预计算数据已公开于https://github.com/DiscreteTotalVariation/CombTest。