Package edu.cmu.tetrad.search.test
Class IndTestConditionalCorrelation
java.lang.Object
edu.cmu.tetrad.search.test.IndTestConditionalCorrelation
- All Implemented Interfaces:
IndependenceTest,RowsSettable
public final class IndTestConditionalCorrelation
extends Object
implements IndependenceTest, RowsSettable
Checks conditional independence of variable in a continuous data set using a conditional correlation test for the
nonlinear nonGaussian with the additive error case. This is for additive (but otherwise general) models.
- Version:
- $Id: $Id
- Author:
- josephramsey
-
Constructor Summary
ConstructorsConstructorDescriptionIndTestConditionalCorrelation(DataSet dataSet, double alpha, double scalingFactor, int basisType, double basisScale, int numFunctions) Constructs a newIndTestConditionalCorrelationto check independence based on conditional correlations derived from the given continuous data set. -
Method Summary
Modifier and TypeMethodDescriptioncheckIndependence(Node x, Node y, Set<Node> z) Checks the independence of x _||_ y | zdoublegetAlpha()Returns the model significance level.getData()Returns the data set being analyzed.getRows()Returns the number of orthogonal functions used to do the calculations.Returns the list of variables over which this independence checker is capable of determining independence relations-- that is, all the variables in the given graph or the given data set.indTestSubset(List<Node> vars) Constructs a new Independence test which checks independence facts based on the correlation data implied by the given data set (must be continuous).booleanReturns true if verbose output should be printed.voidsetAlpha(double alpha) Sets the significance level for the test.voidSets the rows to use for the test.voidsetVerbose(boolean verbose) Sets whether verbose output should be printed.toString()Returns a string representation of this test.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
-
IndTestConditionalCorrelation
public IndTestConditionalCorrelation(DataSet dataSet, double alpha, double scalingFactor, int basisType, double basisScale, int numFunctions) Constructs a newIndTestConditionalCorrelationto check independence based on conditional correlations derived from the given continuous data set. The test uses the specified significance level and allows customization of basis settings and a scaling factor.- Parameters:
dataSet- The continuous data set for performing independence tests.alpha- The significance level for the test (must be between 0 and 1 inclusive).scalingFactor- The scaling factor applied in the independence test computations.basisType- The type of basis functions used in the computations.basisScale- The scale of the basis functions applied in computations.numFunctions- The number of orthogonal functions used for the calculations.- Throws:
IllegalArgumentException- if the data set is not continuous.IllegalArgumentException- if the significance level (alpha) is not in the range [0, 1].
-
-
Method Details
-
indTestSubset
Constructs a new Independence test which checks independence facts based on the correlation data implied by the given data set (must be continuous). The given significance level is used.- Specified by:
indTestSubsetin interfaceIndependenceTest- Parameters:
vars- The sublist of variables.- Returns:
- a
IndependenceTestobject
-
checkIndependence
Checks the independence of x _||_ y | z- Specified by:
checkIndependencein interfaceIndependenceTest- Parameters:
x- aNodeobjecty- aNodeobjectz- aSetobject- Returns:
- a
IndependenceResultobject - See Also:
-
getAlpha
public double getAlpha()Returns the model significance level.- Specified by:
getAlphain interfaceIndependenceTest- Returns:
- This level.
-
setAlpha
public void setAlpha(double alpha) Sets the significance level for the test. The significance level (alpha) must be a value between 0 and 1, inclusive.- Specified by:
setAlphain interfaceIndependenceTest- Parameters:
alpha- The new significance level to be set for the test. This value determines the threshold for statistical significance in the independence test computations.
-
getVariables
Returns the list of variables over which this independence checker is capable of determining independence relations-- that is, all the variables in the given graph or the given data set.- Specified by:
getVariablesin interfaceIndependenceTest- Returns:
- This list.
-
getData
Returns the data set being analyzed.- Specified by:
getDatain interfaceIndependenceTest- Returns:
- This dataset.
-
toString
Returns a string representation of this test.- Specified by:
toStringin interfaceIndependenceTest- Overrides:
toStringin classObject- Returns:
- This string.
-
isVerbose
public boolean isVerbose()Returns true if verbose output should be printed.- Specified by:
isVerbosein interfaceIndependenceTest- Returns:
- True if the case.
-
setVerbose
public void setVerbose(boolean verbose) Sets whether verbose output should be printed.- Specified by:
setVerbosein interfaceIndependenceTest- Parameters:
verbose- True, if so.
-
getRows
Returns the number of orthogonal functions used to do the calculations. The sets used are the polynomial basis functions, x, x^2, x^3, etc. This choice is made to allow for more flexible domains of the functions after standardization.- Specified by:
getRowsin interfaceRowsSettable- Returns:
- This number.
-
setRows
Sets the rows to use for the test.- Specified by:
setRowsin interfaceRowsSettable- Parameters:
rows- The rows.
-