Rayleigh Test of Uniformity

< Hypothesis tests < Rayleigh test of uniformity

What is the Rayleigh test of uniformity?

The Rayleigh test of uniformity detects departures from uniformity in circular data — where uniformity means that all data points, or angles, are equally likely to occur. Circular data occurs in many practical situations such as the time of day calls are placed to a call center, samples collected at different times of the year or crimes committed during certain moon phases. The test was originally developed for testing deviations for data that follows a unimodal von Mises distribution; other tests such as Kuiper’s V and the Pycke test offer better reliability and more power for multimodal data.

The simple form of the Rayleigh test assumes that if there is a departure from the null hypothesis, the departure will have a single peak (i.e., it will be unimodal). Therefore, the Rayleigh test is only appropriate if unimodal departures are suspected or of interest, but the peak of such alternative distributions could occur anywhere around the circle [1].

A less common version of the Rayleigh test allows you to specify an expected mean direction, μ. In this case, the test still looks for a unimodal departure from uniformity, but now the departure is centered around the specified mean direction. Using this more specific alternative hypothesis gives the test more power to reject the null hypothesis when it is false.

When to use the Rayleigh test of uniformity

The Rayleigh test, in both forms, is the most efficient possible test [2] as long as the unimodal alternative follows a von Mises distribution. A unimodal alternative in the context of the Rayleigh test refers to a departure from uniformity with a single peak. In other words, the probability of a given angle is highest at the peak of the distribution and decreases as you move away from the peak. The Rayleigh test of uniformity is also very reliable when data is discrete — for example, if data is produced by a measuring instrument with finite precision [3]. However, the test is not as reliable when the deviation from uniformity is multimodal, with concerningly low power even for large sample sizes [4].

If departure from uniformity is not likely to be unimodal, alternative tests are Kuiper’s V, Watsons U2 and Rao’s spacing tests — all of which provide reliable results [1].  The Hermans and Rasson test substantially outperforms the Rayleigh test in multimodal situations [4]. The Pycke test [5] offers useful power when the sample is clustered around the modes.

The Rayleigh test of uniformity can be invoked in R with rayleigh.test in package circular [6].

References

[1] Ruxton GD. Testing for departure from uniformity and estimating mean direction for circular data. Biol Lett. 2017 Jan;13(1):20160756. doi: 10.1098/rsbl.2016.0756. PMID: 28100719; PMCID: PMC5310581.

[2] Watson GS, Williams EJ. 1956. On the construction of significance tests on the circle and the sphere. Biometrika 43, 344–352.

[3] Humphreys RK, Ruxton GD. Consequences of grouped data for testing for departure from circular uniformity. Behav Ecol Sociobiol. 2017;71(11):167.

[4] Landler, L., Ruxton, G.D. & Malkemper, E.P. The Hermans–Rasson test as a powerful alternative to the Rayleigh test for circular statistics in biology. BMC Ecol 19, 30 (2019). https://doi.org/10.1186/s12898-019-0246-8

[5] Pycke JR. Some tests for uniformity of circular distributions powerful against multimodal alternatives. Can J Stat. 2010;38(1):80–96.

[6] Oliveira M, Crujeiras RM, Rodríguez-Casal A. NPCirc: an R package for nonparametric circular methods. J Stat Softw. 2014;61:1–26.