Examples of rejectionSampling()


Examples of aima.core.probability.bayes.approx.RejectionSampling.rejectionSampling()

    AssignmentProposition[] e = new AssignmentProposition[] { new AssignmentProposition(
        ExampleRV.SPRINKLER_RV, Boolean.TRUE) };
    MockRandomizer r = new MockRandomizer(new double[] { 0.1 });
    RejectionSampling rs = new RejectionSampling(new PriorSample(r));

    double[] estimate = rs.rejectionSampling(
        new RandomVariable[] { ExampleRV.RAIN_RV }, e, bn, 100)
        .getValues();

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

Examples of aima.core.probability.bayes.approx.RejectionSampling.rejectionSampling()

      }
    }
    MockRandomizer r = new MockRandomizer(ma);
    RejectionSampling rs = new RejectionSampling(new PriorSample(r));

    double[] estimate = rs.rejectionSampling(
        new RandomVariable[] { ExampleRV.RAIN_RV }, e, bn, 100)
        .getValues();

    Assert.assertArrayEquals(new double[] { 0.2962962962962963,
        0.7037037037037037 }, 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.