public void IncorrectBinCount()
 {
     Assert.That(() =>
     {
         var wb = new WittenBellProbabilityDistribution <string>(_fd, _fd.ObservedSamples.Count);
     }, Throws.TypeOf <ArgumentOutOfRangeException>());
 }
        public void NoSamples()
        {
            var wb = new WittenBellProbabilityDistribution <string>(new FrequencyDistribution <string>(), 1);

            Assert.That(wb["a"], Is.EqualTo(0));
            Assert.That(wb["b"], Is.EqualTo(0));
            Assert.That(wb["c"], Is.EqualTo(0));
        }
        public void ProbabilityTwoUnseen()
        {
            var wb = new WittenBellProbabilityDistribution <string>(_fd, _fd.ObservedSamples.Count + 2);

            Assert.That(wb["a"], Is.EqualTo(0.00952).Within(0.00001));
            Assert.That(wb["c"], Is.EqualTo(0.01904).Within(0.00001));
            Assert.That(wb["d"], Is.EqualTo(0.02857).Within(0.00001));
            Assert.That(wb["o"], Is.EqualTo(0.07619).Within(0.00001));
            Assert.That(wb["q"], Is.EqualTo(0.09523).Within(0.00001));

            Assert.That(wb["t"], Is.EqualTo(0.08095).Within(0.00001));
            Assert.That(wb["z"], Is.EqualTo(0.08095).Within(0.00001));
        }