Accord.Tests.Statistics.JointDistributionTest.FitTest6 C# (CSharp) Method

FitTest6() private method

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

            JointDistribution target;

            double[] values = { 0.00, 2.00, 3.00 };
            double[] weights = { 0.50, 0.25, 0.25 };
            target = new JointDistribution(new[] { 4 });
            target.Fit(Jagged.ColumnVector(values), 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 JointDistribution(new[] { 4 });
            target.Fit(Jagged.ColumnVector(values2), weights2);
            double[] actual2 = target.Frequencies;
            Assert.IsTrue(Matrix.IsEqual(expected, actual2));
        }