Fit() 공개 메소드

Fits the underlying distribution to a given set of observations.
public Fit ( double observations, double weights ) : IDistribution
observations double The array of observations to fit the model against.
weights double The weight vector containing the weight for each of the samples.
리턴 IDistribution
        public void GenerationTest()
        {
            double prob = 0.5;
            int trials = 10000;

            BernoulliDistribution target = new BernoulliDistribution(prob);
            target.Fit(target.Generate(trials).Select(x => (double)x).ToArray());

            Assert.AreEqual(target.Mean, prob, 0.01);
        }