Class GicScores

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

public class GicScores extends Object implements Score
Implements scores motivated by the Generalized Information Criterion (GIC) approach as given in Kim et al. (2012).

Kim, Y., Kwon, S., & Choi, H. (2012). Consistent model selection criteria on high dimensions. The Journal of Machine Learning Research, 13(1), 1037-1057.

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

Version:
$Id: $Id
Author:
josephramsey
  • Constructor Details

    • GicScores

      public GicScores(ICovarianceMatrix covariances)
      Constructs the score using a covariance matrix.
      Parameters:
      covariances - The covariance matrix.
    • GicScores

      public GicScores(DataSet dataSet, boolean precomputeCovariances)
      Constructs the score using a covariance matrix.
      Parameters:
      dataSet - The continuous dataset to analyze.
      precomputeCovariances - Whether the covariances should be precomputed or computed on the fly. True if
  • Method Details

    • localScoreDiff

      public double localScoreDiff(int x, int y, int[] z)
      Returns the score difference of the graph.

      Calculates the sample likelihood and BIC score for index i given its parents in a simple SEM model.

      Specified by:
      localScoreDiff in interface Score
      Parameters:
      x - A node.
      y - TAhe node.
      z - A set of nodes.
      Returns:
      The score difference.
    • localScore

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

      public ICovarianceMatrix getCovariances()
      Returns the sample size.
      Returns:
      This size.
    • getSampleSize

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

      public boolean isEffectEdge(double bump)
      Returns true iff the edge between x and y is an effect edge.

      Returns true if an edge with this bump is an effect edge.

      Specified by:
      isEffectEdge in interface Score
      Parameters:
      bump - The bump.
      Returns:
      True iff the edge between x and y is an effect edge.
    • getDataSet

      public DataSet getDataSet()
      Returns the dataset.
      Returns:
      The dataset.
    • 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()
      The variables of the score.

      Returns the variables of the dataset.

      Specified by:
      getVariables in interface Score
      Returns:
      This list.
    • setVariables

      public void setVariables(List<Node> variables)
      Sets the variables of the dataset.
      Parameters:
      variables - The variables of the dataset.
    • getMaxDegree

      public int getMaxDegree()
      Returns the max degree, by default 1000.

      Returns the max degree of the graph for some algorithms.

      Specified by:
      getMaxDegree in interface Score
      Returns:
      The max degree.
    • determines

      public boolean determines(List<Node> z, Node y)
      Returns true iff the score determines the edge between x and y.

      Returns a judgment of whether the variable in z determine y exactly.

      Specified by:
      determines in interface Score
      Parameters:
      z - The set of nodes.
      y - The node.
      Returns:
      True iff the score determines the edge between x and y.
    • setRuleType

      public void setRuleType(GicScores.RuleType ruleType)
      Sets the rule type.
      Parameters:
      ruleType - The rule type.
      See Also:
    • setLambda

      public void setLambda(double lambda)
      Sets the lambda parameter.
      Parameters:
      lambda - The lambda parameter.
    • getPenaltyDiscount

      public double getPenaltyDiscount()
      Returns the penalty discount.
      Returns:
      The penalty discount.
    • setPenaltyDiscount

      public void setPenaltyDiscount(double penaltyDiscount)
      Sets the penalty discount.
      Parameters:
      penaltyDiscount - The penalty discount.
    • toString

      public String toString()
      Returns a string for this object.
      Specified by:
      toString in interface Score
      Overrides:
      toString in class Object
      Returns:
      A string for this object.
    • setUsePseudoInverse

      public void setUsePseudoInverse(boolean usePseudoInverse)
      Sets whether to use the pseudo-inverse when calculating the score.
      Parameters:
      usePseudoInverse - True if so.