Class IGFci
java.lang.Object
edu.cmu.tetrad.search.work_in_progress.IGFci
- All Implemented Interfaces:
IGraphSearch
Instance-specific GFci given in Fattaneh Jabbari's dissertation (Pages 144-147)
- Author:
- Fattaneh
-
Constructor Summary
ConstructorsConstructorDescriptionIGFci
(IndependenceTest test, ISScore score) Constructs an instance of IGFci with the provided independence test and score.IGFci
(IndependenceTest test, ISScore score, Graph populationGraph) Constructs an instance of IGFci with the provided independence test, score, and population graph. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the current covariance matrix object used by the IGFci algorithm.Retrieves the current covariance matrix object used by the IGFci algorithm.Retrieves the current independence test object being used.Returns the knowledge used in the IGFci algorithm.int
Retrieves the maximum degree for the graph.int
Retrieves the maximum length of any path, or -1 if unlimited.getOut()
Retrieves the current PrintStream used for output by the IGFci algorithm.boolean
Checks if the complete rule set is being used in the IGFci algorithm.boolean
Checks if verbose output is enabled.void
modifiedR0
(Graph fgesGraph) Modifies the given FGES graph based on the FCI algorithm rules, reorienting edges and potentially identifying and orienting definite colliders.search()
Executes the FCI algorithm using the provided independence test, score, and population graph, and returns the resulting graph with edges oriented according to the algorithm's rules.void
setCompleteRuleSetUsed
(boolean completeRuleSetUsed) Sets whether the complete rule set should be used in the IGFci algorithm.void
setCovarianceMatrix
(ICovarianceMatrix covarianceMatrix) Sets the covariance matrix to be used in the IGFci algorithm.void
setFaithfulnessAssumed
(boolean faithfulnessAssumed) Sets whether faithfulness is assumed in the IGFci algorithm.void
setIndependenceTest
(IndependenceTest independenceTest) Sets the independence test for the IGFci algorithm.void
setKnowledge
(Knowledge knowledge) Sets the knowledge for the IGFci algorithm.void
setMaxDegree
(int maxDegree) Sets the maximum degree for the graph.void
setMaxPathLength
(int maxPathLength) Sets the maximum length for any path in the graph.void
setOut
(PrintStream out) Sets the PrintStream object used for output by the IGFci instance.void
setVerbose
(boolean verbose) Sets whether verbose output should be printed.
-
Constructor Details
-
IGFci
Constructs an instance of IGFci with the provided independence test and score.- Parameters:
test
- the IndependenceTest instance to be used; must not be null.score
- the ISScore instance to be used; must not be null.- Throws:
NullPointerException
- if the provided score is null.
-
IGFci
Constructs an instance of IGFci with the provided independence test, score, and population graph.- Parameters:
test
- the IndependenceTest instance to be used; must not be null.score
- the ISScore instance to be used; must not be null.populationGraph
- the Graph representing the population.- Throws:
NullPointerException
- if the provided score is null.
-
-
Method Details
-
search
Executes the FCI algorithm using the provided independence test, score, and population graph, and returns the resulting graph with edges oriented according to the algorithm's rules. The algorithm first constructs an initial graph, prunes it based on separation sets, and further refines it using multiple phases of orientation rules. The time taken to complete the search is recorded and stored in the elapsedTime field.- Specified by:
search
in interfaceIGraphSearch
- Returns:
- the final oriented graph obtained after applying the FCI algorithm.
- Throws:
InterruptedException
- if any.
-
setMaxDegree
public void setMaxDegree(int maxDegree) Sets the maximum degree for the graph.- Parameters:
maxDegree
- the maximum degree, where -1 indicates unlimited. Must be -1 or a non-negative integer.- Throws:
IllegalArgumentException
- if maxDegree is less than -1.
-
getMaxDegree
public int getMaxDegree()Retrieves the maximum degree for the graph.- Returns:
- the maximum degree, or -1 if it is unlimited.
-
modifiedR0
Modifies the given FGES graph based on the FCI algorithm rules, reorienting edges and potentially identifying and orienting definite colliders.- Parameters:
fgesGraph
- the FGES Graph to be processed; must not be null.- Throws:
InterruptedException
-
getKnowledge
Returns the knowledge used in the IGFci algorithm.- Returns:
- the Knowledge object currently used by the IGFci algorithm.
-
setKnowledge
Sets the knowledge for the IGFci algorithm.- Parameters:
knowledge
- the Knowledge object to be set; must not be null.- Throws:
NullPointerException
- if the provided knowledge is null.
-
isCompleteRuleSetUsed
public boolean isCompleteRuleSetUsed()Checks if the complete rule set is being used in the IGFci algorithm.- Returns:
- true if the complete rule set is used, false otherwise.
-
setCompleteRuleSetUsed
public void setCompleteRuleSetUsed(boolean completeRuleSetUsed) Sets whether the complete rule set should be used in the IGFci algorithm.- Parameters:
completeRuleSetUsed
- true if the complete rule set is to be used, false otherwise
-
getMaxPathLength
public int getMaxPathLength()Retrieves the maximum length of any path, or -1 if unlimited.- Returns:
- the maximum length of any path, or -1 if unlimited.
-
setMaxPathLength
public void setMaxPathLength(int maxPathLength) Sets the maximum length for any path in the graph. The value must be -1 to indicate unlimited length or a non-negative integer to specify the maximum path length.- Parameters:
maxPathLength
- the maximum path length to be set, where -1 indicates unlimited. Must be -1 or a non-negative integer.- Throws:
IllegalArgumentException
- if maxPathLength is less than -1.
-
isVerbose
public boolean isVerbose()Checks if verbose output is enabled.- Returns:
- true if verbose output is enabled, false otherwise.
-
setVerbose
public void setVerbose(boolean verbose) Sets whether verbose output should be printed.- Parameters:
verbose
- true if verbose output should be printed, false otherwise
-
getIndependenceTest
Retrieves the current independence test object being used.- Returns:
- the IndependenceTest object currently set for this instance.
-
getCovMatrix
Retrieves the current covariance matrix object used by the IGFci algorithm.- Returns:
- the ICovarianceMatrix object currently set for this instance.
-
getCovarianceMatrix
Retrieves the current covariance matrix object used by the IGFci algorithm.- Returns:
- the ICovarianceMatrix object currently set for this instance.
-
setCovarianceMatrix
Sets the covariance matrix to be used in the IGFci algorithm.- Parameters:
covarianceMatrix
- the ICovarianceMatrix object to be set; must not be null.
-
getOut
Retrieves the current PrintStream used for output by the IGFci algorithm.- Returns:
- the PrintStream object currently set for this instance.
-
setOut
Sets the PrintStream object used for output by the IGFci instance.- Parameters:
out
- the PrintStream object to be used for output; must not be null.
-
setIndependenceTest
Sets the independence test for the IGFci algorithm.- Parameters:
independenceTest
- the IndependenceTest object to be set; must not be null.
-
setFaithfulnessAssumed
public void setFaithfulnessAssumed(boolean faithfulnessAssumed) Sets whether faithfulness is assumed in the IGFci algorithm.- Parameters:
faithfulnessAssumed
- true if faithfulness is assumed, false otherwise
-