Class Fci

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

public final class Fci extends Object implements IGraphSearch
Implements the Fast Causal Inference (FCI) algorithm due to Peter Spirtes, which addressed the case where latent common causes cannot be assumed not to exist with respect to the data set being analyzed. That is, it is assumed that there may be variables that are not included in the data that nonetheless may be causes of two or more variables that are included in data.

Two alternatives are provided for doing the final orientation step, one due to Peter Spirtes, which is arrow complete, and another due to Jiji Zhang, which is arrow and tail complete.

This algorithm, with the Spirtes final orientation rules, was given in an earlier version of this book:

Spirtes, P., Glymour, C. N., Scheines, R., & Heckerman, D. (2000). Causation, prediction, and search. MIT press.

The algorithm with the Zhang final orientation rules was given in this reference:

Zhang, J. (2008). On the completeness of orientation rules for causal discovery in the presence of latent confounders and selection bias. Artificial Intelligence, 172(16-17), 1873-1896.

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

Version:
$Id: $Id
Author:
peterspirtes, clarkglymour, jijizhang, josephramsey
See Also:
  • Constructor Details

    • Fci

      public Fci(IndependenceTest independenceTest)
      Constructor.
      Parameters:
      independenceTest - The test to use for oracle conditional independence information.
    • Fci

      public Fci(IndependenceTest independenceTest, List<Node> searchVars)
      Constructor.
      Parameters:
      independenceTest - The test to use for oracle conditional independence information.
      searchVars - A specific list of variables to search over.
  • Method Details

    • search

      public Graph search()
      Performs a search using the FCI algorithm.
      Specified by:
      search in interface IGraphSearch
      Returns:
      The resulting graph.
    • setDepth

      public void setDepth(int depth)
      Sets the depth of search, which is the maximum number of variables conditioned on in any test.
      Parameters:
      depth - This maximum.
    • getElapsedTime

      public long getElapsedTime()
      Returns the elapsed time of search.
      Returns:
      This time.
    • getSepsets

      public SepsetMap getSepsets()
      Returns the sepset map from FAS.
      Returns:
      This map.
      See Also:
    • getKnowledge

      public Knowledge getKnowledge()
      Returns the background knowledge that was set.
      Returns:
      This knowledge.
    • setKnowledge

      public void setKnowledge(Knowledge knowledge)
      Sets background knowledge for the search.
      Parameters:
      knowledge - This knowledge.
    • setCompleteRuleSetUsed

      public void setCompleteRuleSetUsed(boolean completeRuleSetUsed)
      Sets whether the Zhang complete rule set should be used; false if only R1-R4 (the rule set of the original FCI) should be used. False by default.
      Parameters:
      completeRuleSetUsed - True for the complete Zhang rule set.
    • setPossibleMsepSearchDone

      public void setPossibleMsepSearchDone(boolean possibleMsepSearchDone)
      Sets whether the (time-consuming) possible msep step should be done.
      Parameters:
      possibleMsepSearchDone - True, if so.
    • setMaxPathLength

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

      public void setPcHeuristicType(PcCommon.PcHeuristicType heuristic)
      Sets which PC heuristic type should be used in the initial adjacency search.
      Parameters:
      heuristic - The heuristic type.
      See Also:
    • setStable

      public void setStable(boolean stable)
      Sets whether the stable options should be used in the initial adjacency search.
      Parameters:
      stable - True, if so.
      See Also:
    • setDoDiscriminatingPathRule

      public void setDoDiscriminatingPathRule(boolean doDiscriminatingPathRule)
      Sets whether the discriminating path rule should be used.
      Parameters:
      doDiscriminatingPathRule - True, if so.
    • setResolveAlmostCyclicPaths

      public void setResolveAlmostCyclicPaths(boolean resolveAlmostCyclicPaths)
      Sets whether to resolve almost cyclic paths during the search.
      Parameters:
      resolveAlmostCyclicPaths - True to resolve almost cyclic paths, false otherwise.