Class GFci
- All Implemented Interfaces:
IGraphSearch
Implements a modification of FCI that started by running the FGES algorithm and then fixes that result to be correct for latent variables models. First, colliders from the FGES results are copied into the final circle-circle graph, and some independence reasoning is used to add the remaining colliders into the graph. Then, the FCI final orientation rules are applied. The reference is here:
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.
-
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
setDoDiscriminatingPathRule
(boolean doDiscriminatingPathRule) Sets whether the discriminating path rule should be used.void
setFaithfulnessAssumed
(boolean faithfulnessAssumed) Sets whether one-edge faithfulness is assumed.void
setKnowledge
(Knowledge knowledge) Sets the knowledge to use in search.void
setMaxDegree
(int maxDegree) Sets the maximum indegree of the output graph.void
setMaxPathLength
(int maxPathLength) Sets the maximum path length for the discriminating path rule.void
setOut
(PrintStream out) Sets the print stream used for output, default System.out.void
setPossibleMsepSearchDone
(boolean possibleMsepSearchDone) Sets whether the possible m-sep search should be done.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.
-
setMaxDegree
public void setMaxDegree(int maxDegree) Sets the maximum indegree of the output graph.- Parameters:
maxDegree
- This maximum.
-
getKnowledge
Returns the knowledge used in search.- Returns:
- This knowledge
-
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.
-
setMaxPathLength
public void setMaxPathLength(int maxPathLength) Sets the maximum path length for the discriminating path rule.- 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, 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:
-
setDoDiscriminatingPathRule
public void setDoDiscriminatingPathRule(boolean doDiscriminatingPathRule) Sets whether the discriminating path rule should be used.- Parameters:
doDiscriminatingPathRule
- True, if so.
-
setPossibleMsepSearchDone
public void setPossibleMsepSearchDone(boolean possibleMsepSearchDone) Sets whether the possible m-sep search should be done.- Parameters:
possibleMsepSearchDone
- True, if so.
-
setDepth
public void setDepth(int depth) Sets the depth of the search for the possible m-sep search.- Parameters:
depth
- This depth.
-