public void LinearTest()
        {
            var info = Aproximation.Linear(new double[] { -5, 23.2 }, new double[] { -6, 25 });

            Assert.AreEqual(-5.0354610e-1, info.Rates[0], 1e-6);
            Assert.AreEqual(1.0992908, info.Rates[1], 1e-6);
            Assert.AreEqual(1.776e-15, info.Error, 1e-15);
            Assert.AreEqual(1.776e-15, info.Sigma, 1e-15);
        }
예제 #2
0
        public void LinearMoreDataTest()
        {
            var info = Aproximation.Linear(new double[] { -5, 23.2, 25, 45, 50 }, new double[] { -6, 25, 32, 45, 50 });

            Assert.AreEqual(1.4699587, info.Rates[0], 1e-6);
            Assert.AreEqual(1.0032576, info.Rates[1], 1e-6);
            Assert.AreEqual(5.449, info.Error, 1e-3);
            Assert.AreEqual(3.204, info.Sigma, 1e-3);
        }
        public void LinearErrorTest()
        {
            var info = Aproximation.Linear(new double[] { -5, 23.2, 25, 45 }, new double[] { -6, 25, 32, 45 });

            Assert.AreEqual(1.0848135, info.Rates[0], 1e-6);
            Assert.AreEqual(1.0392375, info.Rates[1], 1e-6);
            Assert.AreEqual(4.934, info.Error, 0.001);
            Assert.AreEqual(3.468, info.Sigma, 0.001);
        }