Class IndTestSepsetDci

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

public class IndTestSepsetDci extends Object implements IndependenceTest
Checks independence facts for variables associated with a sepset by simply querying the sepset
Version:
$Id: $Id
Author:
Robert Tillman
  • Constructor Details

    • IndTestSepsetDci

      public IndTestSepsetDci(SepsetMapDci sepset, List<Node> nodes)
      Constructs a new independence test that returns d-separation facts for the given graph as independence results.
      Parameters:
      sepset - a SepsetMapDci object
      nodes - a List object
  • Method Details

    • indTestSubset

      public IndependenceTest indTestSubset(List<Node> vars)
      Determines independence between a subset of variables.
      Specified by:
      indTestSubset in interface IndependenceTest
      Parameters:
      vars - The sublist of variables.
      Returns:
      This IndependenceTest object.
      Throws:
      IllegalArgumentException - If the subset is empty or contains variables that are not original variables.
    • checkIndependence

      public IndependenceResult checkIndependence(Node x, Node y, Set<Node> z)
      Checks the independence between two nodes, given a set of conditioning nodes.
      Specified by:
      checkIndependence in interface IndependenceTest
      Parameters:
      x - A Node object representing the first node.
      y - A Node object representing the second node.
      z - A set representing the set of conditioning nodes.
      Returns:
      An IndependenceResult object containing the result of the independence test.
      Throws:
      NullPointerException - if z is null or if any node in z is null.
      RuntimeException - if the p-value is undefined.
      See Also:
    • getPValue

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

      public List<Node> getVariables()

      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)
      Determines if a given Node is present in a List of Nodes.
      Parameters:
      z - The List of Nodes to search in.
      x1 - The Node to search for.
      Returns:
      True if the Node x1 is present in the List z, otherwise False.
    • getAlpha

      public double getAlpha()

      getAlpha.

      Specified by:
      getAlpha in interface IndependenceTest
      Returns:
      a double
    • setAlpha

      public void setAlpha(double alpha)
      Sets the alpha level for the independence test.
      Specified by:
      setAlpha in interface IndependenceTest
      Parameters:
      alpha - The alpha level to be set.
    • getVariable

      public Node getVariable(String name)
      Retrieves the variable with the specified name.
      Specified by:
      getVariable in interface IndependenceTest
      Parameters:
      name - the name of the variable to retrieve
      Returns:
      the variable with the specified name, or null if not found
    • getVariable

      public Node getVariable(Node node)

      getVariable.

      Parameters:
      node - a Node object
      Returns:
      the variable associated with the given node in the graph.
    • getNode

      public Node getNode(Node variable)

      getNode.

      Parameters:
      variable - a Node object
      Returns:
      the node associated with the given variable in the graph.
    • toString

      public String toString()

      toString.

      Specified by:
      toString in interface IndependenceTest
      Overrides:
      toString in class Object
      Returns:
      a String object
    • getData

      public DataSet getData()

      getData.

      Specified by:
      getData in interface IndependenceTest
      Returns:
      a DataSet object
      See Also:
    • isVerbose

      public boolean isVerbose()

      isVerbose.

      Specified by:
      isVerbose in interface IndependenceTest
      Returns:
      a boolean
    • setVerbose

      public void setVerbose(boolean verbose)
      Sets the verbose flag.
      Specified by:
      setVerbose in interface IndependenceTest
      Parameters:
      verbose - True if verbose mode is enabled, false otherwise.