Class R0R4StrategyScoreBased

java.lang.Object
edu.cmu.tetrad.search.utils.R0R4StrategyScoreBased
All Implemented Interfaces:
R0R4Strategy

public class R0R4StrategyScoreBased extends Object implements R0R4Strategy
The FciOrientDataExaminationStrategyTestBased class implements the FciOrientDataExaminationStrategy interface and provides methods for checking unshielded colliders and determining orientations based on the Discriminating Path Rule.

This classes uses a TeyssierScorer object to determine the sepset for two nodes, e and c, which can only be determined by looking at the data.

Author:
jdramsey
See Also:
  • Method Details

    • specialConfiguration

      public static R0R4Strategy specialConfiguration(TeyssierScorer scorer, Knowledge knowledge, boolean completeRuleSetUsed, boolean doDiscriminatingPathTailRule, boolean doDiscriminatingPathColliderRule, int maxPathLength, boolean verbose, int depth)
      Returns a special configuration of FciOrientDataExaminationStrategy.
      Parameters:
      scorer - the TeyssierScorer object
      knowledge - the Knowledge object
      completeRuleSetUsed - a boolean indicating if the complete rule set is used
      doDiscriminatingPathTailRule - a boolean indicating if the discriminating path tail rule is applied
      doDiscriminatingPathColliderRule - a boolean indicating if the discriminating path collider rule is applied
      maxPathLength - the maximum path length
      verbose - a boolean indicating if verbose mode is enabled
      depth - the depth
      Returns:
      an instance of FciOrientDataExaminationStrategy with the specified configuration
    • defaultConfiguration

      public static R0R4Strategy defaultConfiguration(TeyssierScorer scorer, Knowledge knowledge, boolean verbose)
      Returns a default configuration of the FciOrientDataExaminationStrategy.
      Parameters:
      scorer - the TeyssierScorer object
      knowledge - the Knowledge object
      verbose - a boolean indicating if verbose mode is enabled
      Returns:
      an instance of FciOrientDataExaminationStrategy with the default configuration
    • doDiscriminatingPathOrientation

      public org.apache.commons.lang3.tuple.Pair<DiscriminatingPath,Boolean> doDiscriminatingPathOrientation(DiscriminatingPath discriminatingPath, Graph graph)
      Does a discriminating path orientation based on the Discriminating Path Rule.
      Specified by:
      doDiscriminatingPathOrientation in interface R0R4Strategy
      Parameters:
      discriminatingPath - the discriminating path
      graph - the graph representation
      Returns:
      The discriminating path is returned as the first element of the pair, and a boolean indicating whether the orientation was done is returned as the second element of the pair.
      Throws:
      IllegalArgumentException - if 'e' is adjacent to 'c'
      See Also:
    • getknowledge

      public Knowledge getknowledge()
      Description copied from interface: R0R4Strategy
      Returns the knowledge object used by the strategy.
      Specified by:
      getknowledge in interface R0R4Strategy
      Returns:
      the knowledge object.
    • setAllowedColliders

      public void setAllowedColliders(Set<Triple> allowedColliders)
      Description copied from interface: R0R4Strategy
      Sets the allowed colliders for the current strategy.
      Specified by:
      setAllowedColliders in interface R0R4Strategy
      Parameters:
      allowedColliders - a Set of Triple objects representing the allowed colliders
    • isUnshieldedCollider

      public boolean isUnshieldedCollider(Graph graph, Node i, Node j, Node k)
      Checks if a collider is unshielded or not.
      Specified by:
      isUnshieldedCollider in interface R0R4Strategy
      Parameters:
      graph - the graph containing the nodes
      i - the first node of the collider
      j - the second node of the collider
      k - the third node of the collider
      Returns:
      true if the collider is unshielded, false otherwise
    • setVerbose

      public void setVerbose(boolean verbose)
      Sets the verbose mode for this FciOrientDataExaminationStrategyScoreBased object.
      Parameters:
      verbose - a boolean indicating if verbose mode is enabled
    • getKnowledge

      public Knowledge getKnowledge()
      Retrieves the knowledge associated with this instance.
      Returns:
      the Knowledge object associated with this instance
    • setKnowledge

      public void setKnowledge(Knowledge knowledge)
      Sets the Knowledge object for this instance.
      Specified by:
      setKnowledge in interface R0R4Strategy
      Parameters:
      knowledge - the Knowledge object to be set
    • getDepth

      public int getDepth()
      Retrieves the depth value of the FciOrientDataExaminationStrategyScoreBased object.
      Returns:
      the depth value of the FciOrientDataExaminationStrategyScoreBased object
    • setDepth

      public void setDepth(int depth)
      Sets the depth value of the FciOrientDataExaminationStrategyScoreBased object.
      Parameters:
      depth - the depth value to be set