Class FgesMb
- All Implemented Interfaces:
- DagScorer
Ramsey, J., Glymour, M., Sanchez-Romero, R., & Glymour, C. (2017). A million variables and more: the fast greedy equivalence search algorithm for learning high-dimensional graphical causal models, with an application to functional magnetic resonance images. International journal of data science and analytics, 3, 121-129.
The reference for Chickering's GES is this:
Chickering (2002) "Optimal structure identification with greedy search" Journal of Machine Learning Research.
FGES works for the continuous case, the discrete case, and the mixed continuous/discrete case, so long as a BIC score is available for the type of data in question.
To speed things up, it has been assumed that variables X and Y with zero correlation do not correspond to edges in the graph. This is a restricted form of the heuristic speedup assumption, something GES does not assume. This heuristic speedup assumption needs to be explicitly turned on using setHeuristicSpeedup(true).
Also, edges to be added or remove from the graph in the forward or backward phase, respectively are cached, together with the ancillary information needed to do the additions or removals, to reduce rescoring.
A number of other optimizations were also. See code for details.
This class is configured to respect knowledge of forbidden and required edges, including knowledge of temporal tiers.
- Version:
- $Id: $Id
- Author:
- Ricardo Silva, josephramsey
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionlongReturns the elapsed time of the search.Returns the background knowledge.intThe maximum of parents any nodes can have in the output pattern.doubleReturns the score of the final search model.getOut()Returns the output stream associated with this object.doubleScores the given directed acyclic graph (DAG).Greedy equivalence search: Start from the empty graph, add edges till the model is significant.voidsetBoundGraph(Graph boundGraph) If non-null, edges not adjacent in this graph will not be added.voidsetFaithfulnessAssumed(boolean faithfulnessAssumed) Sets whether one-edge faithfulness should be assumed.voidsetInitialGraph(Graph initialGraph) Sets the initial graph for the software.voidsetKnowledge(Knowledge knowledge) Sets the background knowledge.voidsetMaxDegree(int maxDegree) The maximum of parents any nodes can have in the output pattern.voidsetNumExpansions(int numExpansions) Sets the number of expansions for a given object.voidsetOut(PrintStream out) Sets the output stream that output (except for log output) should be sent to.voidsetParallelized(boolean parallelized) Sets the parallelized flag of the object.voidsetSymmetricFirstStep(boolean symmetricFirstStep) Sets whether the first step of the procedure will score both X->Y and Y->X and prefer the higher score (for adding X--Y to the graph).voidsetTrimmingStyle(int trimmingStyle) Sets the trimming style for the algorithm.voidsetVerbose(boolean verbose) Sets whether verbose output should be produced.
- 
Constructor Details- 
FgesMbConstructor. Construct a Score and pass it in here. The totalScore should return a positive value in case of conditional dependence and a negative values in case of conditional independence. See Chickering (2002), locally consistent scoring criterion. This by default uses all the processors on the machine.- Parameters:
- score- The score to use. The score should yield better scores for more correct local models. The algorithm as given by Chickering assumes the score will be a BIC score of some sort.
 
 
- 
- 
Method Details- 
setTrimmingStylepublic void setTrimmingStyle(int trimmingStyle) Sets the trimming style for the algorithm.- Parameters:
- trimmingStyle- The trimming style to be set. It represents how edges are trimmed during the search. The valid values are: - 0: No trimming. All edges are considered during the search. - 1: Forward trimming. Edges are trimmed only during the forward search phase. - 2: Backward trimming. Edges are trimmed only during the backward search phase.
 
- 
searchGreedy equivalence search: Start from the empty graph, add edges till the model is significant. Then start deleting edges till a minimum is achieved.- Parameters:
- targets- a- Listobject
- Returns:
- the resulting Pattern.
- Throws:
- InterruptedException- if any
 
- 
setFaithfulnessAssumedpublic void setFaithfulnessAssumed(boolean faithfulnessAssumed) Sets whether one-edge faithfulness should be assumed. This assumption is that if X and Y are unconditionally dependent, then there is an edge between X and Y in the graph. This could in principle be false, as for a path cancellation whether one path is A->B->C->D and the other path is A->D.- Parameters:
- faithfulnessAssumed- True, if so.
 
- 
getKnowledgeReturns the background knowledge.- Returns:
- This knowledge
 
- 
setKnowledgeSets the background knowledge.- Parameters:
- knowledge- the knowledge object, specifying forbidden and required edges.
 
- 
getElapsedTimepublic long getElapsedTime()Returns the elapsed time of the search.- Returns:
- This elapsed time.
 
- 
scoreDagScores the given directed acyclic graph (DAG).
- 
setVerbosepublic void setVerbose(boolean verbose) Sets whether verbose output should be produced. Verbose output generated by the Meek rules is treated separately.- Parameters:
- verbose- True iff the case.
 
- 
getOutReturns the output stream associated with this object.- Returns:
- the output stream
 
- 
setOutSets the output stream that output (except for log output) should be sent to. By default System.out.- Parameters:
- out- This print stream.
 
- 
setBoundGraphIf non-null, edges not adjacent in this graph will not be added.- Parameters:
- boundGraph- This bound graph.
 
- 
getMaxDegreepublic int getMaxDegree()The maximum of parents any nodes can have in the output pattern.- Returns:
- -1 for unlimited.
 
- 
setMaxDegreepublic void setMaxDegree(int maxDegree) The maximum of parents any nodes can have in the output pattern.- Parameters:
- maxDegree- -1 for unlimited.
 
- 
setSymmetricFirstSteppublic void setSymmetricFirstStep(boolean symmetricFirstStep) Sets whether the first step of the procedure will score both X->Y and Y->X and prefer the higher score (for adding X--Y to the graph).- Parameters:
- symmetricFirstStep- True iff the case.
 
- 
getModelScorepublic double getModelScore()Returns the score of the final search model.- Returns:
- This score.
 
- 
setParallelizedpublic void setParallelized(boolean parallelized) Sets the parallelized flag of the object.- Parameters:
- parallelized- the value indicating whether the object should be parallelized
 
- 
setInitialGraphSets the initial graph for the software.- Parameters:
- initialGraph- the initial graph to be set
 
- 
setNumExpansionspublic void setNumExpansions(int numExpansions) Sets the number of expansions for a given object.- Parameters:
- numExpansions- the number of expansions to set. Must be at least 1.
- Throws:
- IllegalArgumentException- if the number of expansions is less than 1.
 
 
-