Angles and cycles: periodic variables and the von Mises distribution
10 questions on periodic variables such as angles and times of day, why ordinary averages fail, unit-vector averaging and the von Mises distribution.
- 10 questions
- Stopwatch
- Instant feedback
Sample questions
Play now ↑Answers stay hidden. Start the quiz to play them.
Sample 1
Two events happen at 23:50 and 00:10. What does the ordinary arithmetic average of the two times, treated as numbers of hours, give?
- 12:00, noon, the opposite time of day, which is clearly wrong
- 00:00, midnight, which is the sensible answer
- 23:50
Sample 2
Where does the average of several unit arrows typically lie?
- Exactly on the circle
- Inside the circle, closer to the centre the more the directions are spread out
- Outside the circle
How it works
- One question per screen. An answer is final once sent.
- You see right away whether you were right, with a short explanation.
- The stopwatch runs: on equal scores, the faster player ranks first.
- Only your best attempt counts, so replaying is never risky.
About this quiz
What is the average of a train that leaves ten minutes before midnight and one that leaves ten minutes after? Anyone looking at a clock says midnight. A computer that adds the two times, 23:50 and 00:10, as numbers and divides by two says something quite different. The mistake is not a bug. It is what happens when a quantity that wraps around is treated as an ordinary number. Directions, times of day, days of the year, phases of a signal and the orientation of a molecule all wrap around, and the standard tools of statistics quietly give nonsense when applied to them without care.
This quiz is about why wrap-around quantities need their own treatment and how it is done. You will see that the trouble is deeper than a poor choice of average: the answer you get from an ordinary Gaussian model depends on where you decide to place the origin of the scale, which is arbitrary and shouldn't matter at all. The remedy is to represent each angle as a point on a circle, average the points as arrows, and read off the angle of the result. You will see what that average looks like and where it lies.
The second part introduces the standard distribution for angles, called the von Mises or circular normal distribution. It plays the role of the Gaussian for quantities on a circle. It has a centre and a measure of how tightly values cluster around it, and under the right conditions it behaves just like a Gaussian. Like the Gaussian it has a single peak, so for angles with several favoured directions, such as the two daily peaks of traffic, it has to be combined into mixtures. The quiz also reviews what any valid density over an angle must satisfy.
Common errors to watch for are the naive average of angles, using the standard deviation of raw angles as a measure of spread, and assuming that a model gives the same answer wherever the angle scale starts. Another is to treat the problem as an exotic special case, when cyclic quantities are in fact extremely common in real data, from seasonal sales to the hours at which patients arrive. The same difficulty arises well beyond compasses. Hue on a colour wheel, the phase of an audio signal, the dihedral angles that describe the shape of a protein and the hour at which an event happens all wrap around, so the lessons here apply whenever a feature has no natural start or end.
The quiz suits students and practitioners who work with directions, clocks or seasons. No trigonometry is needed. There are 10 questions, each explained after you answer, and the quiz takes about four minutes.
Questions and answers
›How long does the quiz take?
About 3 to 4 minutes for 10 questions, at roughly 20 seconds each. An explanation appears after every answer.
›Do I need to know trigonometry?
No. The key idea is geometric: an angle is a point on a circle, and a list of angles is a cloud of points on that circle. The questions ask what you would expect from that picture and never require sines or cosines.
›What is a periodic variable?
It is a quantity whose scale wraps around, so that the end connects back to the beginning. Wind direction, the time of day and the day of the year are common examples. They are usually described by an angle between zero and a full turn. Periodic quantities appear in many data sets without being recognised as such, for example the hour at which a purchase was made or the day of the year of a sale.
›Why does an ordinary average fail for angles?
Because 23:50 and 00:10 are far apart on a number line but only twenty minutes apart on a clock. Ordinary statistics measure distance along the line, so the result changes if you start the scale in a different place. A meaningful answer shouldn't depend on where the scale starts.
›How do you average angles correctly?
Treat each angle as an arrow of length one pointing in that direction, add the arrows up, and take the direction of the total. The result doesn't depend on where the angle scale starts. It is the same answer that maximum likelihood gives under the standard distribution for angles. When such a feature is fed to an ordinary model, a common remedy is to replace the angle by two numbers, its cosine and its sine, so that the end of the scale meets the start. That is the same arrow picture used in this quiz, and it avoids a sudden jump between 359 and 1 degrees.
›What is the von Mises distribution?
It is a bell-shaped distribution on a circle, sometimes called the circular normal. Its two parameters describe the direction of its peak and how strongly values concentrate around it. It can be derived from a two-dimensional Gaussian by looking only at values on a circle.
›How is the concentration parameter related to the variance?
It plays the part of a quantity you already know from the Gaussian. A large value means values are tightly bunched around the preferred direction, and a value near zero means every direction is almost equally likely.
›What if the angles have several preferred directions?
A single von Mises distribution has one peak, just as a Gaussian does. For data with several preferred directions, such as morning and evening peaks in a daily cycle, a mixture of several von Mises components gives a flexible model.