Package edu.cmu.tetrad.search.test
Class IndTestProbabilistic
java.lang.Object
edu.cmu.tetrad.search.test.IndTestProbabilistic
- All Implemented Interfaces:
IndependenceTest
Uses BCInference by Cooper and Bui to calculate probabilistic conditional independence judgments.
- Author:
- josephramsey 3/2014
-
Constructor Summary
ConstructorsConstructorDescriptionIndTestProbabilistic(DataSet dataSet) Initializes the test using a discrete data sets. -
Method Summary
Modifier and TypeMethodDescriptioncheckIndependence(Node x, Node y, Node... z) Returns an independence result that states whether x _||_y | z and what the p-value of the test is.checkIndependence(Node x, Node y, Set<Node> _z) Returns an independence result that states whether x _||_y | z and what the p-value of the test is.booleandetermines(Set<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 set for which conditional independence judgments are requested.getH()Returns a map from independence facts to their probabilities of independence.doubleReturns the posterior probability of the last independence test.getVariable(String name) Returns the variable with the given name.Returns the variables of the data set.indTestSubset(List<Node> vars) Returns an Independence test for a sublist of the variables.booleanReturns true if verbose output should be printed.doubleprobConstraint(BCInference bci, BCInference.OP op, Node x, Node y, Node[] z, Map<Node, Integer> indices) Returns the probability of the constraint x op y | z.voidsetAlpha(double alpha) Sets the significance level.voidsetCutoff(double cutoff) Sets the cutoff for the independence test.voidsetPriorEquivalentSampleSize(double priorEquivalentSampleSize) voidsetThreshold(boolean threshold) Sets whether the independence test should be thresholded (true) or randomized (false).voidsetVerbose(boolean verbose) Sets whether verbose output should be printed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.cmu.tetrad.search.IndependenceTest
getCov, getDataSets, getSampleSize, getVariableNames, toString
-
Constructor Details
-
IndTestProbabilistic
Initializes the test using a discrete data sets.
-
-
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:
UnsupportedOperationException- Method not implemented.
-
checkIndependence
Returns an independence result that states whether x _||_y | z and what the p-value of the test is.- Specified by:
checkIndependencein interfaceIndependenceTest- Parameters:
x- The first variable.y- The second variable._z- The conditioning set.- Returns:
- an independence result (see)
- See Also:
-
checkIndependence
Returns an independence result that states whether x _||_y | z and what the p-value of the test is.- Specified by:
checkIndependencein interfaceIndependenceTest- Parameters:
x- The first variable.y- The second variable.z- The conditioning set.- Returns:
- an independence result (see)
- See Also:
-
probConstraint
public double probConstraint(BCInference bci, BCInference.OP op, Node x, Node y, Node[] z, Map<Node, Integer> indices) Returns the probability of the constraint x op y | z.- Parameters:
bci- The BCInference object.op- The operator.x- The first variable.y- The second variable.z- The conditioning set.indices- A map from nodes to their indices.- Returns:
- The probability.
-
getVariables
Returns the variables of the data set.- Specified by:
getVariablesin interfaceIndependenceTest- Returns:
- The variables.
-
getVariable
Returns the variable with the given name.- Specified by:
getVariablein interfaceIndependenceTest- Returns:
- This variable.
-
determines
Description copied from interface:IndependenceTestReturns true if y is determined the variable in z.- Specified by:
determinesin interfaceIndependenceTest- Returns:
- True, if so.
- Throws:
UnsupportedOperationException- Method not implemented.
-
getAlpha
public double getAlpha()Description copied from interface:IndependenceTestReturns the significance level of the independence test.- Specified by:
getAlphain interfaceIndependenceTest- Returns:
- This level.
- Throws:
UnsupportedOperationException- Method not implemented.
-
setAlpha
public void setAlpha(double alpha) Description copied from interface:IndependenceTestSets the significance level.- Specified by:
setAlphain interfaceIndependenceTest- Parameters:
alpha- This level.- Throws:
UnsupportedOperationException- Method not implemented.
-
getData
Returns the data set for which conditional independence judgments are requested.- Specified by:
getDatain interfaceIndependenceTest- Returns:
- The data set.
- See Also:
-
getH
Returns a map from independence facts to their probabilities of independence.- Returns:
- The map.
-
getPosterior
public double getPosterior()Returns the posterior probability of the last independence test.- Returns:
- The posterior probability.
-
isVerbose
public boolean isVerbose()Returns true if verbose output should be printed.- Specified by:
isVerbosein interfaceIndependenceTest- Returns:
- True, if so.
-
setVerbose
public void setVerbose(boolean verbose) Sets whether verbose output should be printed.- Specified by:
setVerbosein interfaceIndependenceTest- Parameters:
verbose- True, if so.
-
setThreshold
public void setThreshold(boolean threshold) Sets whether the independence test should be thresholded (true) or randomized (false).- Parameters:
threshold- true if the independence test should be thresholded, false if it should be randomized.
-
setCutoff
public void setCutoff(double cutoff) Sets the cutoff for the independence test.- Parameters:
cutoff- the cutoff for the independence test.
-
setPriorEquivalentSampleSize
public void setPriorEquivalentSampleSize(double priorEquivalentSampleSize)
-