When averaging two times, yes, it's silly. But when averaging more than two, it comes out with a very different result.
... # your code thru the definition of sub circ_avg; print "@times"; print " => circle vs line"; print " => @{[angle2time circ_avg time2angle @times]} vs @{ +[angle2time( sum( time2angle @times ) / @times ) ]}"; for (; @times > 1; shift @times) { my @t = @times[0, 1]; print "@t => @{[angle2time circ_avg time2angle @t]} vs @{[angle2ti +me( sum( time2angle @t ) / @t ) ]}"; } __END__ __OUTPUT__ 17:00 19:00 11:00 13:00 23:00 01:00 10:30 13:00 19:40 01:20 16:00 02:0 +0 => circle vs line => 17:46 vs 12:12 17:00 19:00 => 18:00 vs 18:00 19:00 11:00 => 15:00 vs 15:00 11:00 13:00 => 12:00 vs 12:00 13:00 23:00 => 18:00 vs 18:00 23:00 01:00 => 00:00 vs 12:00 01:00 10:30 => 05:45 vs 05:45 10:30 13:00 => 11:45 vs 11:45 13:00 19:40 => 16:20 vs 16:20 19:40 01:20 => 22:30 vs 10:30 01:20 16:00 => 20:40 vs 08:40 16:00 02:00 => 21:00 vs 09:00
The pairs of times come out to a simple average that mostly matches the circles (except on the ones with midnight between time1 and time2); but you get very different results between the two averages for the entire list. Previously, I had compared my own implementation of the angular average (yours is better) to the results of salva's solution of finding the center-with-minimum-variance and found that the results for salva's example list (or a list of random times) gave very similar means to the angular average, which would be very different from the arithmetic mean for the same set of data
In reply to Re^3: Average start time handling midnight
by pryrt
in thread Average start time handling midnight
by chrisjej
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |