Skip to main content
QUICK REVIEW

[Paper Review] A New ECDF Two-Sample Test Statistic

Connor Dowd|arXiv (Cornell University)|Jul 2, 2020
Statistical Methods and InferenceMathematics7 references24 citations
TL;DR

This paper introduces a new two-sample test statistic, the DTS (Divergence Test Statistic), which improves power over existing ECDF-based tests like Kolmogorov-Smirnov, Kuiper, and Cramér-von Mises by optimally weighting differences in empirical cumulative distribution functions according to their estimated variance under the null. The method achieves higher power across diverse distributional differences, including shifts in location, scale, and higher moments, with a conservative finite-sample p-value procedure and O(N log N) computational efficiency via an R package.

ABSTRACT

Empirical cumulative distribution functions (ECDFs) have been used to test the hypothesis that two samples come from the same distribution since the seminal contribution by Kolmogorov and Smirnov. This paper describes a statistic which is usable under the same conditions as Kolmogorov-Smirnov, but provides more power than other extant tests in that vein. I demonstrate a valid (conservative) procedure for producing finite-sample p-values. I outline the close relationship between this statistic and its two main predecessors. I also provide a public R package (CRAN: twosamples [2018]) implementing the testing procedure in $O(N\log(N))$ time with $O(N)$ memory. Using the package's functions, I perform several simulation studies showing the power improvements.

Motivation & Objective

  • To develop a more powerful two-sample test for comparing distributions when the alternative hypothesis involves differences beyond just location or scale.
  • To address the limitation of existing ECDF-based tests in detecting subtle or complex distributional differences, especially in small to moderate samples.
  • To provide a valid, conservative finite-sample p-value procedure for the new test statistic.
  • To implement the test efficiently in O(N log N) time and O(N) memory using an R package for broad usability.
  • To demonstrate through simulations that the new test outperforms existing methods in power across a wide range of distributional alternatives.

Proposed method

  • The test statistic is defined as a weighted sum of absolute differences between two empirical cumulative distribution functions (ECDFs), with weights derived from the estimated variance of the difference under the null hypothesis.
  • The variance estimate is based on the combined sample’s ECDF, ensuring that observations with higher variance (around p=0.5) are down-weighted and those with lower variance (near p=0 or p=1) are up-weighted.
  • The test uses a conservative finite-sample p-value procedure derived from permutation or exact distributional approximation to maintain Type I error control.
  • The algorithm computes the test statistic in O(N log N) time by sorting the combined sample and efficiently evaluating the weighted sum over ordered data points.
  • The method is implemented in an R package (twosamples) that supports weighted observations, parallelization, and comparison to known null distributions.
  • The test is shown to be consistent and asymptotically valid, with power improvements over existing methods in simulations.

Experimental results

Research questions

  • RQ1Can a new two-sample test statistic be developed that offers greater power than existing ECDF-based tests like Kolmogorov-Smirnov, Kuiper, and Cramér-von Mises?
  • RQ2Does weighting the differences in ECDFs by their estimated variance under the null improve detection power across diverse distributional alternatives?
  • RQ3Can a finite-sample p-value procedure be constructed that maintains Type I error control while enabling practical use of the new test?
  • RQ4How does the new test perform in detecting differences in location, scale, and higher-order moments (e.g., mixtures) compared to state-of-the-art alternatives?
  • RQ5Is the new test consistently powerful across a wide range of distributional differences, or does it trade off power in some cases for gains in others?

Key findings

  • The DTS test achieved rejection rates of 71% in detecting a mixture distribution with different means and variances, while the Wasserstein test only reached 38% at the same sample size.
  • In a simulation with a mixture of two normals (recentered and rescaled to have mean 0 and variance 1), the DTS test maintained the highest power, outperforming even the Wasserstein test and other advanced methods.
  • When detecting differences in higher moments (e.g., skewness and kurtosis in mixtures), the DTS test showed consistently superior performance, with power gains of up to 24 percentage points over the Wasserstein test.
  • The DTS test was the most powerful in 100% of simulations involving mixtures with different variances, followed closely by the Kuiper test.
  • The DTS test maintained high power across all tested scenarios, including location shifts, scale changes, and complex mixtures, with no significant drop in performance in any single class of alternatives.
  • At a sample size where the DTS test had 71% power, the Wasserstein test had only 47% power in one mixture scenario, indicating that in nearly 1-in-4 simulations, the DTS test rejected the null while others did not.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.