Open wilsoncai1992 opened 8 years ago
Thanks for pointing this out, this is very interesting.
This code should have given an error in the previous versions of the package as well. It was working, but it wasn't designed to work in this manner. Actions should only be added to DAGs returned from set.DAG()
function, which checks the DAG object for consistency and errors. The above code is trying to add an action to a DAG object "D", rather than object "setDl2". Otherwise you are not using setDl2
anywhere in your code.
D_act <- setDl2 + action("A_th0", nodes=actN_A, theta=0)
D_act <- D_act + action("A_th1", nodes=actN_A, theta=1)
D_act <- D_act + action("A_no_intervene", nodes=node("A", distr="rconst", const = as.numeric(UA < expit(-0.5 + W1 - 1.5 * W2)) ))
ate.data <- simfull(A(D_act), n=1e5 , rndseed = 252)
The error message returned is non-informative and needs to be changed, so keeping this issue open.
Thank you for your timely reply! I overlooked the difference when I did it, since the class for both "D" and "setDl2" are both "DAG".
I am trying to perform a deterministic intervention on a DAG.
The D_act assignment fails to run under 0.5.0 while suceeds under 0.4.0. Could you please take a look when you have time?