Search in sources :

Example 41 with GraphNode

use of edu.cmu.tetrad.graph.GraphNode in project tetrad by cmu-phil.

the class TestBayesXml method sampleBayesIm2.

private static BayesIm sampleBayesIm2() {
    Node a = new GraphNode("a");
    Node b = new GraphNode("b");
    Node c = new GraphNode("c");
    Dag graph = new Dag();
    graph.addNode(a);
    graph.addNode(b);
    graph.addNode(c);
    graph.addDirectedEdge(a, b);
    graph.addDirectedEdge(a, c);
    graph.addDirectedEdge(b, c);
    BayesPm bayesPm = new BayesPm(graph);
    bayesPm.setNumCategories(b, 3);
    return new MlBayesIm(bayesPm, MlBayesIm.RANDOM);
}
Also used : GraphNode(edu.cmu.tetrad.graph.GraphNode) Node(edu.cmu.tetrad.graph.Node) GraphNode(edu.cmu.tetrad.graph.GraphNode) Dag(edu.cmu.tetrad.graph.Dag)

Aggregations

GraphNode (edu.cmu.tetrad.graph.GraphNode)41 Node (edu.cmu.tetrad.graph.Node)37 Dag (edu.cmu.tetrad.graph.Dag)20 Test (org.junit.Test)11 EdgeListGraph (edu.cmu.tetrad.graph.EdgeListGraph)7 Graph (edu.cmu.tetrad.graph.Graph)7 DisplayNode (edu.cmu.tetradapp.workbench.DisplayNode)6 BayesIm (edu.cmu.tetrad.bayes.BayesIm)3 BayesPm (edu.cmu.tetrad.bayes.BayesPm)3 MlBayesIm (edu.cmu.tetrad.bayes.MlBayesIm)3 IndependenceFact (edu.cmu.tetrad.graph.IndependenceFact)3 ArrayList (java.util.ArrayList)3 FruchtermanReingoldLayout (edu.cmu.tetrad.graph.FruchtermanReingoldLayout)2 DiscreteVariable (edu.cmu.tetrad.data.DiscreteVariable)1 IndependenceFacts (edu.cmu.tetrad.data.IndependenceFacts)1 Endpoint (edu.cmu.tetrad.graph.Endpoint)1 SemGraph (edu.cmu.tetrad.graph.SemGraph)1 TimeLagGraph (edu.cmu.tetrad.graph.TimeLagGraph)1 IndependenceFactsModel (edu.cmu.tetradapp.model.IndependenceFactsModel)1 BufferedReader (java.io.BufferedReader)1