Package edu.cmu.tetrad.search.test
Class ScoreIndTest
java.lang.Object
edu.cmu.tetrad.search.test.ScoreIndTest
- All Implemented Interfaces:
IndependenceTest
Gives a way of interpreting a score as an independence test. The contract is that the score returned will be negative
for independence and positive for dependence; this simply reports these differences.
- Author:
- josephramsey
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckIndependence(Node x, Node y, Set<Node> z) Determines whether x _||_ y | zbooleandetermines(List<Node> z, Node y) Returns true if y is determined the variable in z.doublegetAlpha()Returns the significance level of the independence test.getCov()Returns the covariance matrix.getData()Returns the datasets for this testintReturns the sample size.getVariable(String name) Returns the variable by the given name.Returns the list of variables over which this independence checker is capable of determinining independence relations.Returns the score object that this test wraps.indTestSubset(List<Node> vars) Returns an Independence test for a sublist of the variables.booleanReturns true if verbose ouput should be printed.voidsetAlpha(double alpha) Sets the significance level.voidsetVerbose(boolean verbose) Sets whether verbose output should be printed.toString()Returns a String representation of this test.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface edu.cmu.tetrad.search.IndependenceTest
checkIndependence, determines, getVariableNames
-
Constructor Details
-
ScoreIndTest
-
ScoreIndTest
-
-
Method Details
-
indTestSubset
Description copied from interface:IndependenceTestReturns an Independence test for a sublist of the variables.- Specified by:
indTestSubsetin interfaceIndependenceTest- Parameters:
vars- The sublist of variables.- Returns:
- an Independence test for a subset of the variables.
-
checkIndependence
Determines whether x _||_ y | z- Specified by:
checkIndependencein interfaceIndependenceTest- Returns:
- The independence result.
- Throws:
RuntimeException- if a matrix singularity is encountered.- See Also:
-
getVariables
Returns the list of variables over which this independence checker is capable of determinining independence relations.- Specified by:
getVariablesin interfaceIndependenceTest- Returns:
- This list.
-
getVariable
Returns the variable by the given name.- Specified by:
getVariablein interfaceIndependenceTest- Returns:
- This variable.
-
determines
Returns true if y is determined the variable in z.- Returns:
- True is so.
-
getAlpha
public double getAlpha()Returns the significance level of the independence test.- Specified by:
getAlphain interfaceIndependenceTest- Returns:
- This level.
- Throws:
UnsupportedOperationException- if there is no significance level.
-
setAlpha
public void setAlpha(double alpha) Sets the significance level.- Specified by:
setAlphain interfaceIndependenceTest- Parameters:
alpha- This level.
-
getData
- Specified by:
getDatain interfaceIndependenceTest- Returns:
- The data model for the independence test.
- See Also:
-
getCov
Returns the covariance matrix.- Specified by:
getCovin interfaceIndependenceTest- Returns:
- This matrix.
-
getDataSets
Description copied from interface:IndependenceTestReturns the datasets for this test- Specified by:
getDataSetsin interfaceIndependenceTest- Returns:
- these datasets.
- Throws:
UnsupportedOperationException- Not implemented.
-
getSampleSize
public int getSampleSize()Returns the sample size.- Specified by:
getSampleSizein interfaceIndependenceTest- Returns:
- This size.
-
getWrappedScore
Returns the score object that this test wraps.- Returns:
- This score object.
- See Also:
-
isVerbose
public boolean isVerbose()Returns true if verbose ouput should be printed.- Specified by:
isVerbosein interfaceIndependenceTest- Returns:
- True, if so.
-
setVerbose
public void setVerbose(boolean verbose) Sets whether verbose output should be printed.- Specified by:
setVerbosein interfaceIndependenceTest- Parameters:
verbose- True, if so.
-
toString
Returns a String representation of this test.- Specified by:
toStringin interfaceIndependenceTest- Overrides:
toStringin classObject- Returns:
- This string.
-