Beispiel #1
0
        public void GenerateTest3()
        {
            Accord.Math.Random.Generator.Seed = 0;
            InverseGaussianDistribution target = new InverseGaussianDistribution(4, 2);

            double[] samples = new double[10000000];
            for (int i = 0; i < samples.Length; i++)
            {
                samples[i] = target.Generate();
            }

            var actual = InverseGaussianDistribution.Estimate(samples);

            actual.Fit(samples);

            Assert.AreEqual(4, actual.Mean, 1e-2);
            Assert.AreEqual(2, actual.Shape, 1e-3);
        }