Accord.Tests.Statistics.DiscreteDistributionTest.FitTest4 C# (CSharp) Method

FitTest4() private method

private FitTest4 ( ) : void
return void
        public void FitTest4()
        {
            double[] expected = { 0.50, 0.00, 0.25, 0.25 };

            GeneralDiscreteDistribution target;

            double[] values = { 0.00, 2.00, 3.00 };
            double[] weights = { 0.50, 0.25, 0.25 };
            target = new GeneralDiscreteDistribution(-1, 4);
            target.Fit(values.Subtract(1), weights);
            double[] actual = target.Frequencies;

            Assert.IsTrue(Matrix.IsEqual(expected, actual));

            // --

            double[] values2 = { 0.00, 0.00, 2.00, 3.00 };
            double[] weights2 = { 0.25, 0.25, 0.25, 0.25 };
            target = new GeneralDiscreteDistribution(-1, 4);
            target.Fit(values2.Subtract(1), weights2);
            double[] actual2 = target.Frequencies;
            Assert.IsTrue(Matrix.IsEqual(expected, actual2));
        }