java.lang.Object
edu.cmu.tetrad.search.work_in_progress.Fas2
All Implemented Interfaces:
IFas, IGraphSearch

public class Fas2 extends Object implements IFas
Implements the "fast adjacency search" used in several causal algorithm in this package. In the fast adjacency search, at a given stage of the search, an edge X*-*Y is removed from the graph if X _||_ Y | S, where S is a subset of size d either of adj(X) or of adj(Y), where d is the depth of the search. The fast adjacency search performs this procedure for each pair of adjacent edges in the graph and for each depth d = 0, 1, 2, ..., d1, where d1 is either the maximum depth or else the first such depth at which no edges can be removed. The interpretation of this adjacency search is different for different algorithm, depending on the assumptions of the algorithm. A mapping from {x, y} to S({x, y}) is returned for edges x *-* y that have been removed.
Author:
Joseph Ramsey.
  • Constructor Details

  • Method Details

    • search

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

      public Graph search()
      Discovers all adjacencies in data. The procedure is to remove edges in the graph which connect pairs of variables which are independent conditional on some other set of variables in the graph (the "sepset"). These are removed in tiers. First, edges which are independent conditional on zero other variables are removed, then edges which are independent conditional on one other variable are removed, then two, then three, and so on, until no more edges can be removed from the graph. The edges which remain in the graph after this procedure are the adjacencies in the data.
      Specified by:
      search in interface IGraphSearch
      Returns:
      a SepSet, which indicates which variables are independent conditional on which other variables
    • getDepth

      public int getDepth()
    • setDepth

      public void setDepth(int depth)
      Description copied from interface: IFas
      Sets the depth of the search--that is, the maximum number of variables conditioned on in the search.
      Specified by:
      setDepth in interface IFas
      Parameters:
      depth - This maximum.
    • getKnowledge

      public Knowledge getKnowledge()
    • setKnowledge

      public void setKnowledge(Knowledge knowledge)
      Description copied from interface: IFas
      Sets the knowledge for the search.
      Specified by:
      setKnowledge in interface IFas
      Parameters:
      knowledge - This knowledge.
    • getNumIndependenceTests

      public int getNumIndependenceTests()
      Description copied from interface: IFas
      Returns the number of independence tests done in the search.
      Specified by:
      getNumIndependenceTests in interface IFas
      Returns:
      This number.
    • getSepsets

      public SepsetMap getSepsets()
      Description copied from interface: IFas
      Returns the sepset map discovered during search--that is, the map from node pairs to the sepsets used in the search to remove the corresponding edges from the complete graph.
      Specified by:
      getSepsets in interface IFas
      Returns:
      This map.
    • isVerbose

      public boolean isVerbose()
    • setVerbose

      public void setVerbose(boolean verbose)
      Description copied from interface: IFas
      Sets whether verbose output should be printed.
      Specified by:
      setVerbose in interface IFas
      Parameters:
      verbose - True, if so.
    • getElapsedTime

      public long getElapsedTime()
      Description copied from interface: IFas
      Returns the elapsed time of the search.
      Specified by:
      getElapsedTime in interface IFas
      Returns:
      This time.
    • getNodes

      public List<Node> getNodes()
      Description copied from interface: IFas
      Returns the nodes searched over.
      Specified by:
      getNodes in interface IFas
      Returns:
      This list.
    • getAmbiguousTriples

      public List<Triple> getAmbiguousTriples(Node node)
      Description copied from interface: IFas
      Returns the list of ambiguous triples found for a given node.
      Specified by:
      getAmbiguousTriples in interface IFas
      Parameters:
      node - The node
      Returns:
      The list.
      See Also:
    • setOut

      public void setOut(PrintStream out)
      Description copied from interface: IFas
      sets the print stream to send text to.
      Specified by:
      setOut in interface IFas
      Parameters:
      out - This print stream.
    • setPcHeuristicType

      public void setPcHeuristicType(PcCommon.PcHeuristicType pcHeuristicType)
    • setStable

      public void setStable(boolean b)