Exemplo n.º 1
0
        public void MeanAndVariance()
        {
            DiscreteDistribution1 distribution = new DiscreteDistribution1(4);

            distribution[0] = 0.25;
            distribution[1] = 0.5;
            distribution[2] = 0.15;
            distribution[3] = 0.1;

            distribution.Update();

            Assert.AreEqual(1.1, distribution.Mean);
            Assert.AreEqual(0.79, distribution.Variance);
        }
Exemplo n.º 2
0
        public void Scale()
        {
            DiscreteDistribution1 distribution = new DiscreteDistribution1(4);

            distribution[0] = 0.25;
            distribution[1] = 0.25;
            distribution[2] = 0.25;
            distribution[3] = 0.25;

            distribution.Scale = 10.0;

            distribution.Update();

            Assert.AreEqual(15.0, distribution.Mean);
        }
Exemplo n.º 3
0
        public void Translate()
        {
            DiscreteDistribution1 distribution = new DiscreteDistribution1(4);

            distribution[0] = 0.25;
            distribution[1] = 0.25;
            distribution[2] = 0.25;
            distribution[3] = 0.25;

            distribution.Translate = -1.5;

            distribution.Update();

            Assert.AreEqual(0.0, distribution.Mean);
        }