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 orienting.

Rule R4 is only performed if knowledge is nonempty.

Note that the meekPreventCycles flag is set to true by default. This means that the algorithm will prevent cycles from being created in the graph by adding arbitrary unshielded colliders to the graph. The user can turn this off if they want to by setting the Meek prevent cycles flag to false, in which case the algorithm will not prevent cycles from being created, e.g., by repeated applications of R1. This behavior was adjusted 2024-6-24, as a way to allow the PC algorithm to always output a CPDAG.

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. Default is true. If true, cycles are prevented by adding arbitrary new unshielded colliders to the graph. This behavior was adjusted 2024-6-24, as a way to allow the PC algorithm to always output a CPDAG.
      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.