Skip to main content

Adjustment Identification Distance

Source: R/metrics.R

Description

Counts the ordered pairs of distinct nodes (t, y) for which cg_test leads to a wrong conclusion about the causal effect of t on y relative to cg_truth. For each pair, an adjustment set is read off cg_test with the strategy type, and it is a mistake if that set is not a valid adjustment set in cg_truth.

Usage

aid(
  cg_truth,
  cg_test,
  type = c("oset", "parent", "ancestor"),
  normalized = FALSE
)

Arguments

cg_truth The ground-truth graph: a DAG or PDAG-family graph (PDAG, CPDAG, MPDAG) created with cgraph().
cg_test The graph to evaluate, of the same kinds and with the same nodes as cg_truth.
type The adjustment strategy: "oset" (default; the optimal adjustment set, see adjustment_set()), "parent" (the parents of t), or "ancestor" (the ancestors of t, which makes the distance zero whenever cg_test respects the causal order of cg_truth).
normalized If TRUE, divide by the number of ordered pairs, n * (n - 1), giving a value in [0, 1].

Details

Outside the pairs its adjustment set applies to (y not a possible descendant of t in cg_test, or, for "parent", y a parent of t), the strategy instead claims a zero effect, which is correct if y is not a possible descendant of t in cg_truth. For a PDAG-family cg_test where the effect is not identifiable, the strategy claims so, which is correct if it is not identifiable in cg_truth either.

To compare causal discovery algorithms against a known true graph, first convert the truth to the class the algorithms estimate: dag_to_cpdag() for algorithms returning a CPDAG (such as PC). Otherwise edges the algorithm correctly leaves unoriented count as mistakes. If an estimate is an MPDAG built from background knowledge, apply the same knowledge to the true CPDAG with apply_background_knowledge().

Value

A number: the count of mistaken pairs, or its share of all ordered pairs if normalized = TRUE.

References

Henckel L, Würtzen T, Weichwald S (2024). “Adjustment Identification Distance: A gadjid for Causal Structure Learning.” In Proceedings of the Fortieth Conference on Uncertainty in Artificial Intelligence, volume 244 of Proceedings of Machine Learning Research.

Examples

truth <- cgraph(A %-->% B %-->% C, A %-->% C)
guess <- cgraph(A %-->% B %-->% C)
aid(truth, guess)
#> [1] 1
aid(truth, guess, type = "parent")
#> [1] 1
aid(truth, guess, type = "ancestor")
#> [1] 0