cdt15 / lingam

Python package for causal discovery based on LiNGAM.
https://sites.google.com/view/sshimizu06/lingam
MIT License
368 stars 56 forks source link

About discrete graphs #68

Closed caimingA closed 1 year ago

caimingA commented 1 year ago

Hello,

This is the second time I ask a question. Thanks for your wonderful work.

When we use the OLS linear regression method, we can't get 0 even if there is no edge between two variable nodes. So, in your work instead of the general linear regression, the adaptive Lasso is used.

However, for some data, even with the adaptive Lasso, there are times when it can not guarantee that the DirectLiNGAM result will not have redundant edges, even though the values of the edges are very close to zero.

I think if I can further prune the adjacency matrix, the result might be closer to the true matrix. But, I don't know what criteria should I use for pruning, especially when analyzing discrete graphs in which there is no edge.

I'm wondering if I can directly get an answer here or if you can recommend me some papers that will be helpful.

sshimizu2006 commented 1 year ago

One way to strengthen the sparseness would be to use a different gamma, probably a bigger gamma, maybe 2 http://users.stat.umn.edu/~zouxx019/Papers/adalasso.pdf You might want to try different gamma values.

Now it's 1.0. https://lingam.readthedocs.io/en/latest/_modules/lingam/utils.html#predict_adaptive_lasso

caimingA commented 1 year ago

Thanks for your kind reply.

I think using a bigger gamma can literally improve the strength of the sparseness. I will have a try.

And, I'm wondering if there is a method that can prune edges after outputting the adjacency matrix by DirectLiNGAM. For example, when I did a simulation, my coefficient matrix B followed U[-1, -0.5] ∪ U[0.5, 1]. Then I can cut edges if the values were greater than -0.25 and less than 0.25 (this indeed simply improved the simulation results). But, I can not know the true distribution if I want to analyze real-world data.

Are there criteria or something else if I want to prune edges like this?

Thanks

sshimizu2006 commented 1 year ago

Well, drawing the histogram of coefficients computed using bootstrap might help. https://lingam.readthedocs.io/en/latest/tutorial/bootstrap.html

caimingA commented 1 year ago

Thanks!

I think this will work. I'm going to study it in detail.

Have a nice one!