Accord.Tests.Statistics.GeometricDistributionTest.FitTest2 C# (CSharp) Method

FitTest2() private method

private FitTest2 ( ) : void
return void
        public void FitTest2()
        {
            double successProbability = 0;
            GeometricDistribution target = new GeometricDistribution(successProbability);

            double[] observations = { 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0 };
            double[] weights = { 0, 1, 1, 2, 0, 2, 1, 0, 0, 0, 1, 0 };
            weights = weights.Divide(weights.Sum());
            IFittingOptions options = null;

            target.Fit(observations, weights, options);

            Assert.AreEqual(1 / (1 - 4.0 / 8.0), target.ProbabilityOfSuccess);
        }