Class IndTestProbabilistic

java.lang.Object
edu.cmu.tetrad.search.test.IndTestProbabilistic
All Implemented Interfaces:
IndependenceTest

public class IndTestProbabilistic extends Object implements IndependenceTest
Uses BCInference by Cooper and Bui to calculate probabilistic conditional independence judgments.
Author:
josephramsey 3/2014
  • Constructor Details

    • IndTestProbabilistic

      public IndTestProbabilistic(DataSet dataSet)
      Initializes the test using a discrete data sets.
  • Method Details

    • indTestSubset

      public IndependenceTest indTestSubset(List<Node> vars)
      Description copied from interface: IndependenceTest
      Returns an Independence test for a sublist of the variables.
      Specified by:
      indTestSubset in interface IndependenceTest
      Parameters:
      vars - The sublist of variables.
      Throws:
      UnsupportedOperationException - Method not implemented.
    • checkIndependence

      public IndependenceResult 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.
      Specified by:
      checkIndependence in interface IndependenceTest
      Parameters:
      x - The first variable.
      y - The second variable.
      _z - The conditioning set.
      Returns:
      an independence result (see)
      See Also:
    • checkIndependence

      public IndependenceResult checkIndependence(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.
      Specified by:
      checkIndependence in interface IndependenceTest
      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

      public List<Node> getVariables()
      Returns the variables of the data set.
      Specified by:
      getVariables in interface IndependenceTest
      Returns:
      The variables.
    • getVariable

      public Node getVariable(String name)
      Returns the variable with the given name.
      Specified by:
      getVariable in interface IndependenceTest
      Returns:
      This variable.
    • determines

      public boolean determines(Set<Node> z, Node y)
      Description copied from interface: IndependenceTest
      Returns true if y is determined the variable in z.
      Specified by:
      determines in interface IndependenceTest
      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 interface IndependenceTest
      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 interface IndependenceTest
      Parameters:
      alpha - This level.
      Throws:
      UnsupportedOperationException - Method not implemented.
    • getData

      public DataModel getData()
      Returns the data set for which conditional independence judgments are requested.
      Specified by:
      getData in interface IndependenceTest
      Returns:
      The data set.
      See Also:
    • getH

      public Map<IndependenceFact,Double> 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 interface IndependenceTest
      Returns:
      True, if so.
    • setVerbose

      public void setVerbose(boolean verbose)
      Sets whether verbose output should be printed.
      Specified by:
      setVerbose in interface IndependenceTest
      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)