rayleightest¶

astropy.stats.
rayleightest
(data, axis=None, weights=None)[source] [edit on github]¶ Performs the Rayleigh test of uniformity.
This test is used to identify a nonuniform distribution, i.e. it is designed for detecting an unimodal deviation from uniformity. More precisely, it assumes the following hypotheses:  H0 (null hypothesis): The population is distributed uniformly around the circle.  H1 (alternative hypothesis): The population is not distributed uniformly around the circle. Small pvalues suggest to reject the null hypothesis.
Parameters: data : numpy.ndarray or Quantity
Array of circular (directional) data, which is assumed to be in radians whenever
data
isnumpy.ndarray
.axis : int, optional
Axis along which the Rayleigh test will be performed.
weights : numpy.ndarray, optional
In case of grouped data, the ith element of
weights
represents a weighting factor for each group such thatnp.sum(weights, axis)
equals the number of observations. See [R102], remark 1.4, page 22, for detailed explanation.Returns: pvalue : float or dimensionless Quantity
pvalue.
References
[R102] (1, 2) S. R. Jammalamadaka, A. SenGupta. “Topics in Circular Statistics”. Series on Multivariate Analysis, Vol. 5, 2001. [R103] C. Agostinelli, U. Lund. “Circular Statistics from ‘Topics in Circular Statistics (2001)’”. 2015. <https://cran.rproject.org/web/packages/CircStats/CircStats.pdf> [R104] M. Chirstman., C. Miller. “Testing a Sample of Directions for Uniformity.” Lecture Notes, STA 6934/5805. University of Florida, 2007. [R105] D. Wilkie. “Rayleigh Test for Randomness of Circular Data”. Applied Statistics. 1983. <http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.211.4762> Examples
>>> import numpy as np >>> from astropy.stats import rayleightest >>> from astropy import units as u >>> data = np.array([130, 90, 0, 145])*u.deg >>> rayleightest(data) <Quantity 0.2563487733797317>