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

FitTest() private method

private FitTest ( ) : void
return void
        public void FitTest()
        {
            int[] symbols = { 3, 5 };
            JointDistribution target = new JointDistribution(symbols);

            double[][] observations = 
            {
                new double[] { 0, 0 },
                new double[] { 1, 1 },
                new double[] { 2, 1 },
                new double[] { 0, 0 },
            };

            target.Fit(observations);

            double[] p = target.Frequencies;

            double actual;

            actual = target.ProbabilityMassFunction(new[] { 0, 0 });
            Assert.AreEqual(0.5, actual);

            actual = target.ProbabilityMassFunction(new[] { 1, 1 });
            Assert.AreEqual(0.25, actual);

            actual = target.ProbabilityMassFunction(new[] { 2, 1 });
            Assert.AreEqual(0.25, actual);
        }