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.booleandetermines(List<Node> z, Node y) Determines the result of an independence test between a set of variables and a target variable.doublegetAlpha()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 testintReturns 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.booleanReturns a boolean indicating whether verbose output is enabled.voidsetAlpha(double alpha) Sets the significance level for the independence test.voidsetVerbose(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, waitMethods inherited from interface edu.cmu.tetrad.search.test.IndependenceTest
checkIndependence, determines, getVariableNames
-
Constructor Details
-
Method Details
-
indTestSubset
Tests the independence between variables in a given sublist.- Specified by:
indTestSubsetin 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:
checkIndependencein interfaceIndependenceTest- Parameters:
x- The first nodey- The second nodez- The set of additional nodes- Returns:
- The result of the independence test
- Throws:
InterruptedException- If the process is interrupted during the execution.
-
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
Retrieves the Node object with the specified name.- Specified by:
getVariablein 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
Determines the result of an independence test between a set of variables and a target variable.- Parameters:
z- The set of variables to test for independence.y- The target variable to test against.- Returns:
- The result of the independence test.
-
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 for the independence test.- Specified by:
setAlphain interfaceIndependenceTest- Parameters:
alpha- The level of significance to be set.
-
getData
Retrieves the data model associated with this object.- Specified by:
getDatain interfaceIndependenceTest- Returns:
- The data model object.
-
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- since 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 a boolean indicating whether verbose output is enabled.- Specified by:
isVerbosein 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:
setVerbosein interfaceIndependenceTest- Parameters:
verbose- true if verbose output is enabled, false otherwise
-
toString
Returns a string representation of the object.- Specified by:
toStringin interfaceIndependenceTest- Overrides:
toStringin classObject- Returns:
- A string representing the object.
-