HOME

TheInfoList



OR:

In
mathematics Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
and
statistics Statistics (from German language, German: ', "description of a State (polity), state, a country") is the discipline that concerns the collection, organization, analysis, interpretation, and presentation of data. In applying statistics to a s ...
, a circular mean or angular mean is a
mean A mean is a quantity representing the "center" of a collection of numbers and is intermediate to the extreme values of the set of numbers. There are several kinds of means (or "measures of central tendency") in mathematics, especially in statist ...
designed for
angle In Euclidean geometry, an angle can refer to a number of concepts relating to the intersection of two straight Line (geometry), lines at a Point (geometry), point. Formally, an angle is a figure lying in a Euclidean plane, plane formed by two R ...
s and similar cyclic quantities, such as times of day, and
fractional part The fractional part or decimal part of a non‐negative real number x is the excess beyond that number's integer part. The latter is defined as the largest integer not greater than , called ''floor'' of or \lfloor x\rfloor. Then, the fractional ...
s of
real number In mathematics, a real number is a number that can be used to measure a continuous one- dimensional quantity such as a duration or temperature. Here, ''continuous'' means that pairs of values can have arbitrarily small differences. Every re ...
s. This is necessary since most of the usual means may not be appropriate on angle-like quantities. For example, the
arithmetic mean In mathematics and statistics, the arithmetic mean ( ), arithmetic average, or just the ''mean'' or ''average'' is the sum of a collection of numbers divided by the count of numbers in the collection. The collection is often a set of results fr ...
of 0° and 360° is 180°, which is misleading because 360° equals 0° modulo a full cycle.Christopher M. Bishop: ''Pattern Recognition and Machine Learning (Information Science and Statistics)'', 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. The circular mean is one of the simplest examples of directional statistics and of statistics of non-Euclidean spaces. 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 arctan(1/2) = 26.565°. Moreover, with the arithmetic mean the circular variance is only defined ±180°.


Definition

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 In probability theory and statistics, variance is the expected value of the squared deviation from the mean of a random variable. The standard deviation (SD) is obtained as the square root of the variance. Variance is a measure of dispersion ...
of the angles: Convert all angles to corresponding points on the
unit circle In mathematics, a unit circle is a circle of unit radius—that is, a radius of 1. Frequently, especially in trigonometry, the unit circle is the circle of radius 1 centered at the origin (0, 0) in the Cartesian coordinate system in the Eucli ...
, e.g., \alpha to (\cos\alpha,\sin\alpha). That is, convert
polar coordinates In mathematics, the polar coordinate system specifies a given point (mathematics), point in a plane (mathematics), plane by using a distance and an angle as its two coordinate system, coordinates. These are *the point's distance from a reference ...
to
Cartesian coordinates In geometry, a Cartesian coordinate system (, ) in a plane is a coordinate system that specifies each point uniquely by a pair of real numbers called ''coordinates'', which are the signed distances to the point from two fixed perpendicular o ...
. Then compute the
arithmetic mean In mathematics and statistics, the arithmetic mean ( ), arithmetic average, or just the ''mean'' or ''average'' is the sum of a collection of numbers divided by the count of numbers in the collection. The collection is often a set of results fr ...
of these points. The resulting point will lie within the
unit disk In mathematics, the open unit disk (or disc) around ''P'' (where ''P'' is a given point in the plane), is the set of points whose distance from ''P'' is less than 1: :D_1(P) = \.\, The closed unit disk around ''P'' is the set of points whose d ...
but generally not on the unit circle. 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 \alpha_1,\dots,\alpha_n a common formula of the mean using the
atan2 In computing and mathematics, the function (mathematics), function atan2 is the 2-Argument of a function, argument arctangent. By definition, \theta = \operatorname(y, x) is the angle measure (in radians, with -\pi 0, \\ mu \arctan\left(\fr ...
variant of the
arctangent In mathematics, the inverse trigonometric functions (occasionally also called ''antitrigonometric'', ''cyclometric'', or ''arcus'' functions) are the inverse functions of the trigonometric functions, under suitably restricted domains. Specific ...
function is :\bar = \operatorname\left(\frac\sum_^n \sin\alpha_j, \frac\sum_^n \cos\alpha_j\right) = \operatorname\left(\sum_^n \sin\alpha_j, \sum_^n \cos\alpha_j\right)


Using complex arithmetic

An equivalent definition can be formulated using
complex number In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted , called the imaginary unit and satisfying the equation i^= -1; every complex number can be expressed in the for ...
s: :\bar = \arg\left(\frac\sum_^n \exp(i \cdot\alpha_j)\right) = \arg\left(\sum_^n \exp(i \cdot\alpha_j)\right) . In order to match the above derivation using arithmetic means of points, the sums would have to be divided by n. However, the scaling does not matter for \operatorname and \arg, thus it can be omitted. 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 z=\cos(\theta)+i\,\sin(\theta)=e^, where \theta is the measured angle. The mean resultant vector for the sample is then: :\overline=\frac\sum_^N z_n. The sample mean angle is then the
argument An argument is a series of sentences, statements, or propositions some of which are called premises and one is the conclusion. The purpose of an argument is to give reasons for one's conclusion via justification, explanation, and/or persu ...
of the mean resultant: :\overline=\operatorname(\overline). The length of the sample mean resultant vector is: :\overline=, \overline, and will have a value between 0 and 1. Thus the sample mean resultant vector can be represented as: :\overline=\overline\,e^. Similar calculations are also used to define the circular variance.


Properties

The circular mean, \bar * maximizes the
likelihood A likelihood function (often simply called the likelihood) measures how well a statistical model explains observed data by calculating the probability of seeing that data under different parameter values of the model. It is constructed from the j ...
of the mean parameter of the
von Mises distribution In probability theory and directional statistics, the Richard von Mises, von Mises distribution (also known as the circular normal distribution or the Andrey Nikolayevich Tikhonov, Tikhonov distribution) is a continuous probability distribution ...
and * minimizes the sum of a certain distance on the circle, more precisely ::\bar = \underset \sum_^n d(\alpha_j,\beta), \text d(\varphi,\beta) = 1-\cos(\varphi-\beta). :The distance d(\varphi,\beta) is equal to half the squared
Euclidean distance In mathematics, the Euclidean distance between two points in Euclidean space is the length of the line segment between them. It can be calculated from the Cartesian coordinates of the points using the Pythagorean theorem, and therefore is o ...
between the two points on the unit circle associated with \varphi and \beta.


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 arithmetic mean is now 125 degrees, which is the wrong answer, as it should be 5 degrees. The vector mean \bar \theta can be calculated in the following way, using the mean sine \bar s and the mean cosine \bar c \not = 0: :\bar s = \frac ( \sin (355^\circ) + \sin (5^\circ) + \sin (15^\circ) ) = \frac ( -0.087 + 0.087 + 0.259 ) \approx 0.086 :\bar c = \frac ( \cos (355^\circ) + \cos (5^\circ) + \cos (15^\circ) ) = \frac ( 0.996 + 0.996 + 0.966 ) \approx 0.986 : \bar \theta = \left. \begin \arctan \left( \frac \right) & \bar s > 0 ,\ \bar c > 0 \\ \arctan \left( \frac \right) + 180^\circ & \bar c < 0 \\ \arctan \left( \frac \right)+360^\circ & \bar s <0 ,\ \bar c >0 \end \right\} = \arctan \left( \frac \right) = \arctan (0.087) = 5^\circ.


Implementation

In this python code we use day hours to find circular average of them: import math def circular_mean(hours): # Convert hours to radians # To convert from hours to degrees, we need to # multiply hour by 360/24 = 15. radians = [math.radians(hour * 15) for hour in hours] # Calculate the sum of sin and cos values sin_sum = sum([math.sin(rad) for rad in radians]) cos_sum = sum([math.cos(rad) for rad in radians]) # Calculate the circular mean using arctan2 mean_rad = math.atan2(sin_sum, cos_sum) # Convert the mean back to hours mean_hour = (math.degrees(mean_rad) / 15) % 24 return mean_hour # Example usage: hours = , 12, 18mean_hour = circular_mean(hours) print("First Circular mean:", round(mean_hour, 2)) hours = , 12mean_hour = circular_mean(hours) print("Second Circular mean:", round(mean_hour, 2)) hours = , 0, 12, 12, 24mean_hour = circular_mean(hours) print("Third Circular mean:", round(mean_hour, 2))


Generalizations


Spherical mean


Weighted spherical mean

A weighted spherical mean can be defined based on spherical linear interpolation.


See also

*
Center of mass In physics, the center of mass of a distribution of mass in space (sometimes referred to as the barycenter or balance point) is the unique point at any given time where the weight function, weighted relative position (vector), position of the d ...
*
Centroid In mathematics and physics, the centroid, also known as geometric center or center of figure, of a plane figure or solid figure is the arithmetic mean position of all the points in the figure. The same definition extends to any object in n-d ...
* Circular distribution * Circular standard deviation * Directional statistics * Fréchet mean * Yamartino method


References


Further reading

* Jammalamadaka, S. Rao and SenGupta, A. (2001). ''Topics in Circular Statistics'', Section 1.3, World Scientific Press, Singapore. * {{cite book , last=Hotz , first=Thomas , title=Lecture Notes in Computer Science , chapter=Extrinsic vs Intrinsic Means on the Circle , publisher=Springer Berlin Heidelberg , publication-place=Berlin, Heidelberg , year=2013 , volume=8085 , pages=433–440 , isbn=978-3-642-40019-3 , doi=10.1007/978-3-642-40020-9_47 , issn=0302-9743


External links


Circular Values Math and Statistics with C++11
A C++11 infrastructure for circular values (angles, time-of-day, etc.) mathematics and statistics Means Directional statistics