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 Summary

    Constructors
    Constructor
    Description
    BFci(IndependenceTest test, Score score)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    The independence test being used for some steps in final orientation.
    Does the search and returns a PAG.
    void
    setBossUseBes(boolean useBes)
    Sets whether the BES should be used.
    void
    setCompleteRuleSetUsed(boolean completeRuleSetUsed)
    Sets whether the complete (Zhang's) rule set should be used.
    void
    setDepth(int depth)
    Sets the depth of the search (for the constraint-based step).
    void
    setDoDiscriminatingPathColliderRule(boolean doDiscriminatingPathColliderRule)
    Sets whether the discriminating path collider rule should be used.
    void
    setDoDiscriminatingPathTailRule(boolean doDiscriminatingPathTailRule)
    Sets whether the discriminating path tail rule should be used.
    void
    setGuaranteePag(boolean guaranteePag)
    Sets whether to guarantee the output is a PAG by repairing a faulty PAG.
    void
    Sets the knowledge to be used for the search.
    void
    setLeaveOutFinalOrientation(boolean ablationLeaveOutFinalOrientation)
    Sets whether the final orientation should be left out during the search process.
    void
    setMaxPathLength(int maxPathLength)
    Sets the maximum length of any discriminating path.
    void
    setNumStarts(int numStarts)
    Returns the number of times to restart the search.
    void
    setNumThreads(int numThreads)
    Sets the number of threads to use.
    void
    setSeed(long seed)
    Sets the seed for the random number generator.
    void
    setSepsetFinderMethod(int sepsetFinderMethod)
    Sets the method to be used for finding the sepset.
    void
    setVerbose(boolean verbose)
    Sets whether verbose output should be printed.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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)
      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 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.
    • setDoDiscriminatingPathTailRule

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

      public void setDoDiscriminatingPathColliderRule(boolean doDiscriminatingPathColliderRule)
      Sets whether the discriminating path collider rule should be used.
      Parameters:
      doDiscriminatingPathColliderRule - True if the discriminating path collider rule should be used, false.
    • 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.
    • setGuaranteePag

      public void setGuaranteePag(boolean guaranteePag)
      Sets whether to guarantee the output is a PAG by repairing a faulty PAG.
      Parameters:
      guaranteePag - True if a faulty PAG should be repaired, false otherwise.
    • setLeaveOutFinalOrientation

      public void setLeaveOutFinalOrientation(boolean ablationLeaveOutFinalOrientation)
      Sets whether the final orientation should be left out during the search process.
      Parameters:
      ablationLeaveOutFinalOrientation - True to leave out the final orientation, false otherwise.
    • setSepsetFinderMethod

      public void setSepsetFinderMethod(int sepsetFinderMethod)
      Sets the method to be used for finding the sepset.
      Parameters:
      sepsetFinderMethod - The method to be used for finding the sepset.