Class IndTestDSep

java.lang.Object
edu.cmu.tetrad.search.IndTestDSep
All Implemented Interfaces:
IndependenceTest

public class IndTestDSep extends Object implements IndependenceTest
Checks independence facts for variables associated with the nodes in a given graph by checking d-separation facts on the underlying nodes.
Author:
Joseph Ramsey
  • Constructor Details

    • IndTestDSep

      public IndTestDSep(Graph graph)
    • IndTestDSep

      public IndTestDSep(IndependenceFacts facts, List<Node> variables)
    • IndTestDSep

      public IndTestDSep(IndependenceFacts facts)
    • IndTestDSep

      public IndTestDSep(Graph graph, boolean keepLatents)
      Constructs a new independence test that returns d-separation facts for the given graph as independence results.
    • IndTestDSep

      public IndTestDSep(IndependenceFacts facts, boolean keepLatents)
  • Method Details

    • indTestSubset

      public IndependenceTest indTestSubset(List<Node> vars)
      Required by IndependenceTest.
      Specified by:
      indTestSubset in interface IndependenceTest
      Returns:
      an Independence test for a subset of the variables.
    • checkIndependence

      public IndependenceResult checkIndependence(Node x, Node y, List<Node> z)
      Checks the indicated d-separation fact.
      Specified by:
      checkIndependence in interface IndependenceTest
      Parameters:
      x - one node.
      y - a second node.
      z - a List of nodes (conditioning variables)
      Returns:
      true iff x _||_ y | z
      See Also:
    • isDSeparated

      public boolean isDSeparated(Node x, Node y, List<Node> z)
      Auxiliary method to calculate dseparation facts directly from nodes instead of from variables.
    • getPValue

      public double getPValue()
      Needed for IndependenceTest interface. P value is not meaningful here.
    • getVariables

      public List<Node> getVariables()
      Specified by:
      getVariables in interface IndependenceTest
      Returns:
      the list of TetradNodes over which this independence checker is capable of determinine independence relations-- that is, all the variables in the given graph or the given data set.
    • determines

      public boolean determines(List<Node> z, Node x1)
      Specified by:
      determines in interface IndependenceTest
      Returns:
      true if y is determined the variable in z.
    • getAlpha

      public double getAlpha()
      Specified by:
      getAlpha in interface IndependenceTest
      Returns:
      the significance level of the independence test.
    • setAlpha

      public void setAlpha(double alpha)
      Description copied from interface: IndependenceTest
      Sets the significance level.
      Specified by:
      setAlpha in interface IndependenceTest
    • getVariable

      public Node getVariable(String name)
      Specified by:
      getVariable in interface IndependenceTest
      Returns:
      the variable by the given name.
    • getGraph

      public Graph getGraph()
      Returns:
      the underlying graph.
    • setGraph

      public void setGraph(Graph graph)
    • toString

      public String toString()
      Specified by:
      toString in interface IndependenceTest
      Overrides:
      toString in class Object
    • getData

      public DataSet getData()
      Specified by:
      getData in interface IndependenceTest
      Returns:
      The data model for the independence test.
    • getScore

      public double getScore()
      Description copied from interface: IndependenceTest
      A score that is higher with more likely models.
      Specified by:
      getScore in interface IndependenceTest
    • getFacts

      public List<IndependenceFact> getFacts()
    • isVerbose

      public boolean isVerbose()
      Specified by:
      isVerbose in interface IndependenceTest
    • setVerbose

      public void setVerbose(boolean verbose)
      Specified by:
      setVerbose in interface IndependenceTest