Ejemplo n.º 1
0
        public void CumulativeSumTest()
        {
            var test = EvenOddSeries(0, 1, 50);
            var sums = TimeSeriesIndicator.CumulativeSum(test.ToList());

            Assert.AreEqual(25, test.Sum());
            Assert.AreEqual(625, sums.Sum()); // From excel
        }
Ejemplo n.º 2
0
        public void LagsSeriesTest()
        {
            var test = EvenOddSeries(0, 1);
            var lags = TimeSeriesIndicator.LaggedSeries(1, test);

            Assert.AreEqual(50, test.Sum());
            Assert.AreEqual(49d, lags.Sum());
        }
Ejemplo n.º 3
0
        public void UndifferencesSeries()
        {
            var test = EvenOddSeries();

            double[] heads;
            var      differencer = TimeSeriesIndicator.DifferenceSeries(1, test, out heads);

            Assert.AreEqual(test.Sum(), TimeSeriesIndicator.InverseDifferencedSeries(differencer, heads).Sum());
        }
Ejemplo n.º 4
0
        public void DifferencesSeries()
        {
            var test = EvenOddSeries();

            double[] heads;
            var      differencer = TimeSeriesIndicator.DifferenceSeries(1, test, out heads);

            Assert.AreEqual(-1, differencer.Sum());
        }