Summary
When tskeleton removes an edge x–y (i.e. a CI test returns pval >= alpha), no diagnostic information is currently persisted. This makes it hard to audit why an edge was rejected — especially in the presence of missing data where the MCAR/MAR/MNAR mechanism can cause spurious separations.
Proposed Feature
At the moment an edge is removed inside the repeat loop of tskeleton (currently workflow/rules/structure_learning_algorithms/tpc/R/tskeleton.R, around the pval >= alpha branch), write a row to a CSV file with the following columns:
| Column |
Description |
x |
Label of node x |
y |
Label of node y |
sepset |
Comma-separated labels of the separating set S |
pval |
P-value of the CI test that triggered removal |
n_complete |
Number of complete-case observations used in the test |
sepset_on_path |
Boolean — whether all elements of S satisfy the path condition (see below) |
This logging should only be performed when verbose = TRUE.
Path condition for sepset_on_path
For each element z ∈ S, check whether z lies on some indirect simple path between x and y in the current skeleton G:
- Empty S → always
TRUE (no elements to check)
- Each z →
TRUE iff x can reach z in G \ {y} and y can reach z in G \ {x} (BFS/DFS on the undirected adjacency matrix)
sepset_on_path is TRUE only if every element of S passes. A FALSE value is a sanity-check warning: the CI test found independence via a node that isn't even on an indirect route between x and y, which may indicate a spurious test result (e.g. due to missing data artefacts).
Rationale: the direct edge x–y is not a path that can be "broken" by conditioning, so only indirect paths (length ≥ 2, no repeated vertices) are relevant. Checking reachability in G \ {y} and G \ {x} respectively is sufficient for this sanity check.
Acceptance Criteria
Context / Motivation
- Debugging missing-data artefacts in the
tpc algorithm where CI tests can misfire
- Understanding which edges were removed and whether the separating set is structurally plausible
- The
n_complete and pval columns allow filtering out tests based on low sample size or marginal significance
Relevant Code
workflow/rules/structure_learning_algorithms/tpc/R/tskeleton.R — pval >= alpha branch (edge removal + sepset assignment, ~line 527–529)
workflow/rules/structure_learning_algorithms/tpc/script.R — entry point that calls tskeleton
Summary
When
tskeletonremoves an edgex–y(i.e. a CI test returnspval >= alpha), no diagnostic information is currently persisted. This makes it hard to audit why an edge was rejected — especially in the presence of missing data where the MCAR/MAR/MNAR mechanism can cause spurious separations.Proposed Feature
At the moment an edge is removed inside the
repeatloop oftskeleton(currentlyworkflow/rules/structure_learning_algorithms/tpc/R/tskeleton.R, around thepval >= alphabranch), write a row to a CSV file with the following columns:xysepsetpvaln_completesepset_on_pathThis logging should only be performed when
verbose = TRUE.Path condition for
sepset_on_pathFor each element
z ∈ S, check whetherzlies on some indirect simple path betweenxandyin the current skeletonG:TRUE(no elements to check)TRUEiffxcan reachzinG \ {y}andycan reachzinG \ {x}(BFS/DFS on the undirected adjacency matrix)sepset_on_pathisTRUEonly if every element of S passes. AFALSEvalue is a sanity-check warning: the CI test found independence via a node that isn't even on an indirect route betweenxandy, which may indicate a spurious test result (e.g. due to missing data artefacts).Rationale: the direct edge
x–yis not a path that can be "broken" by conditioning, so only indirect paths (length ≥ 2, no repeated vertices) are relevant. Checking reachability inG \ {y}andG \ {x}respectively is sufficient for this sanity check.Acceptance Criteria
tskeleton(e.g. as an optionaledge_logparameter;NULLdisables logging)verbose = TRUEpval >= alphablock)n_completereuses the value already computed at thecomplete.casescallTRUE)write.table(..., append = TRUE)) so partial runs remain readablescript.Rfor thetpcmodule passes the log path through totskeletonContext / Motivation
tpcalgorithm where CI tests can misfiren_completeandpvalcolumns allow filtering out tests based on low sample size or marginal significanceRelevant Code
workflow/rules/structure_learning_algorithms/tpc/R/tskeleton.R—pval >= alphabranch (edge removal + sepset assignment, ~line 527–529)workflow/rules/structure_learning_algorithms/tpc/script.R— entry point that callstskeleton