Class BFci

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

public final class BFci extends Object implements IGraphSearch
Uses BOSS in place of FGES for the initial step in the GFCI algorithm. This tends to produce an accurate PAG than GFCI as a result, for the latent variables case. This is a simple substitution; the reference for BFCI is here:

Andrews, B., Ramsey, J., Sanchez Romero, R., Camchong, J., & Kummerfeld, E. (2024). Fast Scalable and Accurate Discovery of DAGs Using the Best Order Score Search and Grow Shrink Trees. Advances in Neural Information Processing Systems, 36.

The reference for GFCI is here:

J.M. Ogarrio and P. Spirtes and J. Ramsey, "A Hybrid Causal Search Algorithm for Latent Variable Models," JMLR 2016. Here, BOSS has been substituted for FGES.

For BOSS only a score is needed, but there are steps in GFCI that require a test; for these, a test is additionally required.

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

Version:
$Id: $Id
Author:
josephramsey, bryan andrews
See Also:
  • Constructor Details

    • BFci

      public BFci(IndependenceTest test, Score score)
      Constructor. The test and score should be for the same data.
      Parameters:
      test - The test to use.
      score - The score to use.
      See Also:
  • Method Details

    • search

      public Graph search()
      Does the search and returns a PAG.
      Specified by:
      search in interface IGraphSearch
      Returns:
      The discovered graph.
    • setKnowledge

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

      public void setCompleteRuleSetUsed(boolean completeRuleSetUsed)
      Sets whether the complete (Zhang's) rule set should be used.
      Parameters:
      completeRuleSetUsed - 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. False by default.
    • setMaxPathLength

      public void setMaxPathLength(int maxPathLength)
      Returns 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 iff the case
    • getIndependenceTest

      public IndependenceTest getIndependenceTest()
      The independence test being used for some steps in final orientation.
      Returns:
      This test.
    • setNumStarts

      public void setNumStarts(int numStarts)
      Returns the number of times to restart the search.
      Parameters:
      numStarts - The number of times to restart the search.
    • setDepth

      public void setDepth(int depth)
      Sets the depth of the search (for the constraint-based step).
      Parameters:
      depth - The depth of the search.
    • setDoDiscriminatingPathRule

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

      public void setBossUseBes(boolean useBes)
      Sets whether the BES should be used.
      Parameters:
      useBes - True if the BES should be used, false otherwise.
    • setSeed

      public void setSeed(long seed)
      Sets the seed for the random number generator.
      Parameters:
      seed - The seed for the random number generator.
    • setNumThreads

      public void setNumThreads(int numThreads)
      Sets the number of threads to use.
      Parameters:
      numThreads - The number of threads to use. Must be at least 1.
    • setResolveAlmostCyclicPaths

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