Class ZsbScore

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

public class ZsbScore extends Object implements Score
Implements an unpublished score based on a risk bound due to Zhang and Shen. It adapts Theorem 1 in the following reference:

Zhang, Y., & Shen, X. (2010). Model selection procedure for high‐dimensional data. Statistical Analysis and Data Mining: The ASA Data Science Journal, 3(5), 350-358

The score uses Theorem 1 in the above to numerically search for a lambda value that is bounded by a given probability risk, between 0 and 1, if outputting a local false positive parent for a variable. There is a parameter m0, which is a maximum number of parents for a particular variable, which is free. The solution of this score is to increase m0 from 0 upward, re-evaluating with each scoring that is done using that variable as a target node. Thus, over time, a lower bound on m0 is estimated with more and more precision. So as the score is used in the context of FGES or GRaSP, for instance, so long as the score for a given node is visited more than once, the scores output by the procedure can be expected to improve, though setting m0 to 0 for all variables does not give bad results even by itself.

This score is conservative for large, dense models and faster than other available scores in this package. The risk bound is easily interpreted.

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

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

    • ZsbScore

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

      public ZsbScore(DataSet dataSet, boolean precomputeCovariances)
      Constructs the score using a covariance matrix.
      Parameters:
      dataSet - The data set.
      precomputeCovariances - a boolean
  • Method Details

    • localScore

      public double localScore(int i, int... parents)
      Returns the score for the child given the 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
    • localScoreDiff

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

      Returns localScore(y | z, x) - localScore(y | z).

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

      public ICovarianceMatrix getCovariances()
      Returns the covariance matrix.
      Returns:
      The covariance matrix.
    • 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 a judgement for FGES for whether a certain bump in score gives efidence of an effect edges.

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

      public List<Node> getVariables()
      The variables of the score.

      Returns the variables.

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

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

      Returns a judgment of max degree for some algorithms.

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

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

      Returns true if the variable in Z determine 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.
    • setRiskBound

      public void setRiskBound(double riskBound)
      Sets the risk bound for the Zhang Shen Bound score.
      Parameters:
      riskBound - The risk bound.
    • setUsePseudoInverse

      public void setUsePseudoInverse(boolean usePseudoInverse)
      Sets whether to use the pseudo-inverse in place of the inverse in the score.
      Parameters:
      usePseudoInverse - True if the pseudo-inverse should be used.