Examples of LikelihoodWeighting


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

    System.out.println("DEMO: Bayes Likelihood Weighting N = "
        + NUM_SAMPLES);
    System.out.println("================================");
    demoToothacheCavityCatchModel(new FiniteBayesModel(
        BayesNetExampleFactory.constructToothacheCavityCatchNetwork(),
        new BayesInferenceApproxAdapter(new LikelihoodWeighting(),
            NUM_SAMPLES)));
    demoBurglaryAlarmModel(new FiniteBayesModel(
        BayesNetExampleFactory.constructBurglaryAlarmNetwork(),
        new BayesInferenceApproxAdapter(new LikelihoodWeighting(),
            NUM_SAMPLES)));
    System.out.println("================================");
  }
View Full Code Here

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

    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 });

    LikelihoodWeighting lw = new LikelihoodWeighting(r);

    double[] estimate = lw.likelihoodWeighting(
        new RandomVariable[] { ExampleRV.RAIN_RV }, e, bn, 1000)
        .getValues();

    Assert.assertArrayEquals(new double[] { 1.0, 0.0 }, estimate,
        DELTA_THRESHOLD);
View Full Code Here

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

    // sample P(Sprinkler | Cloudy = true) = <0.1, 0.9>; suppose
    // Sprinkler=false
    // sample P(Rain | Cloudy = true) = <0.8, 0.2>; suppose Rain=true
    MockRandomizer r = new MockRandomizer(new double[] { 0.5, 0.5 });

    LikelihoodWeighting lw = new LikelihoodWeighting(r);
    double[] estimate = lw.likelihoodWeighting(
        new RandomVariable[] { ExampleRV.RAIN_RV }, e, bn, 1)
        .getValues();

    // Here the event [true,false,true,true] should have weight 0.45,
    // and this is tallied under Rain = true, which when normalized
View Full Code Here

Examples of edu.gmu.seor.prognos.unbbayesplugin.cps.lw.LikelihoodWeighting

        EDBUnit e = EDB.This().get("ROOT.ENGINES.LW");
        e.removeAllChildren();
        EDBUnit nodesE = e.create("NODES");
        nodesE.copy(EDB.This().get("ROOT.NODES"));
       
        LikelihoodWeighting LW =  new LikelihoodWeighting();
        LW.run(strChild2);
      }else     
      if( strChild1.equalsIgnoreCase("JT") ){
        EDB.This().get("ROOT.NET_INFO.CURRENT_ENGINE").setData("JT");
        EDBUnit e = EDB.This().get("ROOT.ENGINES.JT");
        e.removeAllChildren();
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.