Class MeekRules

java.lang.Object
edu.cmu.tetrad.search.utils.MeekRules

public class MeekRules extends Object
Implements Meek's complete orientation rule set for PC (Chris Meek (1995), "Causal inference and causal explanation with background knowledge"), modified for Conservative PC to check noncolliders against recorded noncolliders before orienting.

Rule R4 is only performed if knowledge is nonempty.

Version:
$Id: $Id
Author:
josephramsey
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs the MeekRules with no logging.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a complete set of all the edges that were changed in the course of orientation, as a map from the previous edges in the graph to the new, changed edges for the same node pair.
    Uses the Meek rules to do as many orientations in the given graph as possible.
    void
    Sets the knowledge to be used in the orientation.
    void
    setMeekPreventCycles(boolean meekPreventCycles)
    Sets whether cycles should be prevented by cycle checking.
    void
    setRevertToUnshieldedColliders(boolean revertToUnshieldedColliders)
    Sets whether orientations in the graph should be reverted to its unshielded colliders before performing any Meek rule orientations.
    void
    setVerbose(boolean verbose)
    Sets whether verbose output should be printed.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MeekRules

      public MeekRules()
      Constructs the MeekRules with no logging.
  • Method Details

    • orientImplied

      public Set<Node> orientImplied(Graph graph)
      Uses the Meek rules to do as many orientations in the given graph as possible.
      Parameters:
      graph - The graph.
      Returns:
      The set of nodes that were visited in this orientation.
    • setKnowledge

      public void setKnowledge(Knowledge knowledge)
      Sets the knowledge to be used in the orientation.
      Parameters:
      knowledge - The knowledge.
      See Also:
    • setMeekPreventCycles

      public void setMeekPreventCycles(boolean meekPreventCycles)
      Sets whether cycles should be prevented by cycle checking.
      Parameters:
      meekPreventCycles - True, if so.
    • getChangedEdges

      public Map<Edge,Edge> getChangedEdges()
      Returns a complete set of all the edges that were changed in the course of orientation, as a map from the previous edges in the graph to the new, changed edges for the same node pair. For example, if X->Y was changed to X<-Y, thie map will send X->Y to X<-Y.
      Returns:
      This map.
    • setVerbose

      public void setVerbose(boolean verbose)
      Sets whether verbose output should be printed.
      Parameters:
      verbose - True, if so.
    • setRevertToUnshieldedColliders

      public void setRevertToUnshieldedColliders(boolean revertToUnshieldedColliders)
      Sets whether orientations in the graph should be reverted to its unshielded colliders before performing any Meek rule orientations.
      Parameters:
      revertToUnshieldedColliders - True, if so.