-3

I would like to calculate the variance of angles. The problem is that angels are cyclic.

Variance{0°,0°,0°,0°,360°,360°,360°,360°} = 32400 - should be 0.

Variance{0°,0°,0°,0°,90°,90°,90°,90°} = 2025 - correct.

You get the idea...

Is there a proper way to compute this?

Community
  • 1
  • 1
Gilad
  • 2,876
  • 5
  • 29
  • 40

3 Answers3

1

The typical moments you know about (expectation, (co)variance, etc.) are defined for random variables whose support is Euclidean space (Rn). Your random variables support is not Euclidean space. Expectation and variance are not defined (at least not in the usual way).

Take for example this set: { 0, π, 0, π, 0, π, ... }. These are 2N samples of the random angle variable A. What is the expectation of A, E[A]? π/2 or 3π/2?

You need to adjust your question to make sense, either by asking for something different, or by explicitly defining what you mean by variance.

Timothy Shields
  • 75,459
  • 18
  • 120
  • 173
0

You cannot do this directly. This because with angles 0=360 and such.

What I have done before is do statistics on points (x,y) = (COS(φ),SIN(φ)) and then converting back to angle with φ = ATAN2(y, x).

John Alexiou
  • 28,472
  • 11
  • 77
  • 133
0

The usual way is to convert the angles to complex numbers on the unit circle, average them, and take the argument as the average angle. This gives you the mean angle, from which you can compute the variance normally (but remember to add or subtract 360 degrees until the difference is in the range (-180 degrees, 180 degrees) before squaring).

Charles
  • 11,269
  • 13
  • 67
  • 105