Esempio 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
        }
Esempio 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());
        }
Esempio 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());
        }
Esempio n. 4
0
        public void DifferencesSeries()
        {
            var test = EvenOddSeries();

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

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