public void calculate_variance_correctly()
        {
            var data = Enumerable.Range(1, 1000)
                       .Select(value => NextGaussain(r) * (5000.0 / value)).ToArray();

            var lastPoint = _strategy.ComputeStatsAndAnomalies(data, (0, int.MaxValue)).Last();
            var mean      = data.Average();
            var stdDev    = StdDev(data);

            (Math.Abs(lastPoint.Mean - mean) < 0.00001).ShouldBeTrue();
            (Math.Abs(lastPoint.StdDev - stdDev) < stdDev * 0.001).ShouldBeTrue();
        }
        public void doesn_t_ignore_anomalies_in_calculation_if_not_wanted()
        {
            var strategy  = new OnlineNormalStrategy(1.5, 1.5, 0.2, false);
            var data      = new[] { 1.0, 1.0, 1.0, 2.0, 1.0, 1.0, 1.0 };
            var lastPoint = strategy.ComputeStatsAndAnomalies(data, (0, int.MaxValue)).Last();

            var mean   = data.Average();
            var stdDev = StdDev(data);

            lastPoint.Mean.ShouldBe(mean);
            (Math.Abs(lastPoint.StdDev - stdDev) < stdDev * 0.001).ShouldBeTrue();
        }