Package edu.cmu.tetrad.search.test
Class IndTestConditionalGaussianLrt
java.lang.Object
edu.cmu.tetrad.search.test.IndTestConditionalGaussianLrt
- All Implemented Interfaces:
IndependenceTest
Performs a test of conditional independence X _||_ Y | Z1...Zn where all searchVariables
are either continuous or discrete. This test is valid for both ordinal and non-ordinal
discrete searchVariables.
Assumes a conditional Gaussain model and uses a likelihood ratio test.
- Author:
- josephramsey
-
Constructor Summary
ConstructorsConstructorDescriptionIndTestConditionalGaussianLrt(DataSet data, double alpha, boolean discretize) Consstructor. -
Method Summary
Modifier and TypeMethodDescriptioncheckIndependence(Node x, Node y, List<Node> z) Returns and independence result that states whetehr x _||_y | z and what the p-value of the test is.booleandetermines(List<Node> z, Node y) Returns true if y is determined the variable in z.doublegetAlpha()Returns the significance level of the independence test.getData()Returns the data.doubleReturns the probability associated with the most recently executed independence test, or Double.NaN if p value is not meaningful for this test.doublegetScore()Returns a number that is higher for stronger judgments of dependence and negative for judgments of independence.Returns the list of variables over which this independence checker is capable of determining independence relations.indTestSubset(List<Node> vars) Returns an Independence test for a sublist of the variables.booleanReturns true iff verbose output should be printed.voidsetAlpha(double alpha) Sets the significance level.voidsetNumCategoriesToDiscretize(int numCategoriesToDiscretize) Sets the nubmer of categories used to discretize variables.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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface edu.cmu.tetrad.search.test.IndependenceTest
checkIndependence, getCov, getDataSets, getSampleSize, getVariable, getVariableNames
-
Constructor Details
-
IndTestConditionalGaussianLrt
Consstructor.- Parameters:
data- The data to analyze.alpha- The signifcance level.discretize- Whether discrete children of continuous parents should be discretized.
-
-
Method Details
-
indTestSubset
Description copied from interface:IndependenceTestReturns an Independence test for a sublist of the variables.- Specified by:
indTestSubsetin interfaceIndependenceTest- Parameters:
vars- The sublist of variables.- Throws:
javax.help.UnsupportedOperationException- Method not implemented
-
checkIndependence
Returns and independence result that states whetehr x _||_y | z and what the p-value of the test is.- Specified by:
checkIndependencein interfaceIndependenceTest- Returns:
- an independence result (see)
- See Also:
-
getPValue
public double getPValue()Returns the probability associated with the most recently executed independence test, or Double.NaN if p value is not meaningful for this test. -
getVariables
Returns the list of variables over which this independence checker is capable of determining independence relations.- Specified by:
getVariablesin interfaceIndependenceTest- Returns:
- This list.
-
determines
Returns true if y is determined the variable in z.- Specified by:
determinesin interfaceIndependenceTest- Returns:
- True if so.
-
getAlpha
public double getAlpha()Returns the significance level of the independence test.- Specified by:
getAlphain interfaceIndependenceTest- Returns:
- This level.
-
setAlpha
public void setAlpha(double alpha) Sets the significance level.- Specified by:
setAlphain interfaceIndependenceTest- Parameters:
alpha- This level.
-
getData
Returns the data.- Specified by:
getDatain interfaceIndependenceTest- Returns:
- This data.
- See Also:
-
getScore
public double getScore()Returns a number that is higher for stronger judgments of dependence and negative for judgments of independence.- Specified by:
getScorein interfaceIndependenceTest- Returns:
- This number.
-
toString
Returns a string representation of this test.- Specified by:
toStringin interfaceIndependenceTest- Overrides:
toStringin classObject- Returns:
- This string.
-
isVerbose
public boolean isVerbose()Returns true iff verbose output should be printed.- Specified by:
isVerbosein interfaceIndependenceTest- Returns:
- This.
-
setVerbose
public void setVerbose(boolean verbose) Sets whether verbose output should be printed.- Specified by:
setVerbosein interfaceIndependenceTest- Parameters:
verbose- True if so.
-
setNumCategoriesToDiscretize
public void setNumCategoriesToDiscretize(int numCategoriesToDiscretize) Sets the nubmer of categories used to discretize variables.- Parameters:
numCategoriesToDiscretize- This number, by default 3.
-