Class SvarFas

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

public class SvarFas extends Object implements IFas
Adapts FAS for the time series setting, assuming the data is generated by a SVAR (structural vector autoregression). The main difference is that time order is imposed, and if an edge is removed, it will also remove all homologous edges to preserve the time-repeating structure assumed by SvarFCI. Based on (but not identical to) code by Entner and Hoyer for their 2010 paper. Modified by dmalinsky 4/21/2016.

The references are as follows:

Malinsky, D., & Spirtes, P. (2018, August). Causal structure learning from multivariate time series in settings with unmeasured confounding. In Proceedings of 2018 ACM SIGKDD workshop on causal discovery (pp. 23-47). PMLR.

Entner, D., & Hoyer, P. O. (2010). On causal discovery from time series data using FCI. Probabilistic graphical models, 121-128.

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

Version:
$Id: $Id
Author:
dmalinsky
See Also:
  • Constructor Details

    • SvarFas

      public SvarFas(IndependenceTest test)
      Constructs a new FastAdjacencySearch.
      Parameters:
      test - The independence test.
  • Method Details

    • 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
    • setDepth

      public void setDepth(int depth)
      Sets the depth of the search--that is, the maximum number of variables conditioned on in the search.

      Sets the depth--i.e., the maximum number of variables conditioned on in any test, -1 for unlimited.

      Specified by:
      setDepth in interface IFas
      Parameters:
      depth - This maximum.
    • setKnowledge

      public void setKnowledge(Knowledge knowledge)
      Sets the knowledge for the search.

      Sets the knowledge used in the search.

      Specified by:
      setKnowledge in interface IFas
      Parameters:
      knowledge - This knowledge.
    • getNumIndependenceTests

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

      public SepsetMap getSepsets()
      Returns a map for x _||_ y | Z from {x, y} to Z.
      Specified by:
      getSepsets in interface IFas
      Returns:
      This map.
    • setExternalGraph

      public void setExternalGraph(Graph externalGraph)
      Sets an external graph.
      Parameters:
      externalGraph - This graph.
    • setVerbose

      public void setVerbose(boolean verbose)
      Sets the verbosity of the program.
      Specified by:
      setVerbose in interface IFas
      Parameters:
      verbose - True if verbosity is enabled, False otherwise.
    • 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.
      Throws:
      javax.help.UnsupportedOperationException - since not implementedd.
    • getNodes

      public List<Node> getNodes()
      Retrieves the list of nodes from the current object.
      Specified by:
      getNodes in interface IFas
      Returns:
      The list of nodes.
    • getAmbiguousTriples

      public List<Triple> getAmbiguousTriples(Node node)
      Retrieves the list of ambiguous triples involving the given node.
      Specified by:
      getAmbiguousTriples in interface IFas
      Parameters:
      node - The node.
      Returns:
      The list of ambiguous triples involving the given node.
      See Also:
    • setOut

      public void setOut(PrintStream out)
      Sets the output stream for printing.
      Specified by:
      setOut in interface IFas
      Parameters:
      out - The output stream to be set.