Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a41c2f6efa91ecfa

Jump to content

Kuiper's test

From Wikipedia, the free encyclopedia

Kuiper's test is used in statistics to test whether a data sample comes from a given distribution (one-sample Kuiper test), or whether two data samples came from the same unknown distribution (two-sample Kuiper test). It is named after Dutch mathematician Nicolaas Kuiper.[1]

Kuiper's test is closely related to the better-known Kolmogorov–Smirnov test (or K-S test as it is often called). As with the K-S test, the discrepancy statistics D+ and D− represent the absolute sizes of the most positive and most negative differences between the two cumulative distribution functions that are being compared. The trick with Kuiper's test is to use the quantity D+ + D− as the test statistic. This small change makes Kuiper's test as sensitive in the tails as at the median and also makes it invariant under cyclic transformations of the independent variable. The Anderson–Darling test is another test that provides equal sensitivity at the tails as the median, but it does not provide the cyclic invariance.

This invariance under cyclic transformations makes Kuiper's test invaluable when testing for cyclic variations by time of year or day of the week or time of day, and more generally for testing the fit of, and differences between, circular probability distributions.

One-sample Kuiper test

[edit]
Illustration of the two-sample Kuiper Test statistic. Red and blue lines each correspond to an empirical distribution function, and the black arrows show the points distances which sum to the Kuiper Statistic.

The one-sample test statistic, , for Kuiper's test is defined as follows. Let F be the continuous cumulative distribution function which is to be the null hypothesis. Denote by Fn the empirical distribution function for n independent and identically distributed (i.i.d.) observations Xi, which is defined as

where is the indicator function, equal to 1 if and equal to 0 otherwise.

Then the one-sided Kolmogorov–Smirnov statistic for the given cumulative distribution function F(x) is

where is the supremum function. And finally the one-sample Kuiper test is defined as,

or equivalently

where is the infimum function.

Tables for the critical points of the test statistic are available,[2] and these include certain cases where the distribution being tested is not fully known, so that parameters of the family of distributions are estimated.

The asymptotic distribution of the statistic is given by,[1]

For , a reasonable approximation is obtained from the first term of the series as follows

Two-sample Kuiper test

[edit]

The Kuiper test may also be used to test whether two random samples, either on the real line or the circle, come from a common but unknown distribution. In this case, the Kuiper statistic is

where and are the empirical distribution functions of the first and the second sample respectively, is the supremum function, and is the infimum function.

For continuous distributions and large samples, the null distribution of the normalized statistic approaches the same limiting form as in the one-sample case. As with ,

the two-sample analogue of the limiting distribution given by Kuiper.[1][3] This large-sample approximation is distribution-free only under continuity; it can be inaccurate for small samples and does not apply when the data contain ties.

In those cases an exact p-value can instead be obtained from the permutation (conditional) distribution of given the pooled sample. This remains valid whether or not the data contain tied observations, so the two samples may come from a continuous, purely discrete or mixed distribution, and it can be computed by a recurrence that is valid for arbitrary (possibly large and unequal) sample sizes.[4] For continuous data the permutation and ordinary Kuiper statistics share the same limiting null distribution, so their critical values agree asymptotically;[1][3][5] this agreement has been shown to extend to arbitrary underlying distributions, including discrete or mixed data with ties.[4] Approximate p-values may also be obtained by resampling.

Example

[edit]

We could test the hypothesis that computers fail more during some times of the year than others. To test this, we would collect the dates on which the test set of computers had failed and build an empirical distribution function. The null hypothesis is that the failures are uniformly distributed. Kuiper's statistic does not change if we change the beginning of the year and does not require that we bin failures into months or the like.[1][6] Another test statistic having this property is the Watson statistic,[6][7] which is related to the Cramér–von Mises test.

However, if failures occur mostly on weekends, many uniform-distribution tests such as K-S and Kuiper would miss this, since weekends are spread throughout the year. This inability to distinguish distributions with a comb-like shape from continuous uniform distributions is a key problem with all statistics based on a variant of the K-S test. Kuiper's test, applied to the event times modulo one week, is able to detect such a pattern. Using event times that have been modulated with the K-S test can result in different results depending on how the data is phased. In this example, the K-S test may detect the non-uniformity if the data is set to start the week on Saturday, but fail to detect the non-uniformity if the week starts on Wednesday.

Two-sample example

[edit]

Suppose the days of the week on which some event occurs are recorded for two groups, giving discrete data on the seven points of a weekly cycle (so tied observations are unavoidable). Writing the days as positions 1–7 and cumulating each group's empirical distribution function, the largest excess of the first group's ECDF over the second is and the largest excess in the other direction is , giving a Kuiper statistic of . Because is unchanged by the choice of which day starts the week, the same value is obtained under any cyclic relabelling — unlike the Kolmogorov–Smirnov statistic, whose value can depend on where the cycle is cut. An exact p-value for these discrete data, accounting for the ties, can then be obtained from the permutation recurrence.[4]

Software implementations

[edit]

Implementations of the two-sample Kuiper test differ in how the p-value is obtained:

  • The R package KSgeneral provides the function Kuiper2sample, which computes exact p-values for continuous, purely discrete or mixed data, including tied observations, for arbitrary sample sizes.[8][4]
  • The Python library Astropy provides kuiper_two, which returns the statistic together with an approximate false-positive probability computed from an asymptotic formula.[9]
  • The R package twosamples provides kuiper_test, which obtains the p-value by permutation resampling of the pooled sample.[10]

See also

[edit]

References

[edit]
  1. 1 2 3 4 5 Kuiper, N. H. (1960). "Tests concerning random points on a circle". Proceedings of the Koninklijke Nederlandse Akademie van Wetenschappen, Series A. 63: 38–47.
  2. ↑ Pearson, E.S., Hartley, H.O. (1972) Biometrika Tables for Statisticians, Volume 2, CUP. ISBN 0-521-06937-8 (Table 54)
  3. 1 2 Maag, U. R.; Stephens, M. A. (1968). "The VNM two-sample test". Annals of Mathematical Statistics. 39 (3): 923–935. doi:10.1214/aoms/1177698324.
  4. 1 2 3 4 Dimitrova, Dimitrina S.; Jia, Yun; Kaishev, Vladimir K. (2026). "Efficient exact calculation of p-values of the two-sample Kolmogorov-Smirnov and Kuiper tests". Journal of Statistical Computation and Simulation: 1–19. doi:10.1080/00949655.2026.2721410.
  5. ↑ van der Vaart, A. W.; Wellner, J. A. (2023). Weak Convergence and Empirical Processes. Springer Series in Statistics (2nd ed.). Cham: Springer.
  6. 1 2 Watson, G.S. (1961) "Goodness-Of-Fit Tests on a Circle", Biometrika, 48 (1/2), 109–114 JSTOR 2333135
  7. ↑ Pearson, E.S., Hartley, H.O. (1972) Biometrika Tables for Statisticians, Volume 2, CUP. ISBN 0-521-06937-8 (Page 118)
  8. ↑ Dimitrova, Dimitrina; Jia, Yun; Kaishev, Vladimir; Tan, Senren (2024). "KSgeneral: Computing P-Values of the One-Sample K-S Test and the Two-Sample K-S and Kuiper Tests for (Dis)Continuous Null Distribution". CRAN.
  9. ↑ "kuiper_two". Astropy documentation. Retrieved 28 August 2026.
  10. ↑ "Kuiper Test — kuiper_test". twosamples R package documentation. Retrieved 28 August 2026.