Class CpcStable

java.lang.Object
edu.cmu.tetrad.search.CpcStable
All Implemented Interfaces:
GraphSearch

public final class CpcStable extends Object implements GraphSearch
Implements a convervative version of PC, in which the Markov condition is assumed but faithfulness is tested locally. Uses the PC-Stable adjacency search.
Author:
Joseph Ramsey (this version).
  • Constructor Details

    • CpcStable

      public CpcStable(IndependenceTest independenceTest)
      Constructs a CPC algorithm that uses the given independence test as oracle. This does not make a copy of the independence test, for fear of duplicating the data set!
  • Method Details

    • isAggressivelyPreventCycles

      public boolean isAggressivelyPreventCycles()
      Returns:
      true just in case edges will not be added if they would create cycles.
    • setAggressivelyPreventCycles

      public void setAggressivelyPreventCycles(boolean aggressivelyPreventCycles)
      Sets to true just in case edges will not be added if they would create cycles.
    • setDepth

      public void setDepth(int depth)
      Sets the maximum number of variables conditioned on in any conditional independence test. If set to -1, the value of 1000 will be used. May not be set to Integer.MAX_VALUE, due to a Java bug on multi-core systems.
    • getElapsedTime

      public long getElapsedTime()
      Returns:
      the elapsed time of search in milliseconds, after search() has been run.
    • getKnowledge

      public Knowledge getKnowledge()
      Returns:
      the knowledge specification used in the search. Non-null.
    • setKnowledge

      public void setKnowledge(Knowledge knowledge)
      Sets the knowledge specification used in the search. Non-null.
    • getIndependenceTest

      public IndependenceTest getIndependenceTest()
      Returns:
      the independence test used in the search, set in the constructor. This is not returning a copy, for fear of duplicating the data set!
    • getDepth

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

      public Set<Edge> getAdjacencies()
    • getNonadjacencies

      public Set<Edge> getNonadjacencies()
    • search

      public Graph search()
      Runs PC starting with a fully connected graph over all of the variables in the domain of the independence test. See PC for caveats. The number of possible cycles and bidirected edges is far less with CPC than with PC.
      Specified by:
      search in interface GraphSearch
    • search

      public Graph search(List<Node> nodes)
    • search

      public Graph search(IFas fas, List<Node> nodes)
    • isArrowpointAllowed1

      public static boolean isArrowpointAllowed1(Node from, Node to, Knowledge knowledge)
    • getSepsets

      public SepsetMap getSepsets()
    • getGraph

      public Graph getGraph()
      The graph that's constructed during the search.
    • setGraph

      public void setGraph(Graph graph)
    • setVerbose

      public void setVerbose(boolean verbose)
    • setOut

      public void setOut(PrintStream out)
    • getOut

      public PrintStream getOut()