pingouin.circ_rayleigh

pingouin.circ_rayleigh(alpha, w=None, d=None)[source]

Rayleigh test for non-uniformity of circular data.

Parameters
alphanp.array

Sample of angles in radians.

wnp.array

Number of incidences 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

Z-statistic

pvalfloat

P-value

Notes

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.

Examples

  1. 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(z, pval)
1.236 0.3048435876500138
  1. Specifying w and d

>>> circ_rayleigh(x, w=[.1, .2, .3, .4, .5], d=0.2)
(0.278, 0.8069972000769801)