Package edu.cmu.tetrad.search.test
Class MsepTest
java.lang.Object
edu.cmu.tetrad.search.test.MsepTest
- All Implemented Interfaces:
- IndependenceTest
Checks independence facts for variables associated with the nodes in a given graph by checking m-separation facts on
 the underlying nodes. We use the IndependenceTest interface here so that this m-separation test can be used in place
 of a statistical conditional independence test in algorithms to provide oracle information.
- Version:
- $Id: $Id
- Author:
- josephramsey
- 
Constructor SummaryConstructorsConstructorDescriptionMsepTest(IndependenceFacts facts) Constructor.MsepTest(IndependenceFacts facts, boolean keepLatents) Constructor.MsepTest(IndependenceFacts facts, List<Node> variables) Constructor.Constructor.Constructor.
- 
Method SummaryModifier and TypeMethodDescriptioncheckIndependence(Node x, Node y, Set<Node> z) Checks the independence between two nodes with respect to a set of conditioning nodes.booleandetermines(List<Node> z, Node x1) Determines if a node is m-separated from a set of conditioning nodes.doublegetAlpha()Returns an alpha level, 0.5.getData()Returns the data set used for the test.getGraph()Returns the underlying graph that is being used to calculate d-separation relationships.getVariable(String name) Returns theNodeobject with the given name.Return the list of TetradNodes over which this independence checker is capable of determinine independence relations-- that is, all the variables in the given graph or the given data set.indTestSubset(List<Node> vars) Conducts an independence test on a subset of variables.booleanisMSeparated(Node x, Node y, Set<Node> z) Auxiliary method to calculate msep(x, y | z) directly from nodes instead of from variables.booleanReturns True just in case verbose output should be printed.voidsetAlpha(double alpha) Sets the alpha level for the independence test.voidsetPag(boolean pag) True iff the graph is a PAGvoidsetVerbose(boolean verbose) Sets the verbosity level for the program.toString()Returns a string representation of this test.Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface edu.cmu.tetrad.search.IndependenceTestcheckIndependence, determines, getCov, getDataSets, getSampleSize, getVariableNames
- 
Constructor Details- 
MsepTestConstructor.- Parameters:
- graph- The graph for which m-separation facts should be checked. This may be a DAG, CPDAG, or PAG. In the latter case, m-separation results will be returned (same algorithm).
 
- 
MsepTestConstructor.- Parameters:
- facts- Independence facts to be used for direct calculations of m-separation.
- variables- The variables for the facts, if different from those that independence facts would return.
- See Also:
 
- 
MsepTestConstructor.- Parameters:
- facts- Independence facts to be used for direct calculations of m-separation.
- See Also:
 
- 
MsepTestConstructor.- Parameters:
- graph- The graph for which m-separation facts should be checked. This may be a DAG, CPDAG, or PAG. In the latter case, m-separation results will be returned (same algorithm).
- keepLatents- Whether latent in the graph should be used in conditional independence facts. If the graph is being marginalized, this should be false.
 
- 
MsepTestConstructor.- Parameters:
- facts- Independence facts to be used for direct calculations of m-separation.
- keepLatents- Whether latent in the graph should be used in conditional independence facts. If the graph is being marginalized, this should be false.
- See Also:
 
 
- 
- 
Method Details- 
indTestSubsetConducts an independence test on a subset of variables.- Specified by:
- indTestSubsetin interface- IndependenceTest
- Parameters:
- vars- The sublist of variables to test independence on.
- Returns:
- This IndependenceTest object.
- Throws:
- IllegalArgumentException- If the subset is empty or contains variables that are not original variables.
 
- 
checkIndependenceChecks the independence between two nodes with respect to a set of conditioning nodes.- Specified by:
- checkIndependencein interface- IndependenceTest
- Parameters:
- x- The first node to check independence for.
- y- The second node to check independence for.
- z- The set of conditioning nodes.
- Returns:
- The result of the independence test.
- Throws:
- NullPointerException- if the set of conditioning nodes is null or contains null elements.
- IllegalArgumentException- if x or y is not an observed variable.
- RuntimeException- if an undefined p-value is encountered during the test.
 
- 
isMSeparatedAuxiliary method to calculate msep(x, y | z) directly from nodes instead of from variables.
- 
getVariablesReturn the list of TetradNodes over which this independence checker is capable of determinine independence relations-- that is, all the variables in the given graph or the given data set.- Specified by:
- getVariablesin interface- IndependenceTest
- Returns:
- This list.
 
- 
determinesDetermines if a node is m-separated from a set of conditioning nodes.- Parameters:
- z- The set of conditioning nodes.
- x1- The node to check independence for.
- Returns:
- True if the node is m-separated from the conditioning nodes, false otherwise.
- Throws:
- UnsupportedOperationException- if not implemented.
 
- 
getAlphapublic double getAlpha()Returns an alpha level, 0.5. This is an arbitrary number that will help decide whether a pseudo p-value returned by the test represents a dependence or an independence.- Specified by:
- getAlphain interface- IndependenceTest
- Returns:
- 0.5.
 
- 
setAlphapublic void setAlpha(double alpha) Sets the alpha level for the independence test.- Specified by:
- setAlphain interface- IndependenceTest
- Parameters:
- alpha- The level of significance for the test.
 
- 
getVariableReturns theNodeobject with the given name.- Specified by:
- getVariablein interface- IndependenceTest
- Parameters:
- name- the name of the variable to retrieve
- Returns:
- the Node object with the given name if found, null otherwise
 
- 
getGraphReturns the underlying graph that is being used to calculate d-separation relationships.- Returns:
- This graph.
 
- 
toStringReturns a string representation of this test.- Specified by:
- toStringin interface- IndependenceTest
- Overrides:
- toStringin class- Object
- Returns:
- "M-separation".
 
- 
getDataReturns the data set used for the test.- Specified by:
- getDatain interface- IndependenceTest
- Returns:
- The data set used for the test.
 
- 
isVerbosepublic boolean isVerbose()Returns True just in case verbose output should be printed.- Specified by:
- isVerbosein interface- IndependenceTest
- Returns:
- True, if so.
 
- 
setVerbosepublic void setVerbose(boolean verbose) Sets the verbosity level for the program.- Specified by:
- setVerbosein interface- IndependenceTest
- Parameters:
- verbose- True if verbose output should be printed, false otherwise.
 
- 
setPagpublic void setPag(boolean pag) True iff the graph is a PAG- Parameters:
- pag- True if the graph is a PAG, false if a DAG, MPDAG, or CPDAG.
 
 
-