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 | zboolean
determines
(List<Node> z, Node y) Returns true if y is determined the variable in z.double
getAlpha()
Returns the significance level of the independence test.getCov()
Returns the covariance matrix.getData()
Returns the datasets for this testint
Returns 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.boolean
Returns true if verbose ouput should be printed.void
setAlpha
(double alpha) Sets the significance level.void
setVerbose
(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, wait
Methods inherited from interface edu.cmu.tetrad.search.IndependenceTest
checkIndependence, determines, getVariableNames
-
Constructor Details
-
ScoreIndTest
-
ScoreIndTest
-
-
Method Details
-
indTestSubset
Description copied from interface:IndependenceTest
Returns an Independence test for a sublist of the variables.- Specified by:
indTestSubset
in 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:
checkIndependence
in 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:
getVariables
in interfaceIndependenceTest
- Returns:
- This list.
-
getVariable
Returns the variable by the given name.- Specified by:
getVariable
in 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:
getAlpha
in interfaceIndependenceTest
- Returns:
- This level.
- Throws:
UnsupportedOperationException
- if there is no significance level.
-
setAlpha
public void setAlpha(double alpha) Sets the significance level.- Specified by:
setAlpha
in interfaceIndependenceTest
- Parameters:
alpha
- This level.
-
getData
- Specified by:
getData
in interfaceIndependenceTest
- Returns:
- The data model for the independence test.
- See Also:
-
getCov
Returns the covariance matrix.- Specified by:
getCov
in interfaceIndependenceTest
- Returns:
- This matrix.
-
getDataSets
Description copied from interface:IndependenceTest
Returns the datasets for this test- Specified by:
getDataSets
in interfaceIndependenceTest
- Returns:
- these datasets.
- Throws:
UnsupportedOperationException
- Not implemented.
-
getSampleSize
public int getSampleSize()Returns the sample size.- Specified by:
getSampleSize
in 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:
isVerbose
in interfaceIndependenceTest
- Returns:
- True, if so.
-
setVerbose
public void setVerbose(boolean verbose) Sets whether verbose output should be printed.- Specified by:
setVerbose
in interfaceIndependenceTest
- Parameters:
verbose
- True, if so.
-
toString
Returns a String representation of this test.- Specified by:
toString
in interfaceIndependenceTest
- Overrides:
toString
in classObject
- Returns:
- This string.
-