Class IdaCheck

java.lang.Object
edu.cmu.tetrad.search.IdaCheck

public class IdaCheck extends Object
This calculates total effects and absolute total effects for an MPDAG G for all pairs distinct (x, y) of variables, where the total effect is obtained by regressing y on x ∪ S and reporting the regression coefficient. Here, S ranges over sets consisting of possible parents of x in G--that is, a set consisting of the parents of x in G plus some combination of the neighbors for x in G, and excluding any children of x in G. Absolute total effects are calculated as the abolute values of the total effects; the minimum values for these across possible parent sets is reported as suggested in this paper:

Maathuis, Marloes H., Markus Kalisch, and Peter Bühlmann. "Estimating high-dimensional intervention effects from observational data." The Annals of Statistics 37.6A (2009): 3133-3164.

Additionally, if a linear SEM model is supplied over the same variables, a minimum squared distance is calculated of each coefficient in this IM from the interval of total effects (min to max) for the pair (x, y) for each directed edge x->y in the SEM IM. If the true total effect falls within the interval [min, max], we give a distance of 0; otherwise, we give the distance to the nearest endpoint. This distance is then squared.

We also report the averages of each statistic across all pairs of distinct nodes in the dataset.

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

    • IdaCheck

      public IdaCheck(Graph graph, DataSet dataSet, SemIm trueSemIm)
      Constructs a new IDA check for the given MPDAG and data set.
      Parameters:
      graph - the MPDAG.
      dataSet - the data set.
      trueSemIm - the true SEM IM.
  • Method Details

    • getTrueTotalEffect

      public double getTrueTotalEffect(OrderedPair<Node> pair)
      Calculates the true total effect between two nodes in the graph.
      Parameters:
      pair - the ordered pair of nodes for which the total effect is calculated.
      Returns:
      the true total effect between the two nodes.
    • getNodes

      public List<Node> getNodes()
      Returns a list of nodes.
      Returns:
      the list of nodes.
    • getOrderedPairs

      public List<OrderedPair<Node>> getOrderedPairs()
      Retrieves a list of OrderedPair objects representing all possible pairs of distinct nodes in the graph.
      Returns:
      a list of OrderedPair objects.
    • getMinTotalEffect

      public double getMinTotalEffect(Node x, Node y)
      Gets the minimum total effect value between two nodes.
      Parameters:
      x - the first node.
      y - the second node.
      Returns:
      the minimum total effect value between the two nodes.
      Throws:
      IllegalArgumentException - if the nodes x and y are the same.
    • getMaxTotalEffect

      public double getMaxTotalEffect(Node x, Node y)
      Returns the maximum total effect value between two nodes.
      Parameters:
      x - the first node.
      y - the second node.
      Returns:
      the maximum total effect value between the two nodes.
      Throws:
      IllegalArgumentException - if the nodes x and y are the same.
    • getIdaMinEffect

      public double getIdaMinEffect(Node x, Node y)
      Gets the signed minimum absolute total effect value between two nodes.
      Parameters:
      x - the first node.
      y - the second node.
      Returns:
      the signed minimum absolute total effect value between the two nodes.
      Throws:
      IllegalArgumentException - if the nodes x and y are the same.
    • getSquaredDistance

      public double getSquaredDistance(OrderedPair<Node> pair)
      Calculates the squared distance of the true total effect to the [min, max] IDA effect range of the given (x, y) node pair, for x predicting y. If the true effect falls within [min, max], the method returns 0. Otherwise, the squared distance to the nearest endpoint of the [min, max] range is returned.
      Parameters:
      pair - the pair of nodes.
      Returns:
      the squared distance between the two nodes.
    • getAverageSquaredDistance

      public double getAverageSquaredDistance(List<OrderedPair<Node>> pairs)
      Returns the average of the squared distances between the true total effects and the IDA effect ranges the list of node pairs indicated.
      Parameters:
      pairs - the list of node pairs.
      Returns:
      the average of the squared distances between the true total effects and the IDA effect ranges.
    • getSquaredMinTrueDistance

      public double getSquaredMinTrueDistance(OrderedPair<Node> pair)
      Returns the squared difference between the minimum total effect and the true total effect for the given pair of nodes.
      Parameters:
      pair - the pair of nodes.
      Returns:
      the squared difference between the minimum total effect and the true total effect.
    • getAvgMinSquaredDiffEstTrue

      public double getAvgMinSquaredDiffEstTrue(List<OrderedPair<Node>> pairs)
      Returns the average of the squared differences between the minimum total effects and the true total effects for the list of node pairs indicated.
      Parameters:
      pairs - the list of node pairs.
      Returns:
      the average of the squared differences between the minimum total effects and the true total effects.
    • getSquaredMaxTrueDist

      public double getSquaredMaxTrueDist(OrderedPair<Node> pair)
      Returns the squared difference between the maximum total effect and the true total effect for the given pair of nodes.
      Parameters:
      pair - the pair of nodes.
      Returns:
      the squared difference between the maximum total effect and the true total effect.
    • getAvgMaxSquaredDiffEstTrue

      public double getAvgMaxSquaredDiffEstTrue(List<OrderedPair<Node>> pairs)
      Returns the average of the squared differences between the maximum total effects and the true total effects for the list of node pairs indicated.
      Parameters:
      pairs - the list of node pairs.
      Returns:
      the average of the squared differences between the maximum total effects and the true total effects.