Class IndTestScore

java.lang.Object
edu.cmu.tetrad.search.score.IndTestScore
All Implemented Interfaces:
Score

public class IndTestScore extends Object implements Score
Gives a method of interpreting a test as a score. Various independence tests will calculate p-values; they simply report alpha - p as a score, which will be higher for greater dependence. This class wraps such an independence test and returns the score reported by that test.

As for all scores in Tetrad, higher scores mean more dependence, and negative scores indicate independence.

Author:
josephramsey
See Also:
  • Constructor Details

    • IndTestScore

      public IndTestScore(IndependenceTest test)
      Constructs the score using a covariance matrix.
      Parameters:
      test - The independence test.
  • Method Details

    • localScore

      public double localScore(int i, int[] parents)
      Calculates the sample likelihood and BIC score for i, given its parents in a simple SEM model
      Specified by:
      localScore in interface Score
      Parameters:
      i - The index of the variable.
      parents - The indices of the parents of i.
      Returns:
      The score.
    • localScoreDiff

      public double localScoreDiff(int x, int y, int[] z)
      Returns a "score difference", which amounts to a conditional local scoring criterion results. Only difference methods is implemented, since the other methods don't make sense here.
      Specified by:
      localScoreDiff in interface Score
      Parameters:
      x - A node.
      y - TAhe node.
      z - A set of nodes.
      Returns:
      The "difference".
    • localScore

      public double localScore(int i, int parent)
      Description copied from interface: Score
      Returns the local score of the graph.
      Specified by:
      localScore in interface Score
      Parameters:
      i - A node.
      parent - A parent.
      Returns:
      The local score.
      Throws:
      UnsupportedOperationException - if called.
    • localScore

      public double localScore(int i)
      Description copied from interface: Score
      Returns the local score of the gien node in the graph.
      Specified by:
      localScore in interface Score
      Parameters:
      i - A node.
      Returns:
      The local score.
      Throws:
      UnsupportedOperationException - if called.
    • isEffectEdge

      public boolean isEffectEdge(double bump)
      Returns true if the edge with the given bump is an effect edge.
      Specified by:
      isEffectEdge in interface Score
      Parameters:
      bump - The bump.
      Returns:
      True if so.
    • getDataSet

      public DataSet getDataSet()
      Returns the data set.
      Returns:
      The data set.
    • isVerbose

      public boolean isVerbose()
      Returns true if verbose output should be sent to out.
      Returns:
      True if verbose output should be sent to out.
    • setVerbose

      public void setVerbose(boolean verbose)
      Sets whether verbose output should be sent to out.
      Parameters:
      verbose - True if verbose output should be sent to out.
    • getVariables

      public List<Node> getVariables()
      Returns the list of variables.
      Specified by:
      getVariables in interface Score
      Returns:
      The list of variables.
    • getSampleSize

      public int getSampleSize()
      Returns the sample size.
      Specified by:
      getSampleSize in interface Score
      Returns:
      The sample size.
    • getMaxDegree

      public int getMaxDegree()
      Returns the maximum degree, which is set to 1000.
      Specified by:
      getMaxDegree in interface Score
      Returns:
      1000.
    • determines

      public boolean determines(List<Node> z, Node y)
      Returns the 'determines' judgment from the first score.
      Specified by:
      determines in interface Score
      Parameters:
      z - The set of nodes.
      y - The node.
      Returns:
      This judgment, true if the 'determine' relations holds.