Examples of likelihoodWeighting()


Examples of aima.core.probability.bayes.approx.LikelihoodWeighting.likelihoodWeighting()

    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.likelihoodWeighting()

    // 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
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.