use of edu.cmu.tetrad.search.Lingam in project tetrad by cmu-phil.
the class LingamStructureRunner method execute.
// ============================PUBLIC METHODS==========================//
/**
* Executes the algorithm, producing (at least) a result workbench. Must be
* implemented in the extending class.
*/
public void execute() {
DataModel source = getDataModel();
if (!(source instanceof DataSet)) {
throw new IllegalArgumentException("Expecting a rectangular data set.");
}
DataSet data = (DataSet) source;
if (!data.isContinuous()) {
throw new IllegalArgumentException("Expecting a continuous data set.");
}
// Lingam_old lingam = new Lingam_old();
// lingam.setAlternativePenalty(getParameters().getAlternativePenalty());
// lingam.setPruningDone(true);
// lingam.setAlternativePenalty(getParameters().getAlternativePenalty());
// GraphWithParameters result = lingam.lingam(data);
// Graph graph = result.getGraph();
Lingam lingam = new Lingam();
Parameters params = getParams();
Graph graph = lingam.search(data);
setResultGraph(graph);
if (getSourceGraph() != null) {
GraphUtils.arrangeBySourceGraph(graph, getSourceGraph());
} else {
GraphUtils.circleLayout(graph, 200, 200, 150);
}
}
use of edu.cmu.tetrad.search.Lingam in project tetrad by cmu-phil.
the class LingamRunner method execute.
// ============================PUBLIC METHODS==========================//
/**
* Executes the algorithm, producing (at least) a result workbench. Must be
* implemented in the extending class.
*/
public void execute() {
DataModel source = getDataModel();
if (!(source instanceof DataSet)) {
throw new IllegalArgumentException("Expecting a rectangular data set.");
}
DataSet data = (DataSet) source;
if (!data.isContinuous()) {
throw new IllegalArgumentException("Expecting a continuous data set.");
}
// Lingam_old lingam = new Lingam_old();
// lingam.setAlternativePenalty(getParameters().getAlternativePenalty());
// lingam.setPruningDone(true);
//
// double lingamPruningAlpha = Preferences.userRoot().getDouble("lingamPruningAlpha", 0.05);
//
// lingam.setAlternativePenalty(lingamPruningAlpha);
// Graph graph = lingam.lingam(data).getGraph();
Lingam lingam = new Lingam();
Graph graph = lingam.search(data);
if (getSourceGraph() != null) {
GraphUtils.arrangeBySourceGraph(graph, getSourceGraph());
} else {
GraphUtils.circleLayout(graph, 200, 200, 150);
}
setResultGraph(graph);
GraphUtils.arrangeBySourceGraph(getResultGraph(), getSourceGraph());
}
Aggregations