I wouldnt call this "high-level math". We are (mostly) average dudes confronted with
irritating interesting real-world problems.
This is the original challenge:
Peter Nachtwey said:
Here is a good one though and not too difficult, calculate the average wind direction when sampling every minute. Most of the time it will be easy because the wind will not come from the north but if it does it will come from 355 degrees some times and 05 degrees other times and the average is 180 which isn't right.
Should the direciton be weighted by the wind speed? How would you do that?
The challenge has been set without proper definitions.
It will be possible to calculate both average speed and average direction with or without weighting for each other.
I am sure there are proper terms for this, but since I dont know them I will suggest "average absolute wind speed", "average relative wind speed", "average absolute wind direction" and "average relative wind direction"
In practical terms, I can imagine a use for average absolute wind speed, average relative wind speed, and average relative wind direction. But I cannot see a use for average absolute direction. I might be wrong though.
Peter didnt tell us which one(s) we were supposed to find, or what conditions that apply so that we could deduce it by ourselves.
Average absolute wind speed ignores the direction. Simply sample the absolute wind speed value, and ignore the direction. Thus the problem of the 360 to 0 degrees transition becomes moot.
Average absolute wind direction ignores the speed. Simply sample the direction as x/y-vectors, assuming a fixed nominal wind speed. The "problem" of the 360 to 0 degrees transition disappears in the proces.
Average relative wind speed takes the direction into account. It is simple to sample as x/y-vectors, and then convert back to a speed and direction vector in the end. So both average speed and direction are calculated in one go. The "problem" of the 360 to 0 degrees transition disappears in the proces.
As to the average wind direction value, there are more serious problems to consider.
To take Peters example and change it a little, if the wind direction is 5 degrees half the time and 175 degrees the other half of the time, is the average direction then 90 degrees ? Mathematically yes, but in many practical applications certainly not.
I think this must be a classical statistics problem. If you have two peaks or in a set of sampled values, is the middle value between the two peaks representative or not ?
I think that a statistics person will answer that one shall first analyse the data to find out what characteristics are dominant, and then find what model matches the data best. A statistician will answer that the wind direction in the region was changing between 5 and 175 degrees. He would not say that the average was 90 degrees.