Class GraphScore

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

public class GraphScore extends Object implements Score
Implements a pscudo-"score" that implmenets implements Chickering and Meek's (2002) locally consistent score criterion. This is not a true score; rather, a -1 is returned in case mseparation holds and a 1 in case mseparation does not hold. This is only meant to be used in the context of FGES, and allows the search to follow its path prescribed by the locally consistent scoring criterion. For a reference to the latter, pleasee this article:

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

For further discussion of using m-separation in the GES search, see:

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.

For more discussion please see:

Shen, X., Zhu, S., Zhang, J., Hu, S., & Chen, Z. (2022, August). Reframed GES with a neural conditional dependence measure. In Uncertainty in Artificial Intelligence (pp. 1782-1791). PMLR.

Author:
josephramsey
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a GraphScore from a list of independence facts.
    Constructs a GraphScore from a DAG.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a copy of the DAG being searched over.
    int
    Returns the maximum degree, which is set to 1000.
    int
    The sample size of the data.
    Returns the list of variables.
    boolean
    isEffectEdge(double bump)
    Returns a judgment for FGES whether a score with the bump is for an effect edge.
    double
    localScore(int i)
    Returns the local score of the gien node in the graph.
    double
    localScore(int i, int parent)
    Returns the local score of the graph.
    double
    localScore(int y, int[] z)
    Calculates the sample likelihood and BIC score for y given its z in a simple SEM model.
    double
    localScoreDiff(int x, int y)
    The "unconditional difference." Only difference methods is implemented, since the other methods don't make sense here.
    double
    localScoreDiff(int x, int y, int[] z)
    Returns a "score difference", which amounts to a conditional local scoring criterion results.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface edu.cmu.tetrad.search.score.Score

    append, determines, getVariable, toString
  • Constructor Details

    • GraphScore

      public GraphScore(Graph dag)
      Constructs a GraphScore from a DAG.
      Parameters:
      dag - A directed acyclic graph.
    • GraphScore

      public GraphScore(IndependenceFacts facts)
      Constructs a GraphScore from a list of independence facts.
      Parameters:
      facts - A list known independence facts; a lookup will be donw from these facts.
      See Also:
  • Method Details

    • localScore

      public double localScore(int y, int[] z)
      Calculates the sample likelihood and BIC score for y given its z in a simple SEM model.
      Specified by:
      localScore in interface Score
      Parameters:
      y - The node.
      z - The parents.
      Returns:
      this 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".
    • localScoreDiff

      public double localScoreDiff(int x, int y)
      The "unconditional difference." 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 - The node.
      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:
      javax.help.UnsupportedOperationException - Since the method doesn't make sense here.
    • 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:
      javax.help.UnsupportedOperationException - Since the method doesn't make sense here.
    • isEffectEdge

      public boolean isEffectEdge(double bump)
      Returns a judgment for FGES whether a score with the bump is for an effect edge.
      Specified by:
      isEffectEdge in interface Score
      Parameters:
      bump - The bump
      Returns:
      True, if so.
      See Also:
    • getVariables

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

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

      public int getSampleSize()
      Description copied from interface: Score
      The sample size of the data.
      Specified by:
      getSampleSize in interface Score
      Returns:
      This size.
      Throws:
      javax.help.UnsupportedOperationException - Since the method doesn't make sense here.
    • getDag

      public Graph getDag()
      Returns a copy of the DAG being searched over.
      Returns:
      This DAG.