Class Fci
- All Implemented Interfaces:
IGraphSearch
Implements the Fast Causal Inference (FCI) algorithm due to Peter Spirtes, which addressed the case where latent common causes cannot be assumed not to exist with respect to the data set being analyzed. That is, it is assumed that there may be variables that are not included in the data that nonetheless may be causes of two or more variables that are included in data.
Two alternatives are provided for doing the final orientation step, one due to Peter Spirtes, which is arrow complete, and another due to Jiji Zhang, which is arrow and tail complete.
This algorithm, with the Spirtes final orientation rules, was given in an earlier version of this book:
Spirtes, P., Glymour, C. N., Scheines, R., & Heckerman, D. (2000). Causation, prediction, and search. MIT press.
The algorithm with the Zhang final orientation rules was given in this reference:
Zhang, J. (2008). On the completeness of orientation rules for causal discovery in the presence of latent confounders and selection bias. Artificial Intelligence, 172(16-17), 1873-1896.
This class is configured to respect knowledge of forbidden and required edges, including knowledge of temporal tiers.
-
Constructor Summary
ConstructorsConstructorDescriptionFci
(IndependenceTest independenceTest) Constructor.Fci
(IndependenceTest independenceTest, List<Node> searchVars) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the elapsed time of search.Returns the independence test used in search.Returns the background knowledge that was set.Returns the sepset map from FAS.search()
Runs the search and returns a graph.void
setCompleteRuleSetUsed
(boolean completeRuleSetUsed) Sets whether the Zhang complete rule set should be used; false if only R1-R4 (the rule set of the original FCI) should be used.void
setDepth
(int depth) Sets the depth of search, which is the maximum number of variables conditioned on in any test.void
setDoDiscriminatingPathRule
(boolean doDiscriminatingPathRule) Sets whether the discriminating path rule should be used.void
setKnowledge
(Knowledge knowledge) Sets background knowledge for the search.void
setMaxPathLength
(int maxPathLength) Sets the maximum length of any discriminating path, or -1 if unlimited.void
setPcHeuristicType
(PcCommon.PcHeuristicType heuristic) Sets which PC heuristic type should be used in the initial adjacency search.void
setPossibleMsepSearchDone
(boolean possibleMsepSearchDone) Sets whether the (time-consuming) possible msep step should be done.void
setStable
(boolean stable) Sets whether the stable options should be used in the initial adjacency search.void
setVerbose
(boolean verbose) Sets whether verbose output should be printed.
-
Constructor Details
-
Fci
Constructor.- Parameters:
independenceTest
- The test to use for oracle conditional independence information.
-
Fci
Constructor.- Parameters:
independenceTest
- The test to use for oracle conditional independence information.searchVars
- A specific list of variables to search over.
-
-
Method Details
-
search
Description copied from interface:IGraphSearch
Runs the search and returns a graph.- Specified by:
search
in interfaceIGraphSearch
- Returns:
- The discovered graph.
-
setDepth
public void setDepth(int depth) Sets the depth of search, which is the maximum number of variables conditioned on in any test.- Parameters:
depth
- This maximum.
-
getElapsedTime
public long getElapsedTime()Returns the elapsed time of search.- Returns:
- This time.
-
getSepsets
Returns the sepset map from FAS.- Returns:
- This map.
- See Also:
-
getKnowledge
Returns the background knowledge that was set.- Returns:
- This knowledge.
-
setKnowledge
Sets background knowledge for the search.- Parameters:
knowledge
- This knowledge.
-
setCompleteRuleSetUsed
public void setCompleteRuleSetUsed(boolean completeRuleSetUsed) Sets whether the Zhang complete rule set should be used; false if only R1-R4 (the rule set of the original FCI) should be used. False by default.- Parameters:
completeRuleSetUsed
- True for the complete Zhang rule set.
-
setPossibleMsepSearchDone
public void setPossibleMsepSearchDone(boolean possibleMsepSearchDone) Sets whether the (time-consuming) possible msep step should be done.- Parameters:
possibleMsepSearchDone
- True, if so.
-
setMaxPathLength
public void setMaxPathLength(int maxPathLength) Sets 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, if so.
-
getIndependenceTest
Returns the independence test used in search.- Returns:
- This test.
-
setPcHeuristicType
Sets which PC heuristic type should be used in the initial adjacency search.- Parameters:
heuristic
- The heuristic type.- See Also:
-
setStable
public void setStable(boolean stable) Sets whether the stable options should be used in the initial adjacency search.- Parameters:
stable
- 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.
-