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 R0R4StrategydefaultConfiguration(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.intgetDepth()Retrieves the depth value of the FciOrientDataExaminationStrategyScoreBased object.Returns the knowledge object used by the strategy.Retrieves the knowledge associated with this instance.booleanisUnshieldedCollider(Graph graph, Node i, Node j, Node k) Checks if a collider is unshielded or not.voidsetAllowedColliders(Set<Triple> allowedColliders) Sets the allowed colliders for the current strategy.voidsetDepth(int depth) Sets the depth value of the FciOrientDataExaminationStrategyScoreBased object.voidsetKnowledge(Knowledge knowledge) Sets the Knowledge object for this instance.voidsetVerbose(boolean verbose) Sets the verbose mode for this FciOrientDataExaminationStrategyScoreBased object.static R0R4StrategyspecialConfiguration(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, waitMethods 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:
doDiscriminatingPathOrientationin 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:R0R4StrategyReturns the knowledge object used by the strategy.- Specified by:
getknowledgein interfaceR0R4Strategy- Returns:
- the knowledge object.
-
setAllowedColliders
Description copied from interface:R0R4StrategySets the allowed colliders for the current strategy.- Specified by:
setAllowedCollidersin interfaceR0R4Strategy- Parameters:
allowedColliders- a Set of Triple objects representing the allowed colliders
-
isUnshieldedCollider
Checks if a collider is unshielded or not.- Specified by:
isUnshieldedColliderin 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:
setKnowledgein 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
-