Class Rfci

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

public final class Rfci extends Object implements IGraphSearch
Implements the Really Fast Causal Inference (RFCI) algorithm, which aims to do a correct inference of inferrable causal structure under the assumption that unmeasured common causes of variables in the data may exist. The graph returned is slightly different from the partial ancestral graph (PAG) returned by the FCI algorithm. The goal of of the algorithm is to avoid certain expensive steps in the FCI procedure in a correct way. This was introduced here:

Colombo, D., Maathuis, M. H., Kalisch, M., & Richardson, T. S. (2012). Learning high-dimensional directed acyclic graphs with latent and selection variables. The Annals of Statistics, 294-321.

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

Version:
$Id: $Id
Author:
Erin Korber, June 2004, Alex Smith, December 2008, josephramsey, Choh-Man Teng
See Also:
  • Constructor Details

    • Rfci

      public Rfci(IndependenceTest test)
      Constructs a new RFCI search for the given independence test and background knowledge.
      Parameters:
      test - a IndependenceTest object
    • Rfci

      public Rfci(IndependenceTest test, List<Node> searchVars)
      Constructs a new RFCI search for the given independence test and background knowledge and a list of variables to search over.
      Parameters:
      test - a IndependenceTest object
      searchVars - a List object
  • Method Details

    • search

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

      public Graph search(List<Node> nodes) throws InterruptedException
      Searches of a specific sublist of nodes.
      Parameters:
      nodes - The sublist.
      Returns:
      The RFCI PAG
      Throws:
      InterruptedException - If the search is interrupted.
    • search

      public Graph search(Fas fas, List<Node> nodes) throws InterruptedException
      Runs the search and returns the RFCI PAG.
      Parameters:
      fas - The type of FAS to use for the initial step.
      nodes - The nodes to search over.
      Returns:
      The RFCI PAG.
      Throws:
      InterruptedException - If the search is interrupted.
    • getTest

      public IndependenceTest getTest()
      Description copied from interface: IGraphSearch
      Gets the test used by the search.
      Specified by:
      getTest in interface IGraphSearch
      Returns:
      The test used by the search.
    • setTest

      public void setTest(IndependenceTest test)
      Description copied from interface: IGraphSearch
      Sets the test to be used by the search. The list of variables of the new proposed test must be equal to the list of variables of the existing test.
      Specified by:
      setTest in interface IGraphSearch
      Parameters:
      test - The test to be used by the search.
    • setDepth

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

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

      public SepsetMap getSepsets()
      Returns the map from node pairs to sepsets found in search.
      Returns:
      This map.
    • getKnowledge

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

      public void setKnowledge(Knowledge knowledge)
      Sets the knowledge used in search.
      Parameters:
      knowledge - This knoweldge.
    • getMaxDiscriminatingPathLength

      public int getMaxDiscriminatingPathLength()
      Returns the maximum length of any discriminating path, or -1 of unlimited.
      Returns:
      This number.
    • 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()
      Returns whether verbose output should be printed.
      Returns:
      True, if so.
    • setVerbose

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

      public void setReplicatingGraph(boolean replicatingGraph)
      Sets the state of whether the graph is set to replicate or not during the search process.
      Parameters:
      replicatingGraph - If true, the graph is in a replicating state. If false, it is not.