예제 #1
0
        public void NoSamples()
        {
            var ml = new MaxLikelihoodProbabilityDistribution <string>(new FrequencyDistribution <string>());

            Assert.That(ml["a"], Is.EqualTo(0));
            Assert.That(ml["b"], Is.EqualTo(0));
            Assert.That(ml["c"], Is.EqualTo(0));
        }
예제 #2
0
        public void Probability()
        {
            var ml = new MaxLikelihoodProbabilityDistribution <string>(_fd);

            Assert.That(ml["a"], Is.EqualTo(0.01136).Within(0.00001));
            Assert.That(ml["c"], Is.EqualTo(0.02272).Within(0.00001));
            Assert.That(ml["d"], Is.EqualTo(0.03409).Within(0.00001));
            Assert.That(ml["o"], Is.EqualTo(0.09090).Within(0.00001));
            Assert.That(ml["q"], Is.EqualTo(0.11363).Within(0.00001));

            Assert.That(ml["t"], Is.EqualTo(0));
            Assert.That(ml["z"], Is.EqualTo(0));
        }