Accord.Tests.Statistics.MultivariateEmpiricalDistributionTest.WeightedEmpiricalDistributionConstructorTest3 C# (CSharp) Method

WeightedEmpiricalDistributionConstructorTest3() private method

private WeightedEmpiricalDistributionConstructorTest3 ( ) : void
return void
        public void WeightedEmpiricalDistributionConstructorTest3()
        {
            double[] weights = { 2, 1, 1, 1, 2, 3, 1, 3, 1, 1, 1, 1 };
            double[] samples = { 5, 1, 4, 1, 2, 3, 4, 3, 4, 3, 2, 3 };

            weights = weights.Divide(weights.Sum());

            var target = new MultivariateEmpiricalDistribution(samples.ToJagged(), weights);

            Assert.AreEqual(1.2377597081667415, target.Smoothing[0, 0]);
        }