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.boolean
determines
(Set<Node> z, Node y) Returns true if y is determined the variable in z.double
getAlpha()
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.double
Returns 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.boolean
Returns true if verbose output should be printed.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.void
setAlpha
(double alpha) Sets the significance level.void
setCutoff
(double cutoff) Sets the cutoff for the independence test.void
setPriorEquivalentSampleSize
(double priorEquivalentSampleSize) void
setThreshold
(boolean threshold) Sets whether the independence test should be thresholded (true) or randomized (false).void
setVerbose
(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, wait
Methods 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:IndependenceTest
Returns an Independence test for a sublist of the variables.- Specified by:
indTestSubset
in 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:
checkIndependence
in 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:
checkIndependence
in 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:
getVariables
in interfaceIndependenceTest
- Returns:
- The variables.
-
getVariable
Returns the variable with the given name.- Specified by:
getVariable
in interfaceIndependenceTest
- Returns:
- This variable.
-
determines
Description copied from interface:IndependenceTest
Returns true if y is determined the variable in z.- Specified by:
determines
in interfaceIndependenceTest
- Returns:
- True, if so.
- Throws:
UnsupportedOperationException
- Method not implemented.
-
getAlpha
public double getAlpha()Description copied from interface:IndependenceTest
Returns the significance level of the independence test.- Specified by:
getAlpha
in interfaceIndependenceTest
- Returns:
- This level.
- Throws:
UnsupportedOperationException
- Method not implemented.
-
setAlpha
public void setAlpha(double alpha) Description copied from interface:IndependenceTest
Sets the significance level.- Specified by:
setAlpha
in interfaceIndependenceTest
- Parameters:
alpha
- This level.- Throws:
UnsupportedOperationException
- Method not implemented.
-
getData
Returns the data set for which conditional independence judgments are requested.- Specified by:
getData
in 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:
isVerbose
in interfaceIndependenceTest
- Returns:
- True, if so.
-
setVerbose
public void setVerbose(boolean verbose) Sets whether verbose output should be printed.- Specified by:
setVerbose
in 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)
-