ADescribe · Guide test 259
V test or modified Rayleigh test
Tests circular uniformity against concentration toward a prespecified direction.
Do it in CodeSplash
In the app, set it up in Analyze with this method:
- Tests of circular uniformity (Rayleigh, V, Kuiper, Watson, Rao) — Are the directions or times spread evenly round the circle, or do they prefer some directions?
In Tests of circular uniformity (Rayleigh, V, Kuiper, Watson, Rao), choose Test = V test (stated direction).
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 · V test or modified Rayleigh test
Large spreads approach a uniform circle.
The direction H₁ predicts.
Your data
Drag a point or use ↑/↓ to change itIf H₀ were true
- The reference: how z varies across samples when H₀ is true (normal approximation with the Durand–Greenwood correction).
- Your statistic, from the data above.
- The p-value: the area at least as extreme as yours (p = .020).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
The formula
With your numbers
- the direction predicted in advance
- resultant length
- standardized V, compared with the normal
- Durand & Greenwood's small-sample correction
The verdict
V = 7.91, z = 2.04, p = .020
p ≤ α = .050: reject H₀
More powerful than Rayleigh when the direction is known beforehand — and blind to concentration elsewhere.
- Statistic
- 2.043
- p-value
- 0.0203
V test or modified Rayleigh test on Directions (°): n = 30: V = 7.91, z = 2.04, p = .020. The p-value is below α = .050, so the data are hard to reconcile with H₀.
Question and hypotheses
H0: uniformity; H1: concentration toward a prespecified direction μ0.
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. The target direction must be chosen independently of the data.
Formula
Parameters and notation
μ0 is the specified preferred direction; θ̄ is the sample mean direction.
Structure of the method
Project every unit direction onto a scientifically prespecified target direction, sum projections, and standardize using the uniform-angle null variance. This targeted alternative can be more sensitive than an unrestricted-direction test when the expected orientation is genuinely known before observing the sample.
Estimated and nuisance parameters
Estimate the average target-aligned projection and optional sample resultant summaries. The target angle is not estimated from the tested sample. If it is fitted from the same observations, the proposed null distribution no longer applies; uncertainty from a separately estimated target may also need to be propagated.
Settings and design choices
Choose target direction, orientation/units, axial transformation if relevant, and a one-sided alternative toward that target. Positive and negative projections have different meanings; a two-sided or opposite-direction question is a different analysis. Searching several targets creates a multiple-comparison or optimization problem.
Fitting and adaptation
Adaptation means specifying a new externally justified orientation and recomputing projections, not rotating the target to the sample mean. A null simulation should use the same fixed target and any measurement-discretization convention. For clustered repeated measurements, retain subject-level dependence in a justified test or resampling method.
Sensitivity and robustness
Inspect target misspecification, weak concentration, multimodal symmetry, ties, and directional measurement error. A significant projection supports alignment relative to uniformity, not necessarily a unimodal von Mises distribution. A nonsignificant result can reflect an incorrect proposed direction even when the observations are strongly concentrated elsewhere.
How to use and calibrate
Use the one-sided V-test reference, approximately standard normal for u, or a uniform-angle Monte Carlo test.
Example application
Test whether animals orient toward a known destination.
Interpretation and pitfalls
Watch out
Choosing μ0 as the observed mean converts the problem and invalidates the prespecified-direction calibration.
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.
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::rayleigh.test(a,mu=circular::circular(0)))
"""
# 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()
Validated — Executed successfully in the validation environment · needs circular
set.seed(2026)
a<-circular::circular(runif(40,0,2*pi),units="radians")
print(circular::rayleigh.test(a,mu=circular::circular(0)))
Output
Rayleigh Test of Uniformity
Alternative with Specified Mean Direction: 0
Test Statistic: -0.0469
P-value: 0.6618Sources
- circular — circular · rayleigh.testAuthor documentation/source reviewed: circular 0.5-2.search.r-project.org
- rayleigh.testsearch.r-project.org
- circularsearch.r-project.org
- 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 259, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT259.