Package edu.cmu.tetrad.search
Class BFci
java.lang.Object
edu.cmu.tetrad.search.BFci
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionThe independence test being used for some steps in final orientation.search()
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
setGuaranteePag
(boolean guaranteePag) Sets whether to guarantee the output is a PAG by repairing a faulty PAG.void
setKnowledge
(Knowledge knowledge) Sets the knowledge to be used for the search.void
setMaxDiscriminatingPathLength
(int maxDiscriminatingPathLength) 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.
-
Constructor Details
-
BFci
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
Does the search and returns a PAG.- Specified by:
search
in interfaceIGraphSearch
- Returns:
- The discovered graph.
- Throws:
InterruptedException
- if any.
-
setKnowledge
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.
-
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.
-
setVerbose
public void setVerbose(boolean verbose) Sets whether verbose output should be printed.- Parameters:
verbose
- True iff the case
-
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.
-
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.
-
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.
-