Class StarFci

java.lang.Object
edu.cmu.tetrad.search.StarFci
All Implemented Interfaces:
IGraphSearch
Direct Known Subclasses:
BossFci, FgesFci, GraspFci, SpFci

public abstract class StarFci extends Object implements IGraphSearch
*-FCI implements a template modification of GFCI that starts with a given Markov CPDAG and then fixes that result to be correct for latent variables models. First, colliders from the Markov DAG are copied into the final circle-circle graph, and some independence reasoning is used to remove edges from this and add the remaining colliders into the graph. Then, the FCI final orientation rules are applied.

The Markov CPDAG needs to be supplied by classes inheriting from this abstract class using the getMarkovCpdag() methods.

The reference for the GFCI algorithm this is being modeled from is here:

Ogarrio, J. M., Spirtes, P., & Ramsey, J. (2016, August). A hybrid causal search algorithm for latent variable models. In Conference on probabilistic graphical models (pp. 368-379). PMLR.

We modify this by insistent that getMarkovCpdag() is overridden by a method that will return a CPDAG Markov to the data or underlying generative model and removing the possible d-sep step of the original algorithm.

This class is configured to respect knowledge of forbidden and required edges, including knowledge of temporal tiers.

Author:
josephramsey, bryanandrews
See Also:
  • Constructor Details

    • StarFci

      public StarFci(IndependenceTest test)
      Constructs a new GFci algorithm with the given independence test and score.
      Parameters:
      test - The independence test to use.
  • Method Details

    • sepsetSubsetOfAdjxOrAdjy

      public static Set<Node> sepsetSubsetOfAdjxOrAdjy(Graph graph, Node x, Node y, Set<Node> containing, IndependenceTest test, int depth, List<Node> order, boolean useMaxP)
      Finds a separating set that is a subset of the adjacency of nodes x or y in the input graph.
      Parameters:
      graph - The graph being analyzed.
      x - The first node between which independence is checked.
      y - The second node between which independence is checked.
      containing - A set of nodes that must be included in the separating set.
      test - The independence test used to evaluate separation.
      depth - The maximum size of subsets to be tested for independence.
      order - An optional list specifying the order of nodes for additional constraints.
      useMaxP - True if the maxP method should be used.
      Returns:
      A separating set of nodes (if found) that is a subset of the adjacency of x or y, or null if no such set is found.
    • setUseMaxP

      public void setUseMaxP(boolean useMaxP)
      Sets whether to use the maxP criterion during the search process.
      Parameters:
      useMaxP - A boolean indicating whether the maxP criterion should be applied (true) or not (false).
    • search

      public Graph search() throws InterruptedException
      Runs the graph and returns the search PAG.
      Specified by:
      search in interface IGraphSearch
      Returns:
      This PAG.
      Throws:
      InterruptedException - if any
    • getKnowledge

      public Knowledge getKnowledge()
      Returns the knowledge used in search.
      Returns:
      This knowledge
    • setKnowledge

      public void setKnowledge(Knowledge knowledge)
      Sets the knowledge to use in search.
      Parameters:
      knowledge - This knowledge.
    • setCompleteRuleSetUsed

      public void setCompleteRuleSetUsed(boolean completeRuleSetUsed)
      Sets whether Zhang's complete rules are used.
      Parameters:
      completeRuleSetUsed - set to true if Zhang's complete rule set should be used, false if only R1-R4 (the rule set of the original FCI) should be used. True by default.
    • setMaxDiscriminatingPathLength

      public void setMaxDiscriminatingPathLength(int maxDiscriminatingPathLength)
      Sets the maximum length of any discriminating path.
      Parameters:
      maxDiscriminatingPathLength - the maximum length of any discriminating path, or -1 if unlimited.
    • isVerbose

      public boolean isVerbose()
      Indicates whether verbose output is enabled.
      Returns:
      true if verbose output is enabled, false otherwise.
    • setVerbose

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

      public IndependenceTest getIndependenceTest()
      Returns the independence test used in search.
      Returns:
      This test.
    • setDepth

      public void setDepth(int depth)
      Sets the depth of the search for the possible m-sep search.
      Parameters:
      depth - This depth.
    • setGuaranteePag

      public void setGuaranteePag(boolean guaranteePag)
      Sets the flag indicating whether to guarantee the output is a legal PAG.
      Parameters:
      guaranteePag - A boolean value indicating whether to guarantee the output is a legal PAG.
    • getMarkovCpdag

      public abstract Graph getMarkovCpdag() throws InterruptedException
      Returns a Markov CPDAG to use as the initial graph in the Star-FCI search.
      Returns:
      This CPDAG.
      Throws:
      InterruptedException - if interrupted.