Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the advantage of the "global_only=True" parameter in the LiM method? #108

Open
EsqYu opened this issue Sep 4, 2023 · 11 comments
Open

Comments

@EsqYu
Copy link

EsqYu commented Sep 4, 2023

Hi.
In the recent updates, the "global_only" parameter has been added to the model.fit() method of LiM. What is the advantage of setting this parameter to "True"?

@sshimizu2006
Copy link
Collaborator

"global_only" is computationally faster, but could be somewhat less accurate.

@EsqYu
Copy link
Author

EsqYu commented Sep 5, 2023

Thanks for your reply. I understand that very well. Speaking about LiM, can this algorithm be used to infer causal relationships of mixed variables that consist of continuous and discrete but not limited to binary data like results of 5 star rating?

@sshimizu2006
Copy link
Collaborator

LiM assumes binary variables. If your variables are 5 stars, you could assume such 5 stars are approximated well by continuous variables. Then, you could analyze your variables by methods for continuous variables.

@EsqYu
Copy link
Author

EsqYu commented Sep 6, 2023

Thank you. I understand that LiM can be used only for mixed data of continuous variables and binary variables. What kind of approximation method are generally used to deal with discrete variables other than binary ones?

I have another question. In the LiM tutorial(https://lingam.readthedocs.io/en/latest/tutorial/lim.html), there are Python codes which illustrate how to implement LiM. However, it seems that the sample model is not able to estimate the true adjacency matrix because the estimated one and the true one are different. Basically, I think tutorials include an example of a correct estimation, but this tutorial only shows a result of an incorrect estimation, so I wonder if this algorithm is not very accurate.

@sshimizu2006
Copy link
Collaborator

I meant just assuming your 5 stars variables, that would take 1, 2, 3, 4, 5, are continuous.

@EsqYu
Copy link
Author

EsqYu commented Sep 6, 2023

I see. Then, what if the values of the variables are not related to the size of variables like a department code(0: Personnel 1: Sales Department ..., .etc)?

@sshimizu2006
Copy link
Collaborator

If they are no ordinal, but categorical, no methods are available now in the package.

@YanaZeng
Copy link
Collaborator

YanaZeng commented Sep 6, 2023

Thank you. I understand that LiM can be used only for mixed data of continuous variables and binary variables. What kind of approximation method are generally used to deal with discrete variables other than binary ones?

I have another question. In the LiM tutorial(https://lingam.readthedocs.io/en/latest/tutorial/lim.html), there are Python codes which illustrate how to implement LiM. However, it seems that the sample model is not able to estimate the true adjacency matrix because the estimated one and the true one are different. Basically, I think tutorials include an example of a correct estimation, but this tutorial only shows a result of an incorrect estimation, so I wonder if this algorithm is not very accurate.

Can you show your experimental results? like how many variables and samples did you use and what kind of data types?

If you would like a better estimation, please choose "global_only=False". Or see our paper for more results (Y. Zeng, S. Shimizu, H. Matsui, F. Sun. Causal discovery for linear mixed data. In Proc. First Conference on Causal Learning and Reasoning (CLeaR2022). PMLR 177, pp. 994-1009, 2022.).

If there are 2 variables (one continuous and one binary) as shown in the tutorial, the estimation accuracy should be high, approx. 1 in F1 value.

@EsqYu
Copy link
Author

EsqYu commented Sep 6, 2023

Actually, I'm talking about the test results in the tutorial. As you see in the tutorial, the true adjacency matrix is [[0. 0. ]
[1.3082251 0. ]], while the estimated matrix is [[ 0. , 0. ],
[-1.09938457, 0. ]]. I believe the former one and the latter one are different, so I'm wondering if this algorithm estimates the true adjacency matrix correctly.

@YanaZeng
Copy link
Collaborator

YanaZeng commented Sep 6, 2023

Here we evaluate the performance of the causal structure between variables, not including its causal effects. So I am sorry to say that our algorithm cannot guarantee to estimate the causal effects accurately.

@EsqYu
Copy link
Author

EsqYu commented Sep 7, 2023

I understand. Then, is it correct that I can't use LiM just like I use LiNGAM, which can estimate both causal structures and causal effects?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants