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.

Author:
dmalinsky
See Also:
  • Constructor Details

    • SvarFas

      public SvarFas(IndependenceTest test)
      Constructs a new FastAdjacencySearch.
  • 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--i.e., the maximum number of variables conditioned on in any test, -1 for unlimited.
      Specified by:
      setDepth in interface IFas
      Parameters:
      depth - This depth.
    • setKnowledge

      public void setKnowledge(Knowledge knowledge)
      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 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.
      Throws:
      UnsupportedOperationException - This method is not used.
    • getNodes

      public List<Node> getNodes()
      Returns the nodes of the test.
      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.
      Throws:
      UnsupportedOperationException - This method is not used.
      See Also:
    • setOut

      public void setOut(PrintStream out)
      Sets the output stream for printing, default is System.out.
      Specified by:
      setOut in interface IFas
      Parameters:
      out - The print stream.
      See Also: