lingam icon indicating copy to clipboard operation
lingam copied to clipboard

How to use the initial DAG in the RESIT sample code?

Open FTamas77 opened this issue 1 year ago • 3 comments

For example, we have this code here: https://github.com/cdt15/lingam/blob/master/docs/tutorial/resit.rst

In that, we create an array:

m = np.array([ [0, 0, 0, 0, 0], [1, 0, 0, 0, 0], [1, 1, 0, 0, 0], [0, 1, 1, 0, 0], [0, 0, 0, 1, 0]])

But we never use it. I am confused because the adjacency matrix contains only 1 after the fitting. Could you help me to clarify the input/output of that code?

FTamas77 avatar Apr 21 '24 18:04 FTamas77

Hi @FTamas77 ,

The m is an array that we are creating to draw the true DAG, so we do not use it to run RESIT.

Like the inputs and outputs of other algorithms, the dataset is the input and the adjacency matrix is the output. However, because of RESIT's assumption of nonlinear functions, the adjacency matrix will have a value of 0 or 1.

ikeuchi-screen avatar Apr 22 '24 00:04 ikeuchi-screen

@ikeuchi-screen Thank you very much for the clarification. So, is it correct if I say that one means an existing correlation and zero means no correlation between the variables (in the adjacency matrix that is calculated during the fitting)?

And I guess the model.bootstrap(X, n_sampling=n_sampling) is good if I want to quantify this causal effect, isn't it?

FTamas77 avatar May 13 '24 11:05 FTamas77

@FTamas77 One in the adjacency matrix represents an edge in the causal graph, while zero represents no edge. Edges denote causation rather than correlation.

Because the relationship between variables is nonlinear, even model.bootstrap cannot estimate causal effects. Bootstrapping can estimate the probability of edges.

ikeuchi-screen avatar May 15 '24 14:05 ikeuchi-screen

Thank you very much for the clarification.

FTamas77 avatar May 28 '24 07:05 FTamas77