The Yamartino method is an algorithm for calculating an approximation of the circular variance of wind direction during a single pass through the incoming data.[1]
The simple method for calculating circular variance requires two passes through the list of values. The first pass determines the circular mean of those values, while the second pass determines the variance. This double-pass method requires access to all values.
There is also a single-pass method for calculating the standard deviation, but this method is unsuitable for angular data such as wind direction. Trying to calculate angular moments by naively applying the standard formulas to angular expressions yields absurd results. For example, a dataset that measures wind speeds of 1° and 359° would average to 180°, but expressing the same data as 1° and -1° (equal to 359°) would give an average of 0°. Thus, we define circular moments by placing all measured angles on a unit circle, then calculating the moments of these points.
The Yamartino method, introduced by Robert J. Yamartino in 1984, solves both problems[2] A further discussion of the Yamartino method, along with other methods of estimating the standard deviation of wind direction can be found in Farrugia & Micallef.
It is possible to calculate the exact standard deviation in one pass. However, that method needs slightly more calculation effort.
Over the time interval to be averaged across, n measurements of wind direction (θ) will be made and two totals are accumulated without storage of the n individual values. At the end of the interval the calculations are as follows: with the average values of sin θ and cos θ defined as
sa=
1 | |
n |
n | |
\sum | |
i=1 |
\sin\thetai,
ca=
1 | |
n |
n | |
\sum | |
i=1 |
\cos\thetai.
Then the average wind direction is given via the four-quadrant arctan(x,y) function as
\thetaa=\arctan(ca,sa).
From twenty different functions for σθ using variables obtained in a single-pass of the wind direction data, Yamartino found the best function to be
\sigma\theta=\arcsin(\varepsilon)\left[1+\left(\tfrac2{\sqrt3}-1\right)\varepsilon3\right],
where
2 | |
\varepsilon=\sqrt{1-(s | |
a)}. |
The key here is to remember that sin2θ + cos2θ = 1 so that for example, with a constant wind direction at any value of θ, the value of
\varepsilon
\varepsilon
\tfrac{\pi}{2}
\tfrac{\pi}{\sqrt{3}}
The theoretical maximum error against the correct double-pass σθ is therefore about 15% with an oscillating wind. Comparisons against Monte Carlo generated cases indicate that Yamartino's algorithm is within 2% for more realistic distributions.
A variant might be to weight each wind direction observation by the wind speed at that time.