Class SepsetsMaxP

java.lang.Object
edu.cmu.tetrad.search.utils.SepsetsMaxP
All Implemented Interfaces:
SepsetProducer

public class SepsetsMaxP extends Object implements SepsetProducer

Provides a SepsetProcuder that selects the first sepset it comes to from among the extra sepsets or the adjacents of i or k, or null if none is found. This version uses conservative reasoning (see the CPC algorithm).

Version:
$Id: $Id
Author:
josephramsey
See Also:
  • Constructor Details

  • Method Details

    • getSepset

      public Set<Node> getSepset(Node i, Node k)
      Returns the set of nodes in the sepset between two given nodes, or null if no sepset is found.
      Specified by:
      getSepset in interface SepsetProducer
      Parameters:
      i - the first node
      k - the second node
      Returns:
      a Set of Node objects representing the sepset between the two nodes, or null if no sepset is found.
    • getSepsetContaining

      public Set<Node> getSepsetContaining(Node i, Node k, Set<Node> s)
      Returns the set of nodes in the sepset between two given nodes containing a given set of separator nodes, or null if no sepset is found. If there is no required set of nodes, pass null for the set.
      Specified by:
      getSepsetContaining in interface SepsetProducer
      Parameters:
      i - the first node
      k - the second node
      s - A set of nodes that must be in the sepset, or null if no such set is required.
      Returns:
      a Set of Node objects representing the sepset between the two nodes containing the given set, or null if no sepset is found
    • isUnshieldedCollider

      public boolean isUnshieldedCollider(Node i, Node j, Node k)

      isUnshieldedCollider.

      Specified by:
      isUnshieldedCollider in interface SepsetProducer
      Parameters:
      i - a Node object
      j - a Node object
      k - a Node object
      Returns:
      a boolean
    • getSepsetsLists

      public List<List<Set<Node>>> getSepsetsLists(Node x, Node y, Node z, IndependenceTest test, int depth, boolean verbose)

      getSepsetsLists.

      Parameters:
      x - a Node object
      y - a Node object
      z - a Node object
      test - a IndependenceTest object
      depth - a int
      verbose - a boolean
      Returns:
      a List object
    • isIndependent

      public boolean isIndependent(Node a, Node b, Set<Node> sepset)
      Determines if two nodes are independent given a set of separator nodes.
      Specified by:
      isIndependent in interface SepsetProducer
      Parameters:
      a - A Node object representing the first node.
      b - A Node object representing the second node.
      sepset - A Set object representing the set of separator nodes.
      Returns:
      True if the nodes are independent, false otherwise.
    • getPValue

      public double getPValue(Node a, Node b, Set<Node> sepset)
      Returns the p-value for the independence test between two nodes, given a set of separator nodes.
      Specified by:
      getPValue in interface SepsetProducer
      Parameters:
      a - the first node
      b - the second node
      sepset - the set of separator nodes
      Returns:
      the p-value for the independence test
    • getScore

      public double getScore()

      getScore.

      Specified by:
      getScore in interface SepsetProducer
      Returns:
      a double
    • getVariables

      public List<Node> getVariables()

      getVariables.

      Specified by:
      getVariables in interface SepsetProducer
      Returns:
      a List object
    • setVerbose

      public void setVerbose(boolean verbose)

      setVerbose.

      Specified by:
      setVerbose in interface SepsetProducer
      Parameters:
      verbose - a boolean
    • getIndependenceTest

      public IndependenceTest getIndependenceTest()

      Getter for the field independenceTest.

      Returns:
      a IndependenceTest object