Package edu.cmu.tetrad.search.utils
Class R0R4StrategyScoreBased
java.lang.Object
edu.cmu.tetrad.search.utils.R0R4StrategyScoreBased
- All Implemented Interfaces:
R0R4Strategy
The FciOrientDataExaminationStrategyTestBased class implements the FciOrientDataExaminationStrategy interface and
provides methods for checking unshielded colliders and determining orientations based on the Discriminating Path
Rule.
This classes uses a TeyssierScorer object to determine the sepset for two nodes, e and c, which can only be determined by looking at the data.
- Author:
- jdramsey
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic R0R4Strategy
defaultConfiguration
(TeyssierScorer scorer, Knowledge knowledge, boolean verbose) Returns a default configuration of the FciOrientDataExaminationStrategy.org.apache.commons.lang3.tuple.Pair
<DiscriminatingPath, Boolean> doDiscriminatingPathOrientation
(DiscriminatingPath discriminatingPath, Graph graph, Set<Node> vNodes) Does a discriminating path orientation based on the Discriminating Path Rule.int
getDepth()
Retrieves the depth value of the FciOrientDataExaminationStrategyScoreBased object.Returns the knowledge object used by the strategy.Retrieves the knowledge associated with this instance.boolean
isUnshieldedCollider
(Graph graph, Node i, Node j, Node k) Checks if a collider is unshielded or not.void
setAllowedColliders
(Set<Triple> allowedColliders) Sets the allowed colliders for the current strategy.void
setDepth
(int depth) Sets the depth value of the FciOrientDataExaminationStrategyScoreBased object.void
setKnowledge
(Knowledge knowledge) Sets the Knowledge object for this instance.void
setVerbose
(boolean verbose) Sets the verbose mode for this FciOrientDataExaminationStrategyScoreBased object.static R0R4Strategy
specialConfiguration
(TeyssierScorer scorer, Knowledge knowledge, boolean verbose, int depth) Returns a special configuration of FciOrientDataExaminationStrategy.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface edu.cmu.tetrad.search.utils.R0R4Strategy
getInitialAllowedColliders, setInitialAllowedColliders
-
Method Details
-
specialConfiguration
public static R0R4Strategy specialConfiguration(TeyssierScorer scorer, Knowledge knowledge, boolean verbose, int depth) Returns a special configuration of FciOrientDataExaminationStrategy.- Parameters:
scorer
- the TeyssierScorer objectknowledge
- the Knowledge objectverbose
- a boolean indicating if verbose mode is enableddepth
- the depth- Returns:
- an instance of FciOrientDataExaminationStrategy with the specified configuration
-
defaultConfiguration
public static R0R4Strategy defaultConfiguration(TeyssierScorer scorer, Knowledge knowledge, boolean verbose) Returns a default configuration of the FciOrientDataExaminationStrategy.- Parameters:
scorer
- the TeyssierScorer objectknowledge
- the Knowledge objectverbose
- a boolean indicating if verbose mode is enabled- Returns:
- an instance of FciOrientDataExaminationStrategy with the default configuration
-
doDiscriminatingPathOrientation
public org.apache.commons.lang3.tuple.Pair<DiscriminatingPath,Boolean> doDiscriminatingPathOrientation(DiscriminatingPath discriminatingPath, Graph graph, Set<Node> vNodes) Does a discriminating path orientation based on the Discriminating Path Rule.- Specified by:
doDiscriminatingPathOrientation
in interfaceR0R4Strategy
- Parameters:
discriminatingPath
- the discriminating pathgraph
- the graph representationvNodes
- the set of nodes that are v-structures in the graph- Returns:
- The discriminating path is returned as the first element of the pair, and a boolean indicating whether the orientation was done is returned as the second element of the pair.
- Throws:
IllegalArgumentException
- if 'e' is adjacent to 'c'- See Also:
-
getknowledge
Description copied from interface:R0R4Strategy
Returns the knowledge object used by the strategy.- Specified by:
getknowledge
in interfaceR0R4Strategy
- Returns:
- the knowledge object.
-
setAllowedColliders
Description copied from interface:R0R4Strategy
Sets the allowed colliders for the current strategy.- Specified by:
setAllowedColliders
in interfaceR0R4Strategy
- Parameters:
allowedColliders
- a Set of Triple objects representing the allowed colliders
-
isUnshieldedCollider
Checks if a collider is unshielded or not.- Specified by:
isUnshieldedCollider
in interfaceR0R4Strategy
- Parameters:
graph
- the graph containing the nodesi
- the first node of the colliderj
- the second node of the colliderk
- the third node of the collider- Returns:
- true if the collider is unshielded, false otherwise
-
setVerbose
public void setVerbose(boolean verbose) Sets the verbose mode for this FciOrientDataExaminationStrategyScoreBased object.- Parameters:
verbose
- a boolean indicating if verbose mode is enabled
-
getKnowledge
Retrieves the knowledge associated with this instance.- Returns:
- the Knowledge object associated with this instance
-
setKnowledge
Sets the Knowledge object for this instance.- Specified by:
setKnowledge
in interfaceR0R4Strategy
- Parameters:
knowledge
- the Knowledge object to be set
-
getDepth
public int getDepth()Retrieves the depth value of the FciOrientDataExaminationStrategyScoreBased object.- Returns:
- the depth value of the FciOrientDataExaminationStrategyScoreBased object
-
setDepth
public void setDepth(int depth) Sets the depth value of the FciOrientDataExaminationStrategyScoreBased object.- Parameters:
depth
- the depth value to be set
-