Class SemBicScore

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

public class SemBicScore extends Object implements Score

Implements the linear, Gaussian BIC score, with a 'penalty discount' multiplier on the BIC penalty. The formula used for the score is BIC = 2L - ck ln n, where c is the penalty discount and L is the linear, Gaussian log likelihood--that is, the sum of the log likelihoods of the individual records, which are assumed to be i.i.d.

For FGES, Chickering uses the standard linear, Gaussian BIC score, so we will for lack of a better reference give his paper:

Chickering (2002) "Optimal structure identification with greedy search" Journal of Machine Learning Research.

The version of the score due to Nandy et al. is given in this reference:

Nandy, P., Hauser, A., & Maathuis, M. H. (2018). High-dimensional consistency in score-based and hybrid structure learning. The Annals of Statistics, 46(6A), 3151-3183.

This score may be used anywhere though where a linear, Gaussian score is needed. Anectodally, the score is fairly robust to non-Gaussianity, though with some additional unfaithfulness over and above waht the score would give for Guassian data, a detriment that can be overcome to an extent by use a permutation algorithm such as SP, GRaSP, or BOSS

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

Author:
josephramsey
See Also:
  • Constructor Details

    • SemBicScore

      public SemBicScore(ICovarianceMatrix covariances)
      Constructs the score using a covariance matrix.
    • SemBicScore

      public SemBicScore(DataSet dataSet, boolean precomputeCovariances)
      Constructs the score using a covariance matrix.
  • Method Details

    • getVarRy

      public static double getVarRy(int i, int[] parents, Matrix data, ICovarianceMatrix covariances, boolean calculateRowSubsets) throws org.apache.commons.math3.linear.SingularMatrixException
      Throws:
      org.apache.commons.math3.linear.SingularMatrixException
    • bStar

      @NotNull public static @NotNull Matrix bStar(Matrix b)
    • localScoreDiff

      public double localScoreDiff(int x, int y, int[] z)
      Description copied from interface: Score
      Returns the score difference of the graph.
      Specified by:
      localScoreDiff in interface Score
      Parameters:
      x - A node.
      y - TAhe node.
      z - A set of nodes.
      Returns:
      The score difference.
    • nandyBic

      public double nandyBic(int x, int y, int[] z)
    • localScore

      public double localScore(int i, int... parents)
      Description copied from interface: Score
      The score of a node given its parents.
      Specified by:
      localScore in interface Score
      Parameters:
      i - The index of the node.
      parents - The indices of the node's parents.
      Returns:
      The score, or NaN if the score cannot be calculated.
    • getPenaltyDiscount

      public double getPenaltyDiscount()
      Specialized scoring method for a single parent. Used to speed up the effect edges search.
    • setPenaltyDiscount

      public void setPenaltyDiscount(double penaltyDiscount)
    • getStructurePrior

      public double getStructurePrior()
    • setStructurePrior

      public void setStructurePrior(double structurePrior)
    • getCovariances

      public ICovarianceMatrix getCovariances()
    • getSampleSize

      public int getSampleSize()
      Description copied from interface: Score
      The sample size of the data.
      Specified by:
      getSampleSize in interface Score
      Returns:
      This size.
    • isEffectEdge

      public boolean isEffectEdge(double bump)
      Description copied from interface: Score
      Returns true iff the edge between x and y 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.
    • getDataModel

      public DataModel getDataModel()
    • isVerbose

      public boolean isVerbose()
    • setVerbose

      public void setVerbose(boolean verbose)
    • getVariables

      public List<Node> getVariables()
      Description copied from interface: Score
      The variables of the score.
      Specified by:
      getVariables in interface Score
      Returns:
      This list.
    • setVariables

      public void setVariables(List<Node> variables)
    • getMaxDegree

      public int getMaxDegree()
      Description copied from interface: Score
      Returns the max degree, by default 1000.
      Specified by:
      getMaxDegree in interface Score
      Returns:
      The max degree.
    • determines

      public boolean determines(List<Node> z, Node y)
      Description copied from interface: Score
      Returns true iff the score determines the edge between x and y.
      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.
    • getData

      public DataModel getData()
    • setRuleType

      public void setRuleType(SemBicScore.RuleType ruleType)
    • subset

      public SemBicScore subset(List<Node> pi2)
    • toString

      public String toString()
      Description copied from interface: Score
      A string representation of the score.
      Specified by:
      toString in interface Score
      Overrides:
      toString in class Object
      Returns:
      This string.