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.
- Version:
- $Id: $Id
- Author:
- josephramsey
-
Constructor Summary
ConstructorsConstructorDescriptionScoreIndTest
(Score score) Constructor for ScoreIndTest.ScoreIndTest
(Score score, DataModel data) Constructor for ScoreIndTest. -
Method Summary
Modifier and TypeMethodDescriptioncheckIndependence
(Node x, Node y, Set<Node> z) Checks the independence between two nodes given a set of additional nodes.boolean
determines
(List<Node> z, Node y) Determines the result of an independence test between a set of variables and a target variable.double
getAlpha()
Returns the significance level of the independence test.getCov()
Returns the covariance matrix.getData()
Retrieves the data model associated with this object.Returns the datasets for this testint
Returns the sample size.getVariable
(String name) Retrieves the Node object with the specified 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) Tests the independence between variables in a given sublist.boolean
Returns a boolean indicating whether verbose output is enabled.void
setAlpha
(double alpha) Sets the significance level for the independence test.void
setVerbose
(boolean verbose) Sets whether verbose output is enabled or not.toString()
Returns a string representation of the object.Methods inherited from class java.lang.Object
equals, 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
Tests the independence between variables in a given sublist.- Specified by:
indTestSubset
in interfaceIndependenceTest
- Parameters:
vars
- The sublist of variables to test independence.- Returns:
- The result of the independence test.
-
checkIndependence
public IndependenceResult checkIndependence(Node x, Node y, Set<Node> z) throws InterruptedException Checks the independence between two nodes given a set of additional nodes.- Specified by:
checkIndependence
in interfaceIndependenceTest
- Parameters:
x
- The first nodey
- The second nodez
- The set of additional nodes- Returns:
- The result of the independence test
- Throws:
InterruptedException
- 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
Retrieves the Node object with the specified name.- Specified by:
getVariable
in interfaceIndependenceTest
- Parameters:
name
- The name of the Node object to retrieve.- Returns:
- The Node object with the specified name, or null if not found.
-
determines
-
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 for the independence test.- Specified by:
setAlpha
in interfaceIndependenceTest
- Parameters:
alpha
- The level of significance to be set.
-
getData
Retrieves the data model associated with this object.- Specified by:
getData
in interfaceIndependenceTest
- Returns:
- The data model object.
- 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
- since 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 a boolean indicating whether verbose output is enabled.- Specified by:
isVerbose
in interfaceIndependenceTest
- Returns:
- true if verbose output is enabled, false otherwise
-
setVerbose
public void setVerbose(boolean verbose) Sets whether verbose output is enabled or not.- Specified by:
setVerbose
in interfaceIndependenceTest
- Parameters:
verbose
- true if verbose output is enabled, false otherwise
-
toString
Returns a string representation of the object.- Specified by:
toString
in interfaceIndependenceTest
- Overrides:
toString
in classObject
- Returns:
- A string representing the object.
-