Skip to content

ADescribe · Guide test 259

V test or modified Rayleigh test

Tests circular uniformity against concentration toward a prespecified direction.

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 = 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

30
75
80

Large spreads approach a uniform circle.

60

The direction H₁ predicts.

0.050

Your data

Drag a point or use ↑/↓ to change it
Directions (°) · n = 30 · mean direction 67°

If H₀ were true

z = 2.04
  1. The reference: how z varies across samples when H₀ is true (normal approximation with the Durand–Greenwood correction).
  2. Your statistic, from the data above.
  3. The p-value: the area at least as extreme as yours (p = .020).
  4. The hatched rejection region at α = .050: statistics landing here reject H₀.

The formula

V=Rcos⁡(θˉ−μ0),u=V2/n,p=1−Φ(u)+φ(u)[3u−u316n+15u+305u3−125u5+9u74608n2]V = R\cos(\bar\theta-\mu_0),\quad u = V\sqrt{2/n},\quad p = 1-\Phi(u)+\varphi(u)\left[\dfrac{3u-u^3}{16n}+\dfrac{15u+305u^3-125u^5+9u^7}{4608n^2}\right]

With your numbers

V=7.91,u=2.04V = 7.91,\quad u = 2.04
μ0\mu_0
the direction predicted in advance
RR
resultant length
uu
standardized V, compared with the normal
φ(u)[…]\varphi(u)[\ldots]
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 H0.

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

V=∑icos⁡(θi−μ0)=nRˉcos⁡(θˉ−μ0)u=V2/n\begin{gathered}V=\sum_i\cos(\theta_i-\mu_0)=n\bar R\cos(\bar\theta-\mu_0)\\[5pt] u=V\sqrt{2/n}\end{gathered}

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.

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::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()
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::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.6618

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 259, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT259.