Class GFci

java.lang.Object
edu.cmu.tetrad.search.GFci
All Implemented Interfaces:
IGraphSearch

public final class GFci extends Object implements IGraphSearch
Implements a modification of FCI that started by running the FGES algorithm and then fixes that result to be correct for latent variables models. First, colliders from the FGES results are copied into the final circle-circle graph, and some independence reasoning is used to add the remaining colliders into the graph. Then, the FCI final orientation rules are applied. The reference 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.

Because the method both runs FGES (a score-based algorithm) and does additional checking of conditional independencies, both as part of its collider orientation step and also as part of the the definite discriminating path step in the final FCI orientation rules, both a score and a test need to be used to construct a GFCI algorithm.

Note that various score-based algorithms could be used in place of FGES for the initial step; in this repository we give three other options, GRaSP-FCI, BFCI (BOSS FCI), and SP-FCI (see).

For more information on the algorithm, see the reference above.

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

Version:
$Id: $Id
Author:
Juan Miguel Ogarrio, peterspirtes, josephramsey
See Also:
  • Constructor Details

    • GFci

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

    • search

      public Graph search()
      Runs the graph and returns the search PAG.
      Specified by:
      search in interface IGraphSearch
      Returns:
      This PAG.
    • setMaxDegree

      public void setMaxDegree(int maxDegree)
      Sets the maximum indegree of the output graph.
      Parameters:
      maxDegree - This maximum.
    • 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.
    • setMaxPathLength

      public void setMaxPathLength(int maxPathLength)
      Sets the maximum length of any discriminating path.
      Parameters:
      maxPathLength - the maximum length of any discriminating path, or -1 if unlimited.
    • 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.
    • setOut

      public void setOut(PrintStream out)
      Sets the print stream used for output, default System.out.
      Parameters:
      out - This print stream.
    • setFaithfulnessAssumed

      public void setFaithfulnessAssumed(boolean faithfulnessAssumed)
      Sets whether one-edge faithfulness is assumed. For FGES
      Parameters:
      faithfulnessAssumed - True, if so.
      See Also:
    • setDepth

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

      public void setNumThreads(int numThreads)
      Sets the number of threads to use in the search.
      Parameters:
      numThreads - The number of threads to use. Must be at least 1.
    • 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.
    • setAblationLeaveOutFinalOrientation

      public void setAblationLeaveOutFinalOrientation(boolean ablationLeaveOutFinalOrientation)
      Sets the flag indicating whether to leave out the final orientation during ablation.
      Parameters:
      ablationLeaveOutFinalOrientation - A boolean value indicating whether to leave out the final orientation during ablation.
    • setSepsetFinderMethod

      public void setSepsetFinderMethod(int sepsetFinderMethod)
      Sets the method used to find the sepset in the GFci algorithm.
      Parameters:
      sepsetFinderMethod - The method used to find the sepset. - 0: Default method - 1: Custom method 1 - 2: Custom method 2 - ...
    • setDoDiscriminatingPathTailRule

      public void setDoDiscriminatingPathTailRule(boolean doDiscriminatingPathTailRule)
      Sets whether the discriminating path tail rule should be used.
      Parameters:
      doDiscriminatingPathTailRule - True, if so.
    • setDoDiscriminatingPathColliderRule

      public void setDoDiscriminatingPathColliderRule(boolean doDiscriminatingPathColliderRule)
      Sets whether the discriminating path collider rule should be used.
      Parameters:
      doDiscriminatingPathColliderRule - True, if so.