Accord.Tests.Statistics.AndersonDarlingTestTest.AndersonDarlingConstructorTest2 C# (CSharp) Method

AndersonDarlingConstructorTest2() private method

private AndersonDarlingConstructorTest2 ( ) : void
return void
        public void AndersonDarlingConstructorTest2()
        {
            // Test against a Normal distribution

            // This time, let's see if the same sample from the previous example
            // could have originated from a standard Normal (Gaussian) distribution.
            //
            double[] sample =
            { 
                0.621, 0.503, 0.203, 0.477, 0.710, 0.581, 0.329, 0.480, 0.554, 0.382
            };

            NormalDistribution distribution = NormalDistribution.Estimate(sample);

            var adtest = new AndersonDarlingTest(sample, distribution);

            double statistic = adtest.Statistic; // 0.1796
            double pvalue = adtest.PValue; // 0.8884

            bool significant = adtest.Significant; // false

         

            Assert.AreEqual(distribution, adtest.TheoreticalDistribution);
            Assert.AreEqual(DistributionTail.TwoTail, adtest.Tail);

            Assert.AreEqual(0.1796, adtest.Statistic, 1e-4);
            Assert.AreEqual(0.8884, adtest.PValue, 1e-4);
            Assert.IsFalse(Double.IsNaN(adtest.Statistic));

            Assert.IsFalse(adtest.Significant);
        }