Package aima.core.probability.bayes

Examples of aima.core.probability.bayes.BayesianNetwork


public class PriorSampleTest {

  @Test
  public void testPriorSample_basic() {
    // AIMA3e pg. 530
    BayesianNetwork bn = BayesNetExampleFactory
        .constructCloudySprinklerRainWetGrassNetwork();
    MockRandomizer r = new MockRandomizer(
        new double[] { 0.5, 0.5, 0.5, 0.5 });

    PriorSample ps = new PriorSample(r);
View Full Code Here


  public static final double DELTA_THRESHOLD = ProbabilityModel.DEFAULT_ROUNDING_THRESHOLD;

  @Test
  public void testLikelihoodWeighting_basic() {
    BayesianNetwork bn = BayesNetExampleFactory
        .constructCloudySprinklerRainWetGrassNetwork();
    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 });
View Full Code Here

  @Test
  public void testLikelihoodWeighting_AIMA3e_pg533() {
    // AIMA3e pg. 533
    // <b>P</b>(Rain | Cloudy = true, WetGrass = true)
    BayesianNetwork bn = BayesNetExampleFactory
        .constructCloudySprinklerRainWetGrassNetwork();
    AssignmentProposition[] e = new AssignmentProposition[] {
        new AssignmentProposition(ExampleRV.CLOUDY_RV, Boolean.TRUE),
        new AssignmentProposition(ExampleRV.WET_GRASS_RV, Boolean.TRUE) };
    // sample P(Sprinkler | Cloudy = true) = <0.1, 0.9>; suppose
View Full Code Here

  public abstract void setUp();

  @Test
  public void testInferenceOnToothacheCavityCatchNetwork() {
    BayesianNetwork bn = BayesNetExampleFactory
        .constructToothacheCavityCatchNetwork();

    CategoricalDistribution d = bayesInference.ask(
        new RandomVariable[] { ExampleRV.CAVITY_RV },
        new AssignmentProposition[] {}, bn);
View Full Code Here

        ProbabilityModel.DEFAULT_ROUNDING_THRESHOLD);
  }

  @Test
  public void testInferenceOnBurglaryAlarmNetwork() {
    BayesianNetwork bn = BayesNetExampleFactory
        .constructBurglaryAlarmNetwork();

    // AIMA3e. pg. 514
    CategoricalDistribution d = bayesInference
        .ask(new RandomVariable[] { ExampleRV.ALARM_RV },
View Full Code Here

public class GibbsAskTest {
  public static final double DELTA_THRESHOLD = ProbabilityModel.DEFAULT_ROUNDING_THRESHOLD;

  @Test
  public void testGibbsAsk_basic() {
    BayesianNetwork bn = BayesNetExampleFactory
        .constructCloudySprinklerRainWetGrassNetwork();
    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 });
View Full Code Here

  public static final double DELTA_THRESHOLD = ProbabilityModel.DEFAULT_ROUNDING_THRESHOLD;

  @Test
  public void testPriorSample_basic() {

    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));
View Full Code Here

  @Test
  public void testRejectionSampling_AIMA3e_pg532() {
    // AIMA3e pg. 532

    BayesianNetwork bn = BayesNetExampleFactory
        .constructCloudySprinklerRainWetGrassNetwork();
    AssignmentProposition[] e = new AssignmentProposition[] { new AssignmentProposition(
        ExampleRV.SPRINKLER_RV, Boolean.TRUE) };

    // 400 required as 4 variables and 100 samples planned
View Full Code Here

TOP

Related Classes of aima.core.probability.bayes.BayesianNetwork

Copyright © 2018 www.massapicom. 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.