Search in sources :

Example 1 with IndTestGSquare

use of edu.cmu.tetrad.search.IndTestGSquare in project tetrad by cmu-phil.

the class TestIndTestGSquare method testIsIndependent.

@Test
public void testIsIndependent() {
    try {
        DataSet dataSet = getDataSet(1);
        IndTestGSquare test = new IndTestGSquare(dataSet, 0.05);
        List<Node> v = test.getVariables();
        Node x = v.get(0);
        Node y = v.get(1);
        ArrayList<Node> z = new ArrayList<>();
        z.add(v.get(2));
        assertTrue(test.isIndependent(x, y, z));
        test.setDeterminationP(0.99);
        assertFalse(test.determines(z, x));
        assertFalse(test.determines(z, y));
    } catch (IOException e) {
        // To change body of catch statement use File | Settings | File Templates.
        e.printStackTrace();
    }
}
Also used : DataSet(edu.cmu.tetrad.data.DataSet) IndTestGSquare(edu.cmu.tetrad.search.IndTestGSquare) Node(edu.cmu.tetrad.graph.Node) ArrayList(java.util.ArrayList) IOException(java.io.IOException) Test(org.junit.Test)

Example 2 with IndTestGSquare

use of edu.cmu.tetrad.search.IndTestGSquare in project tetrad by cmu-phil.

the class TestIndTestGSquare method testDetermination.

@Test
public void testDetermination() {
    try {
        DataSet dataSet = getDataSet(1);
        IndTestGSquare test = new IndTestGSquare(dataSet, 0.05);
        Node x = dataSet.getVariable("X4");
        ArrayList<Node> z = new ArrayList<>();
        test.setDeterminationP(0.99);
        assertFalse(test.determines(z, x));
    } catch (IOException e) {
        // To change body of catch statement use File | Settings | File Templates.
        e.printStackTrace();
    }
}
Also used : DataSet(edu.cmu.tetrad.data.DataSet) IndTestGSquare(edu.cmu.tetrad.search.IndTestGSquare) Node(edu.cmu.tetrad.graph.Node) ArrayList(java.util.ArrayList) IOException(java.io.IOException) Test(org.junit.Test)

Aggregations

DataSet (edu.cmu.tetrad.data.DataSet)2 Node (edu.cmu.tetrad.graph.Node)2 IndTestGSquare (edu.cmu.tetrad.search.IndTestGSquare)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2