Class MagToPag
java.lang.Object
edu.cmu.tetrad.search.utils.MagToPag
Converts a MAG to a PAG.
- Version:
- $Id: $Id
- Author:
- josephramsey, peterspirtes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvert(boolean checkMag, boolean excludeSelectionBias) This method does the conversion of MAG to PAG.static R0R4StrategyTestBasedgetFinalStrategyUsingDsep(Graph mag, Knowledge knowledge, boolean verbose, Map<Node, Set<Node>> ancestorCache) Returns the final strategy for finding a PAG using D-SEP.Getter for the fieldknowledge.booleanisCompleteRuleSetUsed.voidsetCompleteRuleSetUsed(boolean completeRuleSetUsed) Setter for the fieldcompleteRuleSetUsed.voidsetKnowledge(Knowledge knowledge) Setter for the fieldknowledge.voidsetMaxDiscriminatingPathLength(int maxDiscriminatingPathLength) Sets the maximum length of discriminating paths to be considered during processing.voidsetRecursiveDepth(int recursiveDepth) Sets the maximum length of blocking paths to be considered during processing.voidsetVerbose(boolean verbose) Sets whether verbose output should be printed.
-
Constructor Details
-
MagToPag
-
-
Method Details
-
getFinalStrategyUsingDsep
public static R0R4StrategyTestBased getFinalStrategyUsingDsep(Graph mag, Knowledge knowledge, boolean verbose, Map<Node, Set<Node>> ancestorCache) Returns the final strategy for finding a PAG using D-SEP.- Parameters:
mag- the MAG (Maximum Ancestral Graph) representation of the graphknowledge- the background knowledge used for the orientationverbose- a boolean indicating whether verbose output should be printedancestorCache- precomputed per-node ancestor sets for O(n) anteriority lookups- Returns:
- the final strategy for finding a PAG using D-SEP
-
convert
This method does the conversion of MAG to PAG.- Parameters:
checkMag- Whether to check if the MAG is legal before conversion.excludeSelectionBias- True to exclude selection bias, false otherwise.- Returns:
- Returns the converted PAG.
- Throws:
IllegalStateException- if a discriminating path cannot be found.
-
setRecursiveDepth
public void setRecursiveDepth(int recursiveDepth) Sets the maximum length of blocking paths to be considered during processing.- Parameters:
recursiveDepth- the maximum length of blocking paths
-
getKnowledge
-
setKnowledge
-
isCompleteRuleSetUsed
public boolean isCompleteRuleSetUsed()isCompleteRuleSetUsed.
- Returns:
- true if Zhang's complete rule set should be used, false if only R1-R4 (the rule set of the original FCI) should be used. False by default.
-
setCompleteRuleSetUsed
public void setCompleteRuleSetUsed(boolean completeRuleSetUsed) Setter for the field
completeRuleSetUsed.- Parameters:
completeRuleSetUsed- set to true if Zhang's complete rule set should be used, false if only R1-R4 (the rule set of the original FCI) should be used. False by default.
-
setVerbose
public void setVerbose(boolean verbose) Sets whether verbose output should be printed.- Parameters:
verbose- True, if so.
-
setMaxDiscriminatingPathLength
public void setMaxDiscriminatingPathLength(int maxDiscriminatingPathLength) Sets the maximum length of discriminating paths to be considered during processing.- Parameters:
maxDiscriminatingPathLength- the maximum length of discriminating paths
-