Exemple #1
0
        public static void Mouse()
        {
            BaseAnimalModel.AnimalModelData MousePriors = new BaseAnimalModel.AnimalModelData(
                new Gaussian(5.5, 2.22),
                new Gaussian(0.0195, 0.000004),
                new Gaussian(0.001141552511, 0.0000000225)
                );

            InferenceEngine engine = new InferenceEngine();

            BaseAnimalModel Mouse = new BaseAnimalModel();

            Mouse.CreateModel();
            Mouse.SetModelData(MousePriors);
            Mouse.SetNewPopulation(100);

            Gaussian BornYoung = engine.Infer <Gaussian>(Mouse.GetBornYoung(0.5));

            Console.WriteLine(
                "Mouse BornYoung Mean: {0:f10}, Standard Deviation: {1:f10}",
                BornYoung.GetMean(),
                Math.Sqrt(BornYoung.GetVariance())
                );

            Gaussian NaturalDeath = engine.Infer <Gaussian>(Mouse.GetNaturalDeath());

            Console.WriteLine(
                "Mouse NaturalDeath Mean: {0:f10}, Standard Deviation: {1:f10}",
                NaturalDeath.GetMean(),
                Math.Sqrt(NaturalDeath.GetVariance())
                );
        }
Exemple #2
0
        public virtual void CreateModel()
        {
            Mouse = new BaseAnimalModel();
            Cat   = new CatModel();

            Mouse.CreateModel();
            Cat.CreateModel();
        }