use of edu.cmu.tetrad.data.IndependenceFacts in project tetrad by cmu-phil.
the class TestIndependenceFacts method test1.
@Test
public void test1() {
IndependenceFactsModel facts = new IndependenceFactsModel();
Node x1 = new GraphNode("X1");
Node x2 = new GraphNode("X2");
Node x3 = new GraphNode("X3");
Node x4 = new GraphNode("X4");
Node x5 = new GraphNode("X5");
Node x6 = new GraphNode("X6");
facts.add(new IndependenceFact(x1, x2, x3));
facts.add(new IndependenceFact(x2, x3));
facts.add(new IndependenceFact(x2, x4, x1, x2));
facts.add(new IndependenceFact(x2, x4, x1, x3, x5));
facts.add(new IndependenceFact(x2, x4, x3));
facts.add(new IndependenceFact(x2, x4, x3, x6));
facts.remove(new IndependenceFact(x1, x2, x3));
IndependenceFacts _facts = new IndependenceFacts(facts.getFacts());
assertTrue(_facts.isIndependent(x4, x2, x1, x2));
assertTrue(_facts.isIndependent(x4, x2, x5, x3, x1));
List<Node> l = new ArrayList<>();
l.add(x1);
l.add(x2);
assertTrue(_facts.isIndependent(x4, x2, l));
}
Aggregations