Class MagToPag

java.lang.Object
edu.cmu.tetrad.search.utils.MagToPag

public final class MagToPag extends Object
Converts a MAG to a PAG.
Version:
$Id: $Id
Author:
josephramsey, peterspirtes
  • Constructor Details

    • MagToPag

      public MagToPag(Graph mag)
      Constructs a new FCI search for the given independence test and background knowledge.
      Parameters:
      mag - a Graph object
  • Method Details

    • getFinalStrategyUsingDsep

      public static R0R4StrategyTestBased getFinalStrategyUsingDsep(Graph mag, Knowledge knowledge, boolean verbose)
      Returns the final strategy for finding a PAG using D-SEP.
      Parameters:
      mag - the MAG (Maximum Ancestral Graph) representation of the graph
      knowledge - the background knowledge used for the orientation
      verbose - a boolean indicating whether verabose output should be printed
      Returns:
      the final strategy for finding a PAG using D-SEP
    • convert

      public Graph convert(boolean checkMag)
      This method does the conversion of MAG to PAG.
      Parameters:
      checkMag - Whether to check if the MAG is legal before conversion.
      Returns:
      Returns the converted PAG.
    • getKnowledge

      public Knowledge getKnowledge()

      Getter for the field knowledge.

      Returns:
      a Knowledge object
    • setKnowledge

      public void setKnowledge(Knowledge knowledge)

      Setter for the field knowledge.

      Parameters:
      knowledge - a Knowledge object
    • 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)
      Setws whether verbose output should be printed.
      Parameters:
      verbose - True, if so.