Package edu.cmu.tetrad.search
Class SvarFas
java.lang.Object
edu.cmu.tetrad.search.SvarFas
- All Implemented Interfaces:
IFas,IGraphSearch
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAmbiguousTriples(Node node) Retrieves the list of ambiguous triples involving the given node.longReturns the elapsed time of the search.getNodes()Retrieves the list of nodes from the current object.intReturns the number of independence tests.Returns a map for x _||_ y | Z from {x, y} to Z.search()Discovers all adjacencies in data.voidsetDepth(int depth) Sets the depth of the search--that is, the maximum number of variables conditioned on in the search.voidsetExternalGraph(Graph externalGraph) Sets an external graph.voidsetKnowledge(Knowledge knowledge) Sets the knowledge for the search.voidsetOut(PrintStream out) Sets the output stream for printing.voidsetVerbose(boolean verbose) Sets the verbosity of the program.
-
Constructor Details
-
SvarFas
Constructs a new FastAdjacencySearch.- Parameters:
test- The independence test.
-
-
Method Details
-
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:
searchin interfaceIGraphSearch- 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.
-
setKnowledge
Sets the knowledge for the search.Sets the knowledge used in the search.
- Specified by:
setKnowledgein interfaceIFas- Parameters:
knowledge- This knowledge.
-
getNumIndependenceTests
public int getNumIndependenceTests()Returns the number of independence tests.- Returns:
- This number.
-
getSepsets
Returns a map for x _||_ y | Z from {x, y} to Z.- Specified by:
getSepsetsin interfaceIFas- Returns:
- This map.
-
setExternalGraph
Sets an external graph.- Parameters:
externalGraph- This graph.
-
setVerbose
public void setVerbose(boolean verbose) Sets the verbosity of the program.- Specified by:
setVerbosein interfaceIFas- Parameters:
verbose- True if verbosity is enabled, False otherwise.
-
getElapsedTime
public long getElapsedTime()Description copied from interface:IFasReturns the elapsed time of the search.- Specified by:
getElapsedTimein interfaceIFas- Returns:
- This time.
- Throws:
UnsupportedOperationException- since not implementedd.
-
getNodes
-
getAmbiguousTriples
Retrieves the list of ambiguous triples involving the given node.- Specified by:
getAmbiguousTriplesin interfaceIFas- Parameters:
node- The node.- Returns:
- The list of ambiguous triples involving the given node.
- See Also:
-
setOut
Sets the output stream for printing.
-