Class RecursiveAdjustment

java.lang.Object
edu.cmu.tetrad.search.RecursiveAdjustment

public final class RecursiveAdjustment extends Object
Represents an adjustment mechanism for defining adjustment sets in causal inference across different types of graphical models.

The RecursiveAdjustment class provides methods to define valid adjustment sets based on the structure of the graph, specific node relationships, and user-defined policies about allowed paths and collateral factors.

  • graph: The causal graph being analyzed.
  • colliderPolicy: A policy defining how colliders are handled during adjustment set definition.
  • noAmenablePolicy: A policy specifying behavior when the graph is not adjustment-amenable relative to (X, Y) in the sense of Perković et al.
  • Constructor Details

    • RecursiveAdjustment

      public RecursiveAdjustment(Graph graph)
      Constructs a RecursiveAdjustment instance with the specified causal graph.
      Parameters:
      graph - The causal graph to be analyzed for adjustment set definition.
  • Method Details

    • setColliderPolicy

      Sets the collider policy for handling colliders during adjustment set definition.
      Parameters:
      p - The collider policy to be applied.
      Returns:
      This RecursiveAdjustment instance for method chaining.
    • setNoAmenablePolicy

      Sets the policy for handling cases where the graph is not amenable relative to (X, Y).
      Parameters:
      p - The no-amenable policy to be applied.
      Returns:
      This RecursiveAdjustment instance for method chaining.
    • setUseHenckelPruning

      public RecursiveAdjustment setUseHenckelPruning(boolean use)
      Enables or disables Henckel–Perković–Maathuis (HPM) pruning on the RA solutions. HPM pruning assumes linear models and uses m-separation to remove variables z for which Y ⟂ z | X ∪ (Z \ {z}).
      Parameters:
      use - Use Henckel–Perković–Maathuis (HPM) pruning.
      Returns:
      this
    • setRaMode

      Sets the Recursive Adjustment (RA) mode.
      Parameters:
      mode - the RA mode to be set; must not be null
      Returns:
      the current instance of RecursiveAdjustment
    • isGraphAmenable

      public boolean isGraphAmenable(Node X, Node Y, String graphType, int maxPathLength, Set<Node> forceVisibility)
      Checks whether the graph is adjustment-amenable relative to (X, Y) in the sense of Perković et al.: every proper potentially directed path from X to Y starts with a visible / directed edge out of X.

      This uses the same notion of "amenable path" as the main algorithm: - For MAG/PAG: first edge must be visible and directed out of X. For DAG/PDAG: first edge must be directed out of X."

      Parameters:
      X - source node
      Y - target node
      graphType - graph type ("DAG", "PDAG", "MAG", "PAG", etc.)
      maxPathLength - maximum path length for potentially directed paths; -1 means unlimited
      forceVisibility - Whether to force visibility of certain nodes during adjustment set computation.
      Returns:
      true if the graph is amenable w.r.t. (X, Y), false otherwise
    • adjustmentSets

      public List<Set<Node>> adjustmentSets(Node X, Node Y, String graphType, int maxNumSets, int maxRadius, int nearWhichEndpoint, int maxPathLength, RecursiveAdjustment.ColliderPolicy colliderPolicy, boolean avoidAmenable, @Nullable Set<Node> notFollowed, @Nullable Set<Node> containing, Set<Node> forceVisibility)
      Computes a list of adjustment sets for estimating the causal effect of X on Y within a given graph structure. This method uses a breadth-first search strategy to identify valid adjustment sets based on the provided parameters and collider policy.
      Parameters:
      X - The node representing the cause in the causal relationship.
      Y - The node representing the effect in the causal relationship.
      graphType - The type of graph (e.g., "dag", "pdag", "mag") used for adjustment computation.
      maxNumSets - The maximum number of adjustment sets to compute.
      maxRadius - The maximum radius for creating shells during adjustment set determination.
      nearWhichEndpoint - Specifies which endpoint (source or target) should dominate the adjustment determination.
      maxPathLength - The maximum allowed path length between X and Y for eligibility in adjustment sets.
      colliderPolicy - The policy for handling colliders during adjustment set computation.
      avoidAmenable - Whether to avoid adjustment sets involving amenable paths.
      notFollowed - A set of nodes that should not be followed during path exploration in the graph. Optional.
      containing - A set of nodes that must be included in the adjustment sets. Optional.
      forceVisibility - Whether to force visibility of certain nodes during adjustment set computation.
      Returns:
      A list of sets of nodes, where each set represents a possible valid adjustment set for the causal effect.