Package edu.cmu.tetrad.search.utils
Class FgesOrienter
java.lang.Object
edu.cmu.tetrad.search.utils.FgesOrienter
- All Implemented Interfaces:
IGraphSearch
,DagScorer
This Orients a given undirected graph such that the edges in the graph are a superset of the edges in the oriented
graph, using FGES method.
- Version:
- $Id: $Id
- Author:
- AJ Sedgewick, 5/2015
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFgesOrienter
(DataSet dataSet) The data set must either be all continuous or all discrete. -
Method Summary
Modifier and TypeMethodDescriptionGetter for the fieldadjacencies
.int
getDepth()
Getter for the fielddepth
.getDiscreteScore.long
Getter for the fieldelapsedTime
.Getter for the fieldexternalGraph
.Getter for the fieldknowledge
.getOut()
Getter for the fieldout
.double
For BIC score, a multiplier on the penalty term.double
getScore.boolean
isFaithfulnessAssumed.boolean
isLog()
True iff log output should be produced.void
orient.double
scoreDag.search()
Greedy equivalence search: Start from the empty graph, add edges till model is significant.void
setAdjacencies
(Graph adjacencies) Sets the set of preset adjacenies for the algorithm; edges not in this adjacencies graph will not be added.void
setDepth
(int depth) -1 for unlimited depth, otherwise a number >= 0.void
setDiscreteScore
(DiscreteScore DiscreteScore) Sets the discrete scoring function to use.void
setExternalGraph
(Graph externalGraph) Sets the initial graph.void
setFaithfulnessAssumed
(boolean faithfulness) Set to true if it is assumed that all path pairs with one length 1 path do not cancelAll.void
setKnowledge
(Knowledge knowledge) Sets the background knowledge.void
setLog
(boolean log) Sets whether log output should be produced.void
setOut
(PrintStream out) Sets the output stream that output (except for log output) should be sent to.void
setPenaltyDiscount
(double penaltyDiscount) For BIC score, a multiplier on the penalty term.void
setSamplePrior
(double samplePrior) For BDeu score for discrete search; see Chickering (2002).void
setStructurePrior
(double structurePrior) For BDeu score for discrete search; see Chickering (2002).void
setTrueGraph
(Graph trueGraph) If the true graph is set, askterisks will be printed in log output for the true edges.void
setVerbose
(boolean verbose) Sets whether verbose output should be produced.
-
Constructor Details
-
FgesOrienter
-
-
Method Details
-
orient
-
isFaithfulnessAssumed
public boolean isFaithfulnessAssumed()isFaithfulnessAssumed.
- Returns:
- true if it is assumed that all path pairs with one length 1 path do not cancelAll.
-
setFaithfulnessAssumed
public void setFaithfulnessAssumed(boolean faithfulness) Set to true if it is assumed that all path pairs with one length 1 path do not cancelAll.- Parameters:
faithfulness
- a boolean
-
search
Greedy equivalence search: Start from the empty graph, add edges till model is significant. Then start deleting edges till a minimum is achieved.- Specified by:
search
in interfaceIGraphSearch
- Returns:
- the resulting CPDAG.
-
getKnowledge
-
setKnowledge
Sets the background knowledge.- Parameters:
knowledge
- the knowledge object, specifying forbidden and required edges.
-
setStructurePrior
public void setStructurePrior(double structurePrior) For BDeu score for discrete search; see Chickering (2002).- Parameters:
structurePrior
- a double
-
setSamplePrior
public void setSamplePrior(double samplePrior) For BDeu score for discrete search; see Chickering (2002).- Parameters:
samplePrior
- a double
-
getElapsedTime
public long getElapsedTime()Getter for the field
elapsedTime
.- Returns:
- a long
-
getPenaltyDiscount
public double getPenaltyDiscount()For BIC score, a multiplier on the penalty term. For continuous searches.- Returns:
- a double
-
setPenaltyDiscount
public void setPenaltyDiscount(double penaltyDiscount) For BIC score, a multiplier on the penalty term. For continuous searches.- Parameters:
penaltyDiscount
- a double
-
setTrueGraph
-
getScore
-
getDiscreteScore
getDiscreteScore.
- Returns:
- the discrete scoring function being used. By default, BDeu.
-
setDiscreteScore
Sets the discrete scoring function to use.- Parameters:
DiscreteScore
- aDiscreteScore
object
-
isLog
public boolean isLog()True iff log output should be produced.- Returns:
- a boolean
-
setLog
public void setLog(boolean log) Sets whether log output should be produced. Set to false a faster search.- Parameters:
log
- a boolean
-
getExternalGraph
Getter for the field
externalGraph
.- Returns:
- the initial graph for the search. The search is initialized to this graph and proceeds from there.
-
setExternalGraph
-
setVerbose
public void setVerbose(boolean verbose) Sets whether verbose output should be produced.- Parameters:
verbose
- a boolean
-
getOut
Getter for the field
out
.- Returns:
- the output stream that output (except for log output) should be sent to.
-
setOut
Sets the output stream that output (except for log output) should be sent to. By detault System.out.- Parameters:
out
- aPrintStream
object
-
getAdjacencies
Getter for the field
adjacencies
.- Returns:
- the set of preset adjacenies for the algorithm; edges not in this adjacencies graph will not be added.
-
setAdjacencies
-
getDepth
public int getDepth()Getter for the field
depth
.- Returns:
- the depth for the forward reevaluation step.
-
setDepth
public void setDepth(int depth) -1 for unlimited depth, otherwise a number >= 0. In the forward reevaluation step, subsets of neighbors up to depth in size are considered. Limiting depth can speed up the algorithm.- Parameters:
depth
- a int
-
scoreDag
-