Skip to content

ADescribe · Guide test 260

Kuiper test

Tests circular uniformity using the sum of maximum positive and negative cumulative discrepancies.

Runs in CodeSplashPython (calls R) example not runR example validated

Do it in CodeSplash

In the app, set it up in Analyze with this method:

In Tests of circular uniformity (Rayleigh, V, Kuiper, Watson, Rao), choose Test = Kuiper.

Do it in CodeSplash Run this test on your own data, in Python or R.

Bench

Change the design, drag the data, move α. The statistic, its reference distribution and the verdict follow.

Bench · Kuiper test

30
60
70

Large spreads approach a uniform circle.

0.050

Your data

Drag a point or use ↑/↓ to change it
0°90°180°270°Directions: n = 30, θ̄ = 57°, R̄ = 0.35

Sectors are area-proportional counts; the arrows point to each mean direction, with length R̄ (0: no preferred direction, 1: all identical).

If H₀ were true

V* = 1.60
  1. The reference: how V* varies across samples when H₀ is true, the limiting distribution of Stephens' V* (Stephens' V* against its limiting distribution).
  2. Your statistic, from the data above.
  3. The p-value: the area at least as extreme as yours (p = .108).
  4. The hatched rejection region at α = .050: statistics landing here reject H₀.

The formula

V=D++D−,D+=max⁡i(in−u(i)), D−=max⁡i(u(i)−i−1n),V∗=V(n+0.155+0.24n)V = D^+ + D^-,\quad D^+=\max_i\Big(\frac in-u_{(i)}\Big),\ D^-=\max_i\Big(u_{(i)}-\frac{i-1}n\Big),\qquad V^*=V\Big(\sqrt n+0.155+\frac{0.24}{\sqrt n}\Big)

With your numbers

V=0.28,n=30,V∗=1.60V = 0.28,\quad n = 30,\quad V^* = 1.60
u(i)u_{(i)}
sorted directions as fractions of the full circle
D++D−D^+ + D^-
largest gaps above and below the uniform CDF; their sum does not depend on where 0° is
V∗V^*
Stephens' modification, compared with its limiting distribution (the curve)

The verdict

V* = 1.60, p = .108

p > α = .050: compatible with H₀

Rotation-invariant, so it also detects bimodal departures that the Rayleigh test misses; with small n it has modest power against any single alternative.

Statistic
1.604
p-value
0.1085
Kuiper test on Directions (°): n = 30: V* = 1.60, p = .108. The p-value is above α = .050, so the data are compatible with H0.

Kuiper test on Directions (°): n = 30: V* = 1.60, p = .108. The p-value is above α = .050, so the data are compatible with H₀.

Question and hypotheses

H0: a specified continuous circular distribution, often uniformity.

Assumptions

Independent angular observations with a clear radians/degrees convention and orientation. The usual null uses a full circular domain; axial data require an appropriate doubling transformation or axial model.

Formula

V=D++D−D+=max⁡i(i/n−ui)D−=max⁡i(ui−(i−1)/n)\begin{gathered}V=D^++D^-\\[5pt] D^+=\max_i(i/n-u_i)\\[5pt] D^-=\max_i(u_i-(i-1)/n)\end{gathered}

Parameters and notation

ui=F0(θ(i)) mapped to [0,1] after choosing an origin; Kuiper’s sum is rotation invariant for uniformity.

Structure of the method

Order transformed circular observations, calculate maximum positive and negative empirical-CDF discrepancies from the specified null, and sum them. For circular uniformity the combined discrepancy is insensitive to the arbitrary origin; this is why an ordinary linear KS calculation is not the same procedure.

Estimated and nuisance parameters

Estimate the empirical distribution only for a fully specified null. If mean direction, concentration, or other null-distribution parameters are fitted from the sample, they become nuisance estimates and invalidate unmodified simple-null calibration. A probability-integral transform does not remove parameter-estimation effects by itself.

Settings and design choices

Choose null distribution, units/origin convention, treatment of ties, finite-sample modification, and exact/table/simulation reference. The circular package’s kuiper.test is specifically a uniformity implementation and can report a p-value range from tabulated critical values; do not present that interval as an exact numeric p value.

Fitting and adaptation

For a fitted nonuniform null, simulate from the fitted model, refit its parameters within replicates when justified, and recalculate the complete transformed statistic. For discretized angle data, simulate the measurement process or use a suitable discrete-null method. No neural fitting is part of the classical uniformity test.

Sensitivity and robustness

Inspect sample size, rounding/heaping, repeated-subject dependence, and departures concentrated in different angular regions. Kuiper can detect more than a mean-direction change; its power pattern differs from Rayleigh’s. Use Kuiper-specific rather than KS thresholds and state whether any parameter fitting or multiple null-model comparison occurred.

How to use and calibrate

Use Kuiper-specific finite/asymptotic critical values or simulate the complete null procedure.

Example application

Detect any angular nonuniformity, including multiple modes.

Interpretation and pitfalls

Watch out

Do not use ordinary KS critical values; fitted circular parameters require refitting in simulation.

What changed in edition 2

  • New sections: structure of the method, estimated and nuisance parameters, settings and design choices, fitting and adaptation, sensitivity and robustness.

Python and R

Angles are in radians on a full circle. The V test specifies direction zero in advance; ordinary Rayleigh does not. Some circular routines return critical-value ranges rather than a continuously resolved p-value.

Python · invokes R

Not run — Executed end to end through Rscript · needs Python standard library + Rscript; R packages: circular

# Python launcher for the complete R implementation below.
# Requires Rscript on PATH and the listed R packages.
import shutil
import subprocess
rscript = shutil.which("Rscript")
if rscript is None:
    raise RuntimeError("Install R and make Rscript available on PATH.")
r_code = r"""
set.seed(2026)
a<-circular::circular(runif(40,0,2*pi),units="radians")
print(circular::kuiper.test(a))
"""
# No shell interpolation. A failed R execution raises an error in Python.
result = subprocess.run([rscript, "--vanilla", "-"], input=r_code,
                        text=True, capture_output=True)
print(result.stdout)
if result.stderr:
    print(result.stderr)
result.check_returncode()
R

Validated — Executed successfully in the validation environment · needs circular

set.seed(2026)
a<-circular::circular(runif(40,0,2*pi),units="radians")
print(circular::kuiper.test(a))
Output
       Kuiper's Test of Uniformity 
 
Test Statistic:  1.4629 
P-value > 0.15

Sources

Statistics guide v4 (historical):
Python: Executed end to end through Rscript · R: Executed successfully in the validation environment
Reference's record:
Edition 2 review: Python: skip · R: not executed (Rscript unavailable); why not run: Python: Python-to-R bridge; Rscript is unavailable. R code was not executed. Python: Not run in the reference's review: Python-to-R bridge; Rscript is unavailable. R code was not executed. R: Reviewed but not run: R wasn't available to the reference's authors.

From the CodeSplash statistics guide (v4), entry 260, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT260.