Class IdaCheck
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.
IMPORTANT PERFORMANCE NOTE (2026-01): This class used to be frequently instantiated by UI editors that start with an empty table. In that context, precomputing effects for all O(p^2) pairs in the constructor made the UI slow to open.
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublegetAverageSquaredDistance(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.doublegetAvgMaxSquaredDiffEstTrue(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.doublegetAvgMinSquaredDiffEstTrue(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.getGraph()Returns a copy of the graph associated with this instance.doublegetIdaMinEffect(Node x, Node y) Gets the signed minimum absolute total effect value between two nodes.doublegetMaxTotalEffect(Node x, Node y) Returns the maximum total effect value between two nodes.doublegetMinTotalEffect(Node x, Node y) Gets the minimum total effect value between two nodes.getNodes()Returns a list of nodes.Retrieves a list of OrderedPair objects representing all possible pairs of distinct nodes in the graph.doublegetSquaredDistance(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.doublegetSquaredMaxTrueDist(OrderedPair<Node> pair) Returns the squared difference between the maximum total effect and the true total effect for the given pair of nodes.doubleReturns the squared difference between the minimum total effect and the true total effect for the given pair of nodes.doublegetTrueTotalEffect(OrderedPair<Node> pair) Calculates the true total effect between two nodes in the graph.voidrecompute(List<OrderedPair<Node>> currentPairs) Recomputes the total effects and absolute total effects for all ordered pairs of nodes in the graph.voidsetIdaType(Ida.IDA_TYPE idaType) Sets the IDA (Intervention Distribution Approximation) type for the current instance.
-
Constructor Details
-
IdaCheck
-
-
Method Details
-
setIdaType
Sets the IDA (Intervention Distribution Approximation) type for the current instance. This method updates the current IDA type and recalculates the results for total effects and absolute total effects as needed.- Parameters:
idaType- the IDA type to be set. Must not be null. Valid values are defined inIda.IDA_TYPE.- Throws:
NullPointerException- ifidaTypeis null.
-
getTrueTotalEffect
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
-
getOrderedPairs
Retrieves a list of OrderedPair objects representing all possible pairs of distinct nodes in the graph.- Returns:
- a list of OrderedPair objects.
-
getMinTotalEffect
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
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
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
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.If no IDA effects are available for this pair, returns
Double.NaN.- Parameters:
pair- the pair of nodes.- Returns:
- the squared distance between the two nodes.
-
getAverageSquaredDistance
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
Returns the squared difference between the minimum total effect and the true total effect for the given pair of nodes. If no IDA effects are available for this pair, returnsDouble.NaN.- Parameters:
pair- the pair of nodes.- Returns:
- the squared difference between the minimum total effect and the true total effect.
-
getAvgMinSquaredDiffEstTrue
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
Returns the squared difference between the maximum total effect and the true total effect for the given pair of nodes. If no IDA effects are available for this pair, returnsDouble.NaN.- Parameters:
pair- the pair of nodes.- Returns:
- the squared difference between the maximum total effect and the true total effect.
-
getAvgMaxSquaredDiffEstTrue
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.
-
recompute
Recomputes the total effects and absolute total effects for all ordered pairs of nodes in the graph. The method utilizes the current IDA type, which can be either regular or optimal depending on the "show optimal IDA" flag.This method clears any previously computed effects and recalculates them using the current state of the graph and IDA configuration.
- Parameters:
currentPairs- The list of ordered pairs for which effects should be recomputed.
-
getGraph
Returns a copy of the graph associated with this instance.This preserves the original behavior (returning a copy), but caches the copy so repeated calls do not repeatedly copy the graph.
- Returns:
- a copy of the graph.
-