circ_rayleigh(angles, w=None, d=None)
Rayleigh test for non-uniformity of circular data.
- angles1-D array_like
Samples of angles in radians. The range of
anglesmust be either \([0, 2\pi]\) or \([-\pi, \pi]\). If
anglesis not expressed in radians (e.g. degrees or 24-hours), please use the
pingouin.convert_angles()function prior to using the present function.
Number of incidences per bins (i.e. “weights”), in case of binned angle data.
Spacing (in radians) of bin centers for binned data. If supplied, a correction factor is used to correct for bias in the estimation of r.
The Rayleigh test asks how large the resultant vector length R must be to indicate a non-uniform distribution (Fisher 1995).
H0: the population is uniformly distributed around the circle HA: the populatoin is not distributed uniformly around the circle
The assumptions for the Rayleigh test are that (1) the distribution has only one mode and (2) the data is sampled from a von Mises distribution.
Simple Rayleigh test for non-uniformity of circular data.
>>> from pingouin import circ_rayleigh >>> x = [0.785, 1.570, 3.141, 0.839, 5.934] >>> z, pval = circ_rayleigh(x) >>> print(round(z, 3), round(pval, 6)) 1.236 0.304844
Specifying w and d
>>> z, pval = circ_rayleigh(x, w=[.1, .2, .3, .4, .5], d=0.2) >>> print(round(z, 3), round(pval, 6)) 0.278 0.806997