Search in sources :

Example 1 with Evidence

use of edu.cmu.tetrad.bayes.Evidence in project tetrad by cmu-phil.

the class TestEvidence method testUpdate1.

/**
 * Richard's 2-variable example worked by hand.
 */
@Test
public void testUpdate1() {
    BayesIm bayesIm = sampleBayesIm2();
    Evidence evidence = Evidence.tautology(bayesIm);
    evidence.getProposition().removeCategory(0, 1);
    evidence.getProposition().setVariable(1, false);
    evidence.setManipulated(0, true);
    Evidence evidence2 = new Evidence(evidence, bayesIm);
    assertEquals(evidence2, evidence);
    assertEquals(evidence, new Evidence(evidence));
    BayesIm bayesIm2 = new MlBayesIm(bayesIm);
    Evidence evidence3 = new Evidence(evidence, bayesIm2);
    assertTrue(!(evidence3.equals(evidence2)));
}
Also used : MlBayesIm(edu.cmu.tetrad.bayes.MlBayesIm) BayesIm(edu.cmu.tetrad.bayes.BayesIm) MlBayesIm(edu.cmu.tetrad.bayes.MlBayesIm) Evidence(edu.cmu.tetrad.bayes.Evidence) Test(org.junit.Test)

Aggregations

BayesIm (edu.cmu.tetrad.bayes.BayesIm)1 Evidence (edu.cmu.tetrad.bayes.Evidence)1 MlBayesIm (edu.cmu.tetrad.bayes.MlBayesIm)1 Test (org.junit.Test)1