Class ScoreIndTest

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

public class ScoreIndTest extends Object implements IndependenceTest

Gives a way of interpreting a score as an independence test. The contract is that the score returned will be negative for independence and positive for dependence; this simply reports these differences.

Author:
josephramsey
  • Constructor Details

    • ScoreIndTest

      public ScoreIndTest(Score score)
    • ScoreIndTest

      public ScoreIndTest(Score score, DataModel data)
  • Method Details

    • indTestSubset

      public ScoreIndTest 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.
      Returns:
      an Independence test for a subset of the variables.
    • checkIndependence

      public IndependenceResult checkIndependence(Node x, Node y, List<Node> z)
      Determines whether x _||_ y | z
      Specified by:
      checkIndependence in interface IndependenceTest
      Returns:
      The independence result.
      Throws:
      RuntimeException - if a matrix singularity is encountered.
      See Also:
    • getPValue

      public double getPValue()
      Returns the probability associated with the most recently executed independence test, of Double.NaN if p value is not meaningful for this test.
      Returns:
      This p-value.
    • getVariables

      public List<Node> getVariables()
      Returns the list of variables over which this independence checker is capable of determinining independence relations.
      Specified by:
      getVariables in interface IndependenceTest
      Returns:
      This list.
    • getVariable

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

      public boolean determines(List<Node> z, Node y)
      Returns true if y is determined the variable in z.
      Specified by:
      determines in interface IndependenceTest
      Returns:
      True is so.
    • getAlpha

      public double getAlpha()
      Returns the significance level of the independence test.
      Specified by:
      getAlpha in interface IndependenceTest
      Returns:
      This level.
      Throws:
      UnsupportedOperationException - if there is no significance level.
    • setAlpha

      public void setAlpha(double alpha)
      Sets the significance level.
      Specified by:
      setAlpha in interface IndependenceTest
      Parameters:
      alpha - This level.
    • getData

      public DataModel getData()
      Specified by:
      getData in interface IndependenceTest
      Returns:
      The data model for the independence test.
      See Also:
    • getCov

      public ICovarianceMatrix getCov()
      Returns the covariance matrix.
      Specified by:
      getCov in interface IndependenceTest
      Returns:
      This matrix.
    • getDataSets

      public List<DataSet> getDataSets()
      Description copied from interface: IndependenceTest
      Returns the datasets for this test
      Specified by:
      getDataSets in interface IndependenceTest
      Returns:
      these datasets.
      Throws:
      UnsupportedOperationException - Not implemented.
    • getSampleSize

      public int getSampleSize()
      Returns the sample size.
      Specified by:
      getSampleSize in interface IndependenceTest
      Returns:
      This size.
    • getScore

      public double getScore()
      Returns A score that is higher with more likely models.
      Specified by:
      getScore in interface IndependenceTest
      Returns:
      This score.
    • getWrappedScore

      public Score getWrappedScore()
      Returns the score object that this test wraps.
      Returns:
      This score object.
      See Also:
    • isVerbose

      public boolean isVerbose()
      Returns true if verbose ouput 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.
    • toString

      public String toString()
      Returns a String representation of this test.
      Specified by:
      toString in interface IndependenceTest
      Overrides:
      toString in class Object
      Returns:
      This string.