Mean of circular quantities

From HandWiki

In mathematics, a mean of circular quantities is a mean which is sometimes better-suited for quantities like angles, daytimes, and fractional parts of real numbers. This is necessary since most of the usual means may not be appropriate on circular quantities. For example, the arithmetic mean of 0° and 360° is 180°, which is misleading because for most purposes 360° is the same thing as 0°.[1] As another example, the "average time" between 11 PM and 1 AM is either midnight or noon, depending on whether the two times are part of a single night or part of a single calendar day. This is one of the simplest examples of statistics of non-Euclidean spaces.

Mean of angles

Since the arithmetic mean is not always appropriate for angles, the following method can be used to obtain both a mean value and measure for the variance of the angles:

Convert all angles to corresponding points on the unit circle, e.g., [math]\displaystyle{ \alpha }[/math] to [math]\displaystyle{ (\cos\alpha,\sin\alpha) }[/math]. That is, convert polar coordinates to Cartesian coordinates. Then compute the arithmetic mean of these points. The resulting point will lie within the unit disk. Convert that point back to polar coordinates. The angle is a reasonable mean of the input angles. The resulting radius will be 1 if all angles are equal. If the angles are uniformly distributed on the circle, then the resulting radius will be 0, and there is no circular mean. (In fact, it is impossible to define a continuous mean operation on the circle.) In other words, the radius measures the concentration of the angles.

Given the angles [math]\displaystyle{ \alpha_1,\dots,\alpha_n }[/math] a common formula of the mean using the atan2 variant of the arctangent function is

[math]\displaystyle{ \bar{\alpha} = \operatorname{atan2}\left(\frac{1}{n}\sum_{j=1}^n \sin\alpha_j, \frac{1}{n}\sum_{j=1}^n \cos\alpha_j\right) = \operatorname{atan2}\left(\sum_{j=1}^n \sin\alpha_j, \sum_{j=1}^n \cos\alpha_j\right) }[/math]

or, using complex numbers:

[math]\displaystyle{ \bar{\alpha} = \arg\left(\sum_{j=1}^n \exp(\sqrt{-1} \cdot\alpha_j)\right) }[/math]

In order to match the above derivation using arithmetic means of points, the sums would have to be divided by [math]\displaystyle{ n }[/math]. However, the scaling does not matter for [math]\displaystyle{ \operatorname{atan2} }[/math] and [math]\displaystyle{ \arg }[/math], thus it can be omitted.

This computation produces a different result than the arithmetic mean, with the difference being greater when the angles are widely distributed. For example, the arithmetic mean of the three angles 0°, 0° and 90° is (0+0+90)/3 = 30°, but the vector mean is 26.565°. Moreover, with the arithmetic mean the circular variance is only defined ±180°.

Properties

The circular mean [math]\displaystyle{ \bar{\alpha} }[/math]

  • maximizes the likelihood of the mean parameter of the von Mises distribution and
  • minimizes the sum of a certain distance on the circle, more precisely
[math]\displaystyle{ \bar{\alpha} = \underset{\beta}{\operatorname{argmin}} \sum_{j=1}^n d(\alpha_j,\beta), \text{ where } d(\varphi,\beta) = 1-\cos(\varphi-\beta). }[/math]
The distance [math]\displaystyle{ d(\varphi,\beta) }[/math] is equal to half the squared Euclidean distance between the two points on the unit circle associated with [math]\displaystyle{ \varphi }[/math] and [math]\displaystyle{ \beta }[/math].

Example

A simple way to calculate the mean of a series of angles (in the interval [0°, 360°)) is to calculate the mean of the cosines and sines of each angle, and obtain the angle by calculating the inverse tangent. Consider the following three angles as an example: 10, 20, and 30 degrees. Intuitively, calculating the mean would involve adding these three angles together and dividing by 3, in this case indeed resulting in a correct mean angle of 20 degrees. By rotating this system anticlockwise through 15 degrees the three angles become 355 degrees, 5 degrees and 15 degrees. The naive mean is now 125 degrees, which is the wrong answer, as it should be 5 degrees. The vector mean [math]\displaystyle{ \bar \theta }[/math] can be calculated in the following way, using the mean sine [math]\displaystyle{ \bar s }[/math] and the mean cosine [math]\displaystyle{ \bar c \not = 0 }[/math]:

[math]\displaystyle{ \bar s = \frac{1}{3} \left( \sin (355^\circ) + \sin (5^\circ) + \sin (15^\circ) \right) = \frac{1}{3} \left( -0.087 + 0.087 + 0.259 \right) \approx 0.086 }[/math]
[math]\displaystyle{ \bar c = \frac{1}{3} \left( \cos (355^\circ) + \cos (5^\circ) + \cos (15^\circ) \right) = \frac{1}{3} \left( 0.996 + 0.996 + 0.966 \right) \approx 0.986 }[/math]
[math]\displaystyle{ \bar \theta = \left. \begin{cases} \arctan \left( \frac{\bar s}{ \bar c} \right) & \bar s \gt 0 ,\ \bar c \gt 0 \\ \arctan \left( \frac{\bar s}{ \bar c} \right) + 180^\circ & \bar c \lt 0 \\ \arctan \left (\frac{\bar s}{\bar c} \right)+360^\circ & \bar s \lt 0 ,\ \bar c \gt 0 \end{cases} \right\} = \arctan \left( \frac{0.086}{0.986} \right) = \arctan (0.087) = 5^\circ. }[/math]

This may be more succinctly stated by realizing that directional data are in fact vectors of unit length. In the case of one-dimensional data, these data points can be represented conveniently as complex numbers of unit magnitude [math]\displaystyle{ z=\cos(\theta)+i\,\sin(\theta)=e^{i\theta} }[/math], where [math]\displaystyle{ \theta }[/math] is the measured angle. The mean resultant vector for the sample is then:

[math]\displaystyle{ \overline{\mathbf{\rho}}=\frac{1}{N}\sum_{n=1}^N z_n. }[/math]

The sample mean angle is then the argument of the mean resultant:

[math]\displaystyle{ \overline{\theta}=\mathrm{Arg}(\overline{\mathbf{\rho}}). }[/math]

The length of the sample mean resultant vector is:

[math]\displaystyle{ \overline{R}=|\overline{\mathbf{\rho}}| }[/math]

and will have a value between 0 and 1. Thus the sample mean resultant vector can be represented as:

[math]\displaystyle{ \overline{\mathbf{\rho}}=\overline{R}\,e^{i\overline{\theta}}. }[/math]

Similar calculations are also used to define the circular variance.

See also

References

Jammalamadaka, S. Rao and SenGupta, A. (2001). Topics in Circular Statistics, Section 1.3, World Scientific Press, Singapore. ISBN:981-02-3778-2

  1. Christopher M. Bishop: Pattern Recognition and Machine Learning (Information Science and Statistics), ISBN:0-387-31073-8

External links