Learn R Programming

gadjid (version 0.1.0)

parent_aid: Parent Adjustment Identification Distance between two DAG / CPDAG adjacency matrices

Description

Computes the parent adjustment intervention distance between the true g_true DAG or CPDAG and an estimated g_guess DAG or CPDAG.

Usage

parent_aid(g_true, g_guess, edge_direction)

Value

2-element vector of type double
c(normalized error in [0,1], total number of errors)

Arguments

g_true

Adjacency matrix of the true graph

g_guess

Adjacency matrix of the guess graph

edge_direction

either "from row to column" or "from column to row"

Details

For details see Henckel, Würtzen, Weichwald (2024) tools:::Rd_expr_doi("doi:10.48550/arXiv.2402.08616")
The source code is available at github.com/CausalDisco/gadjid

Graph inputs are accepted as adjacency matrices of type double. An adjacency matrix for a DAG may only contain 0s and 1s. An adjacency matrix for a CPDAG may only contain 0s, 1s and 2s. DAG and CPDAG inputs are validated for acyclicity. However, for CPDAG inputs, the user needs to ensure the adjacency matrix indeed codes a valid CPDAG (instead of just a PDAG).

If edge_direction="from row to column", then a 1 in row r and column c codes a directed edge ‘r → c’; if edge_direction="from column to row", then a 1 in row r and column c codes a directed edge ‘c → r’; for either setting of edge_direction, a 2 in row r and column c codes an undirected edge ‘r – c’ (an additional 2 in row c and column r is ignored; one of the two entries is sufficient to code an undirected edge).

References

L Henckel, T Würtzen, S Weichwald. "Adjustment Identification Distance: A gadjid for Causal Structure Learning." Proceedings of the 40th Conference on Uncertainty in Artificial Intelligence (UAI), 2024. tools:::Rd_expr_doi("doi:10.48550/arXiv.2402.08616")

Examples

Run this code
full <- rbind(c(0, 1, 1, 1),
              c(0, 0, 1, 1),
              c(0, 0, 0, 1),
              c(0, 0, 0, 0))
chain <- rbind(c(0, 1, 0, 0),
               c(0, 0, 1, 0),
               c(0, 0, 0, 1),
               c(0, 0, 0, 0))
identical(parent_aid(full, chain, "from row to column"), c(4/12, 4))

Run the code above in your browser using DataLab