Class SepsetsPossibleMsep

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

public class SepsetsPossibleMsep extends Object implements SepsetProducer

Provides a sepset producer using conditional independence tests to generate the Sepset map, for the case where possible msep sets are required.

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

    • SepsetsPossibleMsep

      public SepsetsPossibleMsep(Graph graph, IndependenceTest test, Knowledge knowledge, int depth, int maxPathLength)

      Constructor for SepsetsPossibleMsep.

      Parameters:
      graph - a Graph object
      test - a IndependenceTest object
      knowledge - a Knowledge object
      depth - a int
      maxPathLength - a int
  • Method Details

    • getSepset

      public Set<Node> getSepset(Node i, Node k, int depth)
      Retrieves the separation set (sepset) between two nodes.
      Specified by:
      getSepset in interface SepsetProducer
      Parameters:
      i - The first node
      k - The second node
      depth - The depth of the search
      Returns:
      The set of nodes that form the sepset between node i and node k, or null if no sepset exists
    • getSepsetContaining

      public Set<Node> getSepsetContaining(Node i, Node k, Set<Node> s, int depth)
      Retrieves the separation set (sepset) between two nodes i and k that contains a given set of nodes s. 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 - The set of nodes to be contained in the sepset
      depth - The depth of the search
      Returns:
      The set of nodes that form the sepset between node i and node k and contains all nodes from set s, or null if no sepset exists
    • isUnshieldedCollider

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

      isUnshieldedCollider.

      Specified by:
      isUnshieldedCollider in interface SepsetProducer
      Parameters:
      i - a Node object
      j - a Node object
      k - a Node object
      depth - the depth of the search
      Returns:
      a boolean
    • getScore

      public double getScore()
      Returns the score of the object.
      Specified by:
      getScore in interface SepsetProducer
      Returns:
      the score value
    • getVariables

      public List<Node> getVariables()
      Retrieves the list of variables.
      Specified by:
      getVariables in interface SepsetProducer
      Returns:
      the list of variables as a List of Node objects.
    • isVerbose

      public boolean isVerbose()

      isVerbose.

      Returns:
      a boolean
    • setVerbose

      public void setVerbose(boolean verbose)
      Sets the verbose mode of the SepsetProducer.
      Specified by:
      setVerbose in interface SepsetProducer
      Parameters:
      verbose - true if verbose mode is enabled, false otherwise
    • isIndependent

      public boolean isIndependent(Node d, Node c, Set<Node> sepset)
      Checks if node d is independent of node c given the set of nodes in sepset.
      Specified by:
      isIndependent in interface SepsetProducer
      Parameters:
      d - the first node
      c - the second node
      sepset - the set of common neighbors between d and c
      Returns:
      true if d is independent of c, 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
    • setGraph

      public void setGraph(Graph graph)
      Description copied from interface: SepsetProducer
      Sets the graph for the SepsetProducer object.
      Specified by:
      setGraph in interface SepsetProducer
      Parameters:
      graph - the graph to set