pingouin.circ_rayleigh

pingouin.
circ_rayleigh
(angles, w=None, d=None)[source] Rayleigh test for nonuniformity of circular data.
 Parameters
 angles1D array_like
Samples of angles in radians. The range of
angles
must be either \([0, 2\pi]\) or \([\pi, \pi]\). Ifangles
is not expressed in radians (e.g. degrees or 24hours), please use thepingouin.convert_angles()
function prior to using the present function. warray_like
Number of incidences per bins (i.e. “weights”), in case of binned angle data.
 dfloat
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.
 Returns
 zfloat
Zstatistic
 pvalfloat
Pvalue
Notes
The Rayleigh test asks how large the resultant vector length R must be to indicate a nonuniform 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.
Examples
Simple Rayleigh test for nonuniformity 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