Class GFci
- All Implemented Interfaces:
IGraphSearch
Ogarrio, J. M., Spirtes, P., & Ramsey, J. (2016, August). A hybrid causal search algorithm for latent variable models. In Conference on probabilistic graphical models (pp. 368-379). PMLR.
Because the method both runs FGES (a score-based algorithm) and does additional checking of conditional independencies, both as part of its collider orientation step and also as part of the the definite discriminating path step in the final FCI orientation rules, both a score and a test need to be used to construct a GFCI algorithm.
Note that various score-based algorithms could be used in place of FGES for the initial step; in this repository we give three other options, GRaSP-FCI, BFCI (BOSS FCI), and SP-FCI (see).
For more information on the algorithm, see the reference above.
This class is configured to respect knowledge of forbidden and required edges, including knowledge of temporal tiers.
- Version:
- $Id: $Id
- Author:
- Juan Miguel Ogarrio, peterspirtes, josephramsey
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGFci
(IndependenceTest test, Score score) Constructs a new GFci algorithm with the given independence test and score. -
Method Summary
Modifier and TypeMethodDescriptionReturns the independence test used in search.Returns the knowledge used in search.search()
Runs the graph and returns the search PAG.void
setCompleteRuleSetUsed
(boolean completeRuleSetUsed) Sets whether Zhang's complete rules are used.void
setDepth
(int depth) Sets the depth of the search for the possible m-sep search.void
setFaithfulnessAssumed
(boolean faithfulnessAssumed) Sets whether one-edge faithfulness is assumed.void
setGuaranteePag
(boolean guaranteePag) Sets the flag indicating whether to guarantee the output is a legal PAG.void
setKnowledge
(Knowledge knowledge) Sets the knowledge to use in search.void
setMaxDegree
(int maxDegree) Sets the maximum indegree of the output graph.void
setMaxDiscriminatingPathLength
(int maxDiscriminatingPathLength) Sets the maximum length of any discriminating path.void
setNumThreads
(int numThreads) Sets the number of threads to use in the search.void
setOut
(PrintStream out) Sets the print stream used for output, default System.out.void
setSepsetFinderMethod
(int sepsetFinderMethod) Sets the method used to find the sepset in the GFci algorithm.void
setVerbose
(boolean verbose) Sets whether verbose output should be printed.
-
Constructor Details
-
GFci
Constructs a new GFci algorithm with the given independence test and score.- Parameters:
test
- The independence test to use.score
- The score to use.
-
-
Method Details
-
search
Runs the graph and returns the search PAG.- Specified by:
search
in interfaceIGraphSearch
- Returns:
- This PAG.
- Throws:
InterruptedException
- if any.
-
setMaxDegree
public void setMaxDegree(int maxDegree) Sets the maximum indegree of the output graph.- Parameters:
maxDegree
- This maximum.
-
getKnowledge
-
setKnowledge
Sets the knowledge to use in search.- Parameters:
knowledge
- This knowledge.
-
setCompleteRuleSetUsed
public void setCompleteRuleSetUsed(boolean completeRuleSetUsed) Sets whether Zhang's complete rules are used.- Parameters:
completeRuleSetUsed
- set to 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. True 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, if so.
-
getIndependenceTest
Returns the independence test used in search.- Returns:
- This test.
-
setOut
Sets the print stream used for output, default System.out.- Parameters:
out
- This print stream.
-
setFaithfulnessAssumed
public void setFaithfulnessAssumed(boolean faithfulnessAssumed) Sets whether one-edge faithfulness is assumed. For FGES- Parameters:
faithfulnessAssumed
- True, if so.- See Also:
-
setDepth
public void setDepth(int depth) Sets the depth of the search for the possible m-sep search.- Parameters:
depth
- This depth.
-
setNumThreads
public void setNumThreads(int numThreads) Sets the number of threads to use in the search.- Parameters:
numThreads
- The number of threads to use. Must be at least 1.
-
setGuaranteePag
public void setGuaranteePag(boolean guaranteePag) Sets the flag indicating whether to guarantee the output is a legal PAG.- Parameters:
guaranteePag
- A boolean value indicating whether to guarantee the output is a legal PAG.
-
setSepsetFinderMethod
public void setSepsetFinderMethod(int sepsetFinderMethod) Sets the method used to find the sepset in the GFci algorithm.- Parameters:
sepsetFinderMethod
- The method used to find the sepset. - 0: Default method - 1: Custom method 1 - 2: Custom method 2 - ...
-