Package edu.cmu.tetrad.search
Class IndTestHsic
java.lang.Object
edu.cmu.tetrad.search.IndTestHsic
- All Implemented Interfaces:
IndependenceTest
Checks the conditional independence X _||_ Y | S, where S is a set of continuous variable, and X and Y are discrete
variable not in S, using the Hilbert-Schmidth Independence Criterion (HSIC), a kernel based nonparametric test for
conditional independence.
- Author:
- Robert Tillman
-
Constructor Summary
ConstructorsConstructorDescriptionIndTestHsic
(DataSet dataSet, double alpha) Constructs a new HSIC Independence test.IndTestHsic
(Matrix data, List<Node> variables, double alpha) -
Method Summary
Modifier and TypeMethodDescriptioncheckIndependence
(Node y, Node x, List<Node> z) Determines whether variable x is independent of variable y given a list of conditioning variables z.boolean
determines
(List<Node> z, Node x) double
empiricalHSIC
(Matrix Ky, Matrix Kx, int m) Empirical unconditional Hilbert-Schmidt Dependence Measure for X and Ydouble
empiricalHSICincompleteCholesky
(Matrix Gy, Matrix Gx, int m) Empirical unconditional Hilbert-Schmidt Dependence Measure for X and Y using incomplete Cholesky decomposition to approximate Gram matricesdouble
empiricalHSICincompleteCholesky
(Matrix Gy, Matrix Gx, Matrix Gz, int m) Empirical unconditional Hilbert-Schmidt Dependence Measure for X and Y given Z using incomplete Cholesky decomposition to approximate Gram matricesdouble
getAlpha()
Gets the getModel significance level.getData()
int
getPerms()
Gets the getModel number of bootstrap samples useddouble
Gets the getModel precision for the Incomplete Choleskydouble
double
getScore()
A score that is higher with more likely models.double
getVariable
(String name) indTestSubset
(List<Node> vars) Creates a new IndTestHsic instance for a subset of the variables.boolean
void
setAlpha
(double alpha) Sets the significance level at which independence judgments should be made.void
setIncompleteCholesky
(double precision) Sets the precision for the Incomplete Choleksy factorization method for approximating Gram matrices.void
setPerms
(int perms) Set the number of bootstrap samples to usevoid
setRegularizer
(double regularizer) Sets the regularizervoid
setVerbose
(boolean verbose) toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface edu.cmu.tetrad.search.IndependenceTest
checkIndependence, getCov, getDataSets, getSampleSize, getVariableNames
-
Constructor Details
-
IndTestHsic
Constructs a new HSIC Independence test. The given significance level is used.- Parameters:
dataSet
- A data set containing only continuous columns.alpha
- The alpha level of the test.
-
IndTestHsic
-
-
Method Details
-
indTestSubset
Creates a new IndTestHsic instance for a subset of the variables.- Specified by:
indTestSubset
in interfaceIndependenceTest
- Returns:
- an Independence test for a subset of the variables.
-
checkIndependence
Determines whether variable x is independent of variable y given a list of conditioning variables z.- Specified by:
checkIndependence
in interfaceIndependenceTest
- Parameters:
y
- the second variable being compared.x
- the one variable being compared.z
- the list of conditioning variables.- Returns:
- true iff x _||_ y | z.
- See Also:
-
empiricalHSIC
Empirical unconditional Hilbert-Schmidt Dependence Measure for X and Y- Parameters:
Ky
- centralized Gram matrix for YKx
- centralized Gram matrix for Xm
- sample size
-
empiricalHSICincompleteCholesky
Empirical unconditional Hilbert-Schmidt Dependence Measure for X and Y using incomplete Cholesky decomposition to approximate Gram matrices- Parameters:
Gy
- Choleksy approximate Gram matrix for YGx
- Choleksy approximate Gram matrix for Xm
- sample size
-
empiricalHSICincompleteCholesky
Empirical unconditional Hilbert-Schmidt Dependence Measure for X and Y given Z using incomplete Cholesky decomposition to approximate Gram matrices- Parameters:
Gy
- Choleksy approximate Gram matrix for YGx
- Choleksy approximate Gram matrix for XGz
- Choleksy approximate Gram matrix for Zm
- sample size
-
getThreshold
public double getThreshold() -
getPValue
public double getPValue()- Returns:
- the probability associated with the most recently computed independence test.
-
setAlpha
public void setAlpha(double alpha) Sets the significance level at which independence judgments should be made.- Specified by:
setAlpha
in interfaceIndependenceTest
-
setIncompleteCholesky
public void setIncompleteCholesky(double precision) Sets the precision for the Incomplete Choleksy factorization method for approximating Gram matrices. A value <= 0 indicates that the Incomplete Cholesky method should not be used and instead use the exact matrices. -
setPerms
public void setPerms(int perms) Set the number of bootstrap samples to use -
setRegularizer
public void setRegularizer(double regularizer) Sets the regularizer -
getAlpha
public double getAlpha()Gets the getModel significance level.- Specified by:
getAlpha
in interfaceIndependenceTest
- Returns:
- the significance level of the independence test.
-
getPrecision
public double getPrecision()Gets the getModel precision for the Incomplete Cholesky -
getPerms
public int getPerms()Gets the getModel number of bootstrap samples used -
getVariables
- Specified by:
getVariables
in interfaceIndependenceTest
- Returns:
- the list of variables over which this independence checker is capable of determinine independence relations-- that is, all the variables in the given graph or the given data set.
-
getVariable
- Specified by:
getVariable
in interfaceIndependenceTest
- Returns:
- the variable with the given name.
-
getData
- Specified by:
getData
in interfaceIndependenceTest
- Returns:
- the data set being analyzed.
-
getScore
public double getScore()Description copied from interface:IndependenceTest
A score that is higher with more likely models.- Specified by:
getScore
in interfaceIndependenceTest
-
toString
- Specified by:
toString
in interfaceIndependenceTest
- Overrides:
toString
in classObject
- Returns:
- a string representation of this test.
-
determines
- Specified by:
determines
in interfaceIndependenceTest
- Returns:
- true if y is determined the variable in z.
- Throws:
UnsupportedOperationException
-
isVerbose
public boolean isVerbose()- Specified by:
isVerbose
in interfaceIndependenceTest
-
setVerbose
public void setVerbose(boolean verbose) - Specified by:
setVerbose
in interfaceIndependenceTest
-