示例#1
0
        public void CorrelationSame()
        {
            TimeSeries lts         = TimeSeries.CreateDailyLinearTimeSeries(0, 1, new DateTime(2000, 1, 1), new DateTime(2000, 12, 31));
            double     correlation = TimeSeriesCorrelation.GetCorrelationBetween(lts, lts);

            Assert.IsTrue(Math.Abs(correlation - 1) < tolerance);
        }
示例#2
0
        public void CorrelationMultiply()
        {
            TimeSeries lts         = TimeSeries.CreateDailySinusoidalTimeSeries(1, 1, 1, new DateTime(2000, 1, 1), new DateTime(2000, 12, 31));
            TimeSeries lts2        = lts.MultiplyBy(2);
            double     correlation = TimeSeriesCorrelation.GetCorrelationBetween(lts, lts2);

            Assert.IsTrue(Math.Abs(correlation - 1) < tolerance);
        }