Examples of GibbsAsk


Examples of aima.core.probability.bayes.approx.GibbsAsk

  public static void bayesGibbsAskDemo() {
    System.out.println("DEMO: Bayes Gibbs Ask N = " + NUM_SAMPLES);
    System.out.println("=====================");
    demoToothacheCavityCatchModel(new FiniteBayesModel(
        BayesNetExampleFactory.constructToothacheCavityCatchNetwork(),
        new BayesInferenceApproxAdapter(new GibbsAsk(), NUM_SAMPLES)));
    demoBurglaryAlarmModel(new FiniteBayesModel(
        BayesNetExampleFactory.constructBurglaryAlarmNetwork(),
        new BayesInferenceApproxAdapter(new GibbsAsk(), NUM_SAMPLES)));
    System.out.println("=====================");
  }
View Full Code Here

Examples of aima.core.probability.bayes.approx.GibbsAsk

    AssignmentProposition[] e = new AssignmentProposition[] { new AssignmentProposition(
        ExampleRV.SPRINKLER_RV, Boolean.TRUE) };
    MockRandomizer r = new MockRandomizer(new double[] { 0.5, 0.5, 0.5,
        0.5, 0.5, 0.5, 0.6, 0.5, 0.5, 0.6, 0.5, 0.5 });

    GibbsAsk ga = new GibbsAsk(r);

    double[] estimate = ga.gibbsAsk(
        new RandomVariable[] { ExampleRV.RAIN_RV }, e, bn, 3)
        .getValues();

    Assert.assertArrayEquals(new double[] { 0.3333333333333333,
        0.6666666666666666 }, estimate, DELTA_THRESHOLD);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.