You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, for example, if you have a time-series with samples once per second, and you want to get the moving average over the previous minute, you should use an alpha of .032786885. This, by the way, is the constant alpha used for this repository's SimpleEWMA.
That alpha corresponds to N = 60, 2/(N+1) = 2/61 = .032786885.
The readme says
That alpha corresponds to N = 60, 2/(N+1) = 2/61 = .032786885.
The actual code uses 2/31:
ewma/ewma.go
Lines 8 to 14 in 487e8c9
The readme may be using N with two different meanings in the section on "Choosing Alpha", but I don't think so. I think 2/31 is incorrect.
The comment in the code is also inconsistent with the readme. The readme talks about "N samples", whereas the code talks about "average age".
It's certainly possible I'm misunderstanding something.
The text was updated successfully, but these errors were encountered: