use of edu.cmu.tetrad.search.FgesOrienter in project tetrad by cmu-phil.
the class Mmhc method search.
/**
* Runs PC starting with a fully connected graph over all of the variables in the domain of the independence test.
*/
public Graph search() {
List<Node> variables = independenceTest.getVariables();
Mmmb mmmb = new Mmmb(independenceTest, getDepth(), true);
Map<Node, List<Node>> pc = new HashMap<>();
for (Node x : variables) {
pc.put(x, mmmb.getPc(x));
}
Graph graph = new EdgeListGraph();
for (Node x : variables) {
graph.addNode(x);
}
for (Node x : variables) {
for (Node y : pc.get(x)) {
if (!graph.isAdjacentTo(x, y)) {
graph.addUndirectedEdge(x, y);
}
}
}
FgesOrienter orienter = new FgesOrienter(data);
orienter.orient(graph);
return graph;
}
Aggregations