pingouin.circ_vtest#
- pingouin.circ_vtest(angles, dir=0.0, w=None, d=None)[source]#
V test for non-uniformity of circular data with a specified mean direction.
- Parameters:
- angles1-D 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 24-hours), please use thepingouin.convert_angles()
function prior to using the present function.- dirfloat
Suspected mean direction (angle in radians).
- 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:
- Vfloat
V-statistic
- pvalfloat
P-value
Notes
H0: the population is uniformly distributed around the circle. HA: the population is not distributed uniformly around the circle but has a mean of dir.
Note: Not rejecting H0 may mean that the population is uniformly distributed around the circle OR that it has a mode but that this mode is not centered at dir.
The V test has more power than the Rayleigh test and is preferred if there is reason to believe in a specific mean direction.
Adapted from the Matlab Circular Statistics Toolbox.
Examples
V-test for non-uniformity of circular data.
>>> from pingouin import circ_vtest >>> x = [0.785, 1.570, 3.141, 0.839, 5.934] >>> v, pval = circ_vtest(x, dir=1) >>> print(round(v, 3), pval) 2.486 0.05794648732225438
Specifying w and d
>>> v, pval = circ_vtest(x, dir=0.5, w=[.1, .2, .3, .4, .5], d=0.2) >>> print(round(v, 3), round(pval, 5)) 0.637 0.23086