Open cthoyt opened 1 year ago
Here is an example. Assume that this is the prior knowledge network in the form of ADMG:
Now assume that the conditional independency test based on the data between $Z_1$, $Z_2$ given $M_1$ failed. In addition the conditional independency between $R_2$, and $R_3$ given some variables failed. Furthermore, the conditional independency between $Y$, and $R_3$ given some other variables failed. Hence we will put a bi-directed edge between ($Z_1$, $Z_2$), ($R_2$, $R_3$), and ($Y$, $R_3$) as follows:
The above graph is the repaired ADMG.
It's not clear to me why you would make a test between $Z_1$, $Z_2$ given $M_1$ then infer that there should be a bidirected edge between ($Z_1$, $Z_2$). What is special about $M_1$ in this case? Can you please make this a bit more of an algorthmic description?
Here are the all of the conditional independencies for this graph calculated with y0.algorithm.conditional_independencies.get_conditional_independencies()
:
left | right | conditions |
---|---|---|
M1 | R1 | M2 |
M1 | R2 | M2 |
M1 | R3 | M2 |
M1 | Y | M2, X |
M1 | Z1 | X |
M1 | Z2 | X |
M1 | Z3 | X |
M2 | R2 | R1 |
M2 | R3 | R2 |
M2 | X | M1 |
M2 | Z1 | M1 |
M2 | Z2 | M1 |
M2 | Z3 | M1 |
R1 | R3 | R2 |
R1 | X | M2 |
R1 | Y | M2, R3 |
R1 | Z1 | M2 |
R1 | Z2 | M2 |
R1 | Z3 | M2 |
R2 | X | M2 |
R2 | Y | M2, R3 |
R2 | Z1 | M2 |
R2 | Z2 | M2 |
R2 | Z3 | M2 |
R3 | X | M2 |
R3 | Z1 | M2 |
R3 | Z2 | M2 |
R3 | Z3 | M2 |
X | Y | M2, Z3 |
X | Z2 | Z1 |
X | Z3 | Z2 |
Y | Z1 | M2, Z3 |
Y | Z2 | M2, Z3 |
Z1 | Z3 | Z2 |
So it can be given no variables or any combination of variables
Turns out @srtaheri is looking for https://github.com/y0-causal-inference/y0/blob/main/src/y0/algorithm/falsification.py
This takes a prior knowledge on the network in the form of DAG or ADMG, as well as the available data (can be observational and/or interventional data), and repairs the network structure based on given data. The goal is to make sure that the conditional independence implied by the data are aligned with the conditional independence implied by the network. Here are the steps:
1) Use a conditional independence test to find all the tests that failed. 2) For each failed test between two variables such as V_i and V_j, add a bi-directed edge between them.
Now we have a repaired network with additional bi-directed edges. If the prior knowledge graph was an ADMG, we now have a new ADMG with additional bi-directed edges. If the prior knowledge graph was a DAG, it is now converted to an ADMG.