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.
Version:
$Id: $Id
Author:
josephramsey
  • Constructor Details

    • ScoreIndTest

      public ScoreIndTest(Score score)

      Constructor for ScoreIndTest.

      Parameters:
      score - a Score object
    • ScoreIndTest

      public ScoreIndTest(Score score, DataModel data)

      Constructor for ScoreIndTest.

      Parameters:
      score - a Score object
      data - a DataModel object
  • Method Details

    • indTestSubset

      public ScoreIndTest indTestSubset(List<Node> vars)
      Tests the independence between variables in a given sublist.
      Specified by:
      indTestSubset in interface IndependenceTest
      Parameters:
      vars - The sublist of variables to test independence.
      Returns:
      The result of the independence test.
    • checkIndependence

      public IndependenceResult checkIndependence(Node x, Node y, Set<Node> z)
      Checks the independence between two nodes given a set of additional nodes.
      Specified by:
      checkIndependence in interface IndependenceTest
      Parameters:
      x - The first node
      y - The second node
      z - The set of additional nodes
      Returns:
      The result of the independence test
      See Also:
    • 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)
      Retrieves the Node object with the specified name.
      Specified by:
      getVariable in interface IndependenceTest
      Parameters:
      name - The name of the Node object to retrieve.
      Returns:
      The Node object with the specified name, or null if not found.
    • determines

      public boolean determines(List<Node> z, Node y)
      Determines the result of an independence test between a set of variables and a target variable.
      Parameters:
      z - The set of variables to test for independence.
      y - The target variable to test against.
      Returns:
      The result of the independence test.
    • 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 for the independence test.
      Specified by:
      setAlpha in interface IndependenceTest
      Parameters:
      alpha - The level of significance to be set.
    • getData

      public DataModel getData()
      Retrieves the data model associated with this object.
      Specified by:
      getData in interface IndependenceTest
      Returns:
      The data model object.
      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 - since not implemented.
    • getSampleSize

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

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

      public boolean isVerbose()
      Returns a boolean indicating whether verbose output is enabled.
      Specified by:
      isVerbose in interface IndependenceTest
      Returns:
      true if verbose output is enabled, false otherwise
    • setVerbose

      public void setVerbose(boolean verbose)
      Sets whether verbose output is enabled or not.
      Specified by:
      setVerbose in interface IndependenceTest
      Parameters:
      verbose - true if verbose output is enabled, false otherwise
    • toString

      public String toString()
      Returns a string representation of the object.
      Specified by:
      toString in interface IndependenceTest
      Overrides:
      toString in class Object
      Returns:
      A string representing the object.