Class PcMb

java.lang.Object
edu.cmu.tetrad.search.PcMb
All Implemented Interfaces:
IGraphSearch, IMbSearch

public final class PcMb extends Object implements IMbSearch, IGraphSearch

Searches for a CPDAG representing all the Markov blankets for a given target T consistent with the given independence information. This CPDAG may be used to generate the actual list of DAG's that might be Markov blankets. Note that this code has been converted to be consistent with the CPC algorithm. The reference is here:

Bai, X., Padman, R., Ramsey, J., & Spirtes, P. (2008). Tabu search-enhanced graphical models for classification in high dimensions. INFORMS Journal on Computing, 20(3), 423-437.

This class is configured to respect knowledge of forbidden and required edges, including knowledge of temporal tiers.

Author:
josephramsey
See Also:
  • Constructor Details

    • PcMb

      public PcMb(IndependenceTest test, int depth)
      Constructs a new search.
      Parameters:
      test - The source of conditional independence information for the search.
      depth - The maximum number of variables conditioned on for any
  • Method Details

    • setMeekPreventCycles

      public void setMeekPreventCycles(boolean meekPreventCycles)
      Sets whether cycles should be prevented, using a cycle checker.
      Parameters:
      meekPreventCycles - True, if so.
    • search

      public Graph search(List<Node> targets)
      Searches for the MB CPDAG for the given targets.
      Parameters:
      targets - The targets variable.
    • search

      public Graph search()
      Does the search.
      Specified by:
      search in interface IGraphSearch
      Returns:
      a CPDAG.
    • getAmbiguousTriples

      public Set<Triple> getAmbiguousTriples()
      Returns the set of triples identified as ambiguous by the CPC algorithm during the most recent search.
      Returns:
      This set.
    • getNumIndependenceTests

      public int getNumIndependenceTests()
      Returns the number of independence tests performed during the most recent search.
      Specified by:
      getNumIndependenceTests in interface IMbSearch
      Returns:
      This number.
    • getTargets

      public List<Node> getTargets()
      Return the targets of the most recent search.
      Returns:
      This list.
    • getElapsedTime

      public long getElapsedTime()
      Returns the elapsed time of the most recent search.
      Returns:
      This time.
    • getAlgorithmName

      public String getAlgorithmName()
      Returns "PC-MB."
      Specified by:
      getAlgorithmName in interface IMbSearch
      Returns:
      This string.
    • getDepth

      public int getDepth()
      Returns the depth of the search--that is, the maximum number of variables conditioned on in any conditional independence test.
      Returns:
      This depth.
    • setDepth

      public void setDepth(int depth)
      Sets the maximum number of conditioning variables for any conditional independence test.
      Parameters:
      depth - This depth.
    • resultGraph

      public Graph resultGraph()
      Returns the result graph.
      Returns:
      This graph.
    • findMb

      public Set<Node> findMb(Node target)
      Returns the Markov blanket variables (not the Markov blanket DAG).
      Specified by:
      findMb in interface IMbSearch
      Parameters:
      target - The target variable.
      Returns:
      This list.
    • getTest

      public IndependenceTest getTest()
      Returns the test used in search.
      Returns:
      This test.
    • getKnowledge

      public Knowledge getKnowledge()
      Returns The knowledge used in search.
      Returns:
      This knowledge.
    • setKnowledge

      public void setKnowledge(Knowledge knowledge)
      Sets knowledge, to which the algorithm is in fact sensitive.
      Parameters:
      knowledge - This knowledge.
      See Also:
    • setVariables

      public void setVariables(List<Node> variables)
    • setFindMb

      public void setFindMb(boolean findMb)