Funny problem. How to average over periodic numbers

106 Views Asked by At

I'm want to calculate the average day and respective month that a specific event happens in a sample of countries. So for each country I have the date (one per year) of the particular event. Now my problem is that this event happens, for example, during the winter in some countries, while for other during summer. The variability from year to year can be some months, so for example in the year 2000 can happen at November, do not take place at 2001 but rather at 2002 in January. I first though: ok, lets calculate the number of days that have passed from the first day of the year, in case the date is before August, and the number of days that are still to come until the end of the year, for the case the date is after August (being these last ones negative numbers). This works for the countries where the event happens always in winter. But for those that happen in summer it doesn't. Because, for example, I can have an event at June, that averaged with an event that happens in September, will give an average of something like April (because of the negative values of the September event), instead of August. So, my question is: is there a simple and clever way to solve this problem? I must then code this.

1

There are 1 best solutions below

4
On

This has come up many times on this site in the context of averaging angles. One response is here. About the best you can do is find a central date for each event and average the days from then. For a summer event, maybe the central date is August 1, and you count days to the closest of those. Maybe the central date has to vary by country.