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.
- Version:
- $Id: $Id
- Author:
- josephramsey 3/2014
- 
Constructor SummaryConstructorsConstructorDescriptionIndTestProbabilistic(DataSet dataSet) Initializes the test using a discrete data sets.
- 
Method SummaryModifier and TypeMethodDescriptioncheckIndependence(Node x, Node y, Node... z) Checks the independence fact in question and returns and independence result.checkIndependence(Node x, Node y, Set<Node> _z) Checks the independence between two variables x and y given a conditioning set z.booleandetermines(Set<Node> z, Node y) Determines whether a given set of nodes, z, determines another node, y.doublegetAlpha()Returns the alpha parameter for the probabilistic test.getData()Returns the data model associated with this instance.getH()Returns a map from independence facts to their probabilities of independence.doubleReturns the posterior probability of the last independence test.getVariable(String name) Retrieves the Node object that matches the given name from the list of nodes.Returns the list of variables used in this object.indTestSubset(List<Node> vars) Returns an Independence test for a sublist of the variables.booleanReturns the verbose flag indicating whether 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 alpha parameter for the probabilistic test.voidsetCutoff(double cutoff) Sets the cutoff for the independence test.voidsetPriorEquivalentSampleSize(double priorEquivalentSampleSize) Sets the prior equivalent sample size for the independence test.voidsetThreshold(boolean threshold) Sets whether the independence test should be thresholded (true) or randomized (false).voidsetVerbose(boolean verbose) Sets the verbose flag indicating whether verbose output should be printed.Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.cmu.tetrad.search.IndependenceTestgetCov, getDataSets, getSampleSize, getVariableNames, toString
- 
Constructor Details- 
IndTestProbabilisticInitializes the test using a discrete data sets.- Parameters:
- dataSet- a- DataSetobject
 
 
- 
- 
Method Details- 
indTestSubsetReturns an Independence test for a sublist of the variables.- Specified by:
- indTestSubsetin interface- IndependenceTest
- Parameters:
- vars- The sublist of variables.
- Returns:
- a IndependenceTestobject
 
- 
checkIndependenceChecks the independence between two variables x and y given a conditioning set z.Returns an independence result that states whether x _||_y | z and what the p-value of the test is. - Specified by:
- checkIndependencein interface- IndependenceTest
- Parameters:
- x- The first variable to test, represented as a Node object.
- y- The second variable to test, represented as a Node object.
- _z- The set of conditioning variables, represented as a Set of Node objects.
- Returns:
- An IndependenceResult object representing the outcome of the independence test.
- See Also:
 
- 
checkIndependenceChecks the independence fact in question and returns and independence result.Returns an independence result that states whether x _||_y | z and what the p-value of the test is. - Specified by:
- checkIndependencein interface- IndependenceTest
- Parameters:
- x- a- Nodeobject
- y- a- Nodeobject
- z- a- Nodeobject
- Returns:
- The independence result.
- See Also:
 
- 
probConstraintpublic 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.
 
- 
getVariablesReturns the list of variables used in this object.- Specified by:
- getVariablesin interface- IndependenceTest
- Returns:
- A List of Node objects representing the variables used.
 
- 
getVariableRetrieves the Node object that matches the given name from the list of nodes.- Specified by:
- getVariablein interface- IndependenceTest
- Parameters:
- name- The name of the variable to retrieve.
- Returns:
- The Node object matching the given name, or null if no match is found.
 
- 
determinesDetermines whether a given set of nodes, z, determines another node, y.- Specified by:
- determinesin interface- IndependenceTest
- Parameters:
- z- A Set of nodes representing the conditioning set.
- y- The node for which determination is checked.
- Returns:
- true if z determines y, false otherwise.
 
- 
getAlphapublic double getAlpha()Returns the alpha parameter for the probabilistic test.- Specified by:
- getAlphain interface- IndependenceTest
- Returns:
- The alpha parameter.
 
- 
setAlphapublic void setAlpha(double alpha) Sets the alpha parameter for the probabilistic test.- Specified by:
- setAlphain interface- IndependenceTest
- Parameters:
- alpha- The alpha parameter to set.
 
- 
getDataReturns the data model associated with this instance.- Specified by:
- getDatain interface- IndependenceTest
- Returns:
- The data model.
 
- 
getHReturns a map from independence facts to their probabilities of independence.- Returns:
- The map.
 
- 
getPosteriorpublic double getPosterior()Returns the posterior probability of the last independence test.- Returns:
- The posterior probability.
 
- 
isVerbosepublic boolean isVerbose()Returns the verbose flag indicating whether verbose output should be printed.- Specified by:
- isVerbosein interface- IndependenceTest
- Returns:
- The verbose flag.
 
- 
setVerbosepublic void setVerbose(boolean verbose) Sets the verbose flag indicating whether verbose output should be printed.- Specified by:
- setVerbosein interface- IndependenceTest
- Parameters:
- verbose- true if verbose output should be printed, false otherwise.
 
- 
setThresholdpublic 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.
 
- 
setCutoffpublic void setCutoff(double cutoff) Sets the cutoff for the independence test.- Parameters:
- cutoff- the cutoff for the independence test.
 
- 
setPriorEquivalentSampleSizepublic void setPriorEquivalentSampleSize(double priorEquivalentSampleSize) Sets the prior equivalent sample size for the independence test. The prior equivalent sample size is a parameter used in the calculation of the test statistic. A higher sample size will make the test more conservative, while a lower sample size will make the test more liberal.- Parameters:
- priorEquivalentSampleSize- the prior equivalent sample size to set
 
 
-