Circular Statistics

astropy.stats.circstats Module

This module contains simple functions for dealing with circular statistics, for instance, mean, variance, standard deviation, correlation coefficient, and so on. This module also cover tests of uniformity, e.g., the Rayleigh and V tests. The Maximum Likelihood Estimator for the Von Mises distribution along with the Cramer-Rao Lower Bounds are also implemented. Almost all of the implementations are based on reference 1, which is also the basis for the R package ‘CircStats’ 2.


circmean(data[, axis, weights])

Computes the circular mean angle of an array of circular data.

circstd(data[, axis, weights, method])

Computes the circular standard deviation of an array of circular data.

circvar(data[, axis, weights])

Computes the circular variance of an array of circular data.

circmoment(data[, p, centered, axis, weights])

Computes the p-th trigonometric circular moment for an array of circular data.

circcorrcoef(alpha, beta[, axis, …])

Computes the circular correlation coefficient between two array of circular data.

rayleightest(data[, axis, weights])

Performs the Rayleigh test of uniformity.

vtest(data[, mu, axis, weights])

Performs the Rayleigh test of uniformity where the alternative hypothesis H1 is assumed to have a known mean angle mu.

vonmisesmle(data[, axis])

Computes the Maximum Likelihood Estimator (MLE) for the parameters of the von Mises distribution.



S. R. Jammalamadaka, A. SenGupta. “Topics in Circular Statistics”. Series on Multivariate Analysis, Vol. 5, 2001.


C. Agostinelli, U. Lund. “Circular Statistics from ‘Topics in Circular Statistics (2001)’”. 2015.