Class IndTestPositiveCorr
java.lang.Object
edu.cmu.tetrad.search.work_in_progress.IndTestPositiveCorr
- All Implemented Interfaces:
IndependenceTest
Checks conditional independence of variable in a continuous data set using Fisher's Z test. See Spirtes, Glymour, and
Scheines, "Causation, Prediction and Search," 2nd edition, page 94.
- Version:
- $Id: $Id
- Author:
- josephramsey, Frank Wimberly adapted IndTestCramerT for Fisher's Z
-
Constructor Summary
ConstructorsConstructorDescriptionIndTestPositiveCorr
(DataSet dataSet, double alpha) Constructs a new Independence test which checks independence facts based on the correlation matrix implied by the given data set (must be continuous). -
Method Summary
Modifier and TypeMethodDescriptioncheckIndependence
(Node x0, Node y0, Set<Node> _z0) Checks the independence between two nodes, given a set of conditioning nodes.boolean
determines
(List<Node> z, Node x) Determines if there exists a causal relationship between the nodes in z and node x.double
getAlpha()
Retrieves the alpha level of the Independence Test.getCov()
getCov.getData()
Retrieve the data set used in the independence test.Retrieves the data sets used in the independence test.double
Calculates the p-value for the independence test.int
Retrieves the sample size of the covariance matrix.getVariable
(String name) Retrieves the node associated with the given variable name.Retrieves the list of variables used in the independence test.indTestSubset
(List<Node> vars) Performs an independence test on a subset of variables.boolean
Returns whether the verbose mode is enabled.void
setAlpha
(double alpha) Set the alpha level for the significance of the test.void
setVariables
(List<Node> variables) Sets the variables used in the independence test.void
setVerbose
(boolean verbose) Sets the verbose mode to either enabled or disabled.toString()
Returns a string representation of the Fisher Z 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
-
IndTestPositiveCorr
Constructs a new Independence test which checks independence facts based on the correlation matrix implied by the given data set (must be continuous). The given significance level is used.- Parameters:
dataSet
- A data set containing only continuous columns.alpha
- The alpha level of the test.
-
-
Method Details
-
indTestSubset
Performs an independence test on a subset of variables.- Specified by:
indTestSubset
in interfaceIndependenceTest
- Parameters:
vars
- The sublist of variables.- Returns:
- An IndependenceTest object representing the result of the test.
- Throws:
UnsupportedOperationException
- This method is not implemented and will always throw an UnsupportedOperationException.
-
checkIndependence
Checks the independence between two nodes, given a set of conditioning nodes.- Specified by:
checkIndependence
in interfaceIndependenceTest
- Parameters:
x0
- First node to check independence for.y0
- Second node to check independence for._z0
- Set of conditioning nodes.- Returns:
- An IndependenceResult object representing the result of the independence test.
- See Also:
-
getPValue
public double getPValue()Calculates the p-value for the independence test.- Returns:
- The p-value of the independence test.
-
getAlpha
public double getAlpha()Retrieves the alpha level of the Independence Test.- Specified by:
getAlpha
in interfaceIndependenceTest
- Returns:
- The alpha level.
-
setAlpha
public void setAlpha(double alpha) Set the alpha level for the significance of the test.- Specified by:
setAlpha
in interfaceIndependenceTest
- Parameters:
alpha
- The alpha level for the significance of the test. Must be a value between 0.0 and 1.0, inclusive.- Throws:
IllegalArgumentException
- if the alpha value is out of range.
-
getVariables
Retrieves the list of variables used in the independence test.- Specified by:
getVariables
in interfaceIndependenceTest
- Returns:
- The list of variables used in the independence test.
-
setVariables
Sets the variables used in the independence test.- Parameters:
variables
- A list of Nodes representing the variables to be used in the test.- Throws:
IllegalArgumentException
- if the number of variables is different from the current number of variables in the test.
-
getVariable
Retrieves the node associated with the given variable name.- Specified by:
getVariable
in interfaceIndependenceTest
- Parameters:
name
- aString
object representing the variable name.- Returns:
- the node associated with the variable name.
-
determines
Determines if there exists a causal relationship between the nodes in z and node x.- Parameters:
z
- The list of nodes representing the potential causes.x
- The node representing the potential effect.- Returns:
- true if there exists a causal relationship between the nodes in z and node x, false otherwise.
- Throws:
UnsupportedOperationException
- if the method is not implemented.
-
getData
Retrieve the data set used in the independence test.- Specified by:
getData
in interfaceIndependenceTest
- Returns:
- The data set.
- See Also:
-
toString
Returns a string representation of the Fisher Z object.- Specified by:
toString
in interfaceIndependenceTest
- Overrides:
toString
in classObject
- Returns:
- A string representation of the Fisher Z object.
-
getCov
getCov.
- Specified by:
getCov
in interfaceIndependenceTest
- Returns:
- a
ICovarianceMatrix
object
-
getDataSets
Retrieves the data sets used in the independence test.- Specified by:
getDataSets
in interfaceIndependenceTest
- Returns:
- A list of data sets.
-
getSampleSize
public int getSampleSize()Retrieves the sample size of the covariance matrix.- Specified by:
getSampleSize
in interfaceIndependenceTest
- Returns:
- The sample size.
-
isVerbose
public boolean isVerbose()Returns whether the verbose mode is enabled.- Specified by:
isVerbose
in interfaceIndependenceTest
- Returns:
- true if verbose mode is enabled, false otherwise.
-
setVerbose
public void setVerbose(boolean verbose) Sets the verbose mode to either enabled or disabled.- Specified by:
setVerbose
in interfaceIndependenceTest
- Parameters:
verbose
- True if verbose mode is enabled, false otherwise.
-