public void DataStream_must_calculate_alpha_from_halflife_and_collect_interval()
{
// according to http://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average
var expectedAlpha = 0.1;
// alpha = 2.0 / (1 + N)
var n = 19;
var halfLife = n / 2.8854;
var collectInterval = TimeSpan.FromSeconds(1);
var halfLifeDuration = TimeSpan.FromMilliseconds(halfLife * 1000);
var alpha = EWMA.CalculateAlpha(halfLifeDuration, collectInterval);
Assert.True(alpha >= expectedAlpha - 0.001 && alpha <= expectedAlpha + 0.001);
}