Class IndTestCramerT
java.lang.Object
edu.cmu.tetrad.search.work_in_progress.IndTestCramerT
- All Implemented Interfaces:
IndependenceTest
@Deprecated(since="7.9",
forRemoval=false)
public final class IndTestCramerT
extends Object
implements IndependenceTest
Deprecated.
Checks conditional independence for continuous variables using Cramer's T-test formula (Cramer, Mathematical Methods
of Statistics (1951), page 413).
- Version:
- $Id: $Id
- Author:
- josephramsey
-
Constructor Summary
ConstructorsConstructorDescriptionIndTestCramerT(CorrelationMatrix covMatrix, double alpha) Deprecated.Constructs a new independence test that will determine conditional independence facts using the given correlation matrix and the given significance level.IndTestCramerT(DataSet dataSet, double alpha) Deprecated.Constructs a new Independence test which checks independence facts based on the correlation matrix implied by the given data set (must be continuous).IndTestCramerT(ICovarianceMatrix covMatrix, double alpha) Deprecated.Constructs a new independence test that will determine conditional independence facts using the given correlation matrix and the given significance level. -
Method Summary
Modifier and TypeMethodDescriptioncheckIndependence(Node x, Node y, Set<Node> _z) Deprecated.Checks the independence between two nodes given a set of conditioning nodes.booleandetermines(List<Node> z, Node x) Deprecated.Determines whether the given variables are conditionally independent.doublegetAlpha()Deprecated.Getter for the fieldalpha.getData()Deprecated.Retrieves the dataset used in the independence test.doubleDeprecated.Calculates the p-value for the independence test.Deprecated.Retrieves the list of variables used in the independence test.indTestSubset(List<Node> vars) Deprecated.This method performs an independence test based on a given sublist of variables.booleanDeprecated.Determines if verbose output is enabled or disabled.voidsetAlpha(double alpha) Deprecated.Sets the significance level for the independence test.voidsetVerbose(boolean verbose) Deprecated.Sets the verbose flag to determine if verbose output should be enabled or disabled.toString()Deprecated.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, getCov, getDataSets, getSampleSize, getVariable, getVariableNames
-
Constructor Details
-
IndTestCramerT
Deprecated.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 with all continuous columns.alpha- the alpha level of the test.
-
IndTestCramerT
Deprecated.Constructs a new independence test that will determine conditional independence facts using the given correlation matrix and the given significance level.- Parameters:
covMatrix- aCorrelationMatrixobjectalpha- a double
-
IndTestCramerT
Deprecated.Constructs a new independence test that will determine conditional independence facts using the given correlation matrix and the given significance level.- Parameters:
covMatrix- aICovarianceMatrixobjectalpha- a double
-
-
Method Details
-
indTestSubset
Deprecated.This method performs an independence test based on a given sublist of variables.- Specified by:
indTestSubsetin interfaceIndependenceTest- Parameters:
vars- The sublist of variables to perform the independence test on.- Returns:
- An IndependenceTest object representing the results of the test.
- Throws:
IllegalArgumentException- If the sublist of variables is empty or contains variables that are not original variables.
-
checkIndependence
Deprecated.Checks the independence between two nodes given a set of conditioning nodes.- Specified by:
checkIndependencein interfaceIndependenceTest- Parameters:
x- The first node.y- The second node._z- The set of conditioning nodes.- Returns:
- The result of the independence check.
- Throws:
NullPointerException- If _z is null or contains null elements.IllegalArgumentException- If the submatrix contains missing values.RuntimeException- If the submatrix is singular or the p-value is undefined.
-
getPValue
public double getPValue()Deprecated.Calculates the p-value for the independence test. The p-value is calculated by integrating the probability density function (pdf) over the range of storedR (absolute value) to 1.0 with 100 intervals, and then multiplying the result by 2.0.- Returns:
- the p-value for the independence test.
-
getAlpha
public double getAlpha()Deprecated.Getter for the field
alpha.- Specified by:
getAlphain interfaceIndependenceTest- Returns:
- the getModel significance level.
-
setAlpha
public void setAlpha(double alpha) Deprecated.Sets the significance level for the independence test.- Specified by:
setAlphain interfaceIndependenceTest- Parameters:
alpha- The significance level, must be between 0.0 and 1.0 (inclusive).- Throws:
IllegalArgumentException- If the significance level is out of range.
-
getVariables
Deprecated.Retrieves the list of variables used in the independence test.- Specified by:
getVariablesin interfaceIndependenceTest- Returns:
- A list of Node objects representing the variables used in the test.
-
determines
Deprecated.Determines whether the given variables are conditionally independent.- Parameters:
z- The set of conditioning nodes.x- The target node.- Returns:
- true if the variables are conditionally independent, false otherwise.
- Throws:
UnsupportedOperationException- If a matrix operation fails.
-
getData
Deprecated.Retrieves the dataset used in the independence test.- Specified by:
getDatain interfaceIndependenceTest- Returns:
- The dataset used in the independence test.
-
toString
Deprecated.Returns a string representation of the object.- Specified by:
toStringin interfaceIndependenceTest- Overrides:
toStringin classObject- Returns:
- A string representation of the object.
-
isVerbose
public boolean isVerbose()Deprecated.Determines if verbose output is enabled or disabled.- Specified by:
isVerbosein interfaceIndependenceTest- Returns:
- true if verbose output is enabled, false otherwise.
-
setVerbose
public void setVerbose(boolean verbose) Deprecated.Sets the verbose flag to determine if verbose output should be enabled or disabled.- Specified by:
setVerbosein interfaceIndependenceTest- Parameters:
verbose- True if the verbose output should be enabled, false otherwise.
-