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 }
public void LagsSeriesTest() { var test = EvenOddSeries(0, 1); var lags = TimeSeriesIndicator.LaggedSeries(1, test); Assert.AreEqual(50, test.Sum()); Assert.AreEqual(49d, lags.Sum()); }
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()); }
public void DifferencesSeries() { var test = EvenOddSeries(); double[] heads; var differencer = TimeSeriesIndicator.DifferenceSeries(1, test, out heads); Assert.AreEqual(-1, differencer.Sum()); }