Examples of PriorSample


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

    BayesianNetwork bn = BayesNetExampleFactory
        .constructCloudySprinklerRainWetGrassNetwork();
    MockRandomizer r = new MockRandomizer(
        new double[] { 0.5, 0.5, 0.5, 0.5 });

    PriorSample ps = new PriorSample(r);
    Map<RandomVariable, Object> event = ps.priorSample(bn);

    Assert.assertEquals(4, event.keySet().size());
    Assert.assertEquals(Boolean.TRUE, event.get(ExampleRV.CLOUDY_RV));
    Assert.assertEquals(Boolean.FALSE, event.get(ExampleRV.SPRINKLER_RV));
    Assert.assertEquals(Boolean.TRUE, event.get(ExampleRV.RAIN_RV));
View Full Code Here

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

    BayesianNetwork bn = BayesNetExampleFactory
        .constructCloudySprinklerRainWetGrassNetwork();
    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();
View Full Code Here

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

        ma[i + 3] = 0.1; // i.e. WetGrass=true
      }
    }
    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();
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.