cmu-phil / py-tetrad

Makes algorithms/code in Tetrad available in Python via JPype
MIT License
50 stars 9 forks source link

Please correct "install.package(reticulate)" with "install.packages("reticulate")" #4

Closed roys8001 closed 1 year ago

roys8001 commented 1 year ago

Hi Dr Ramsey,

I could run the files on my laptop with no issue. However I found that in "sample_r_codeU.R", where $U\in {2, 3, 4, 5, 6}$, it is throwing error because of the above problem. I changed things locally and could run the file with no issue. Thank you so much. I was now wondering whether it would be possible for you to add functions for "ling" and "ccd" algorithms for use in R in the GitHub repo.

Regards, Saptarshi

jdramsey commented 1 year ago

Hi Saptarshi,

This is great! I updated something (R? RStudio?), and now those files do weird things if the 'install.packages("reticulate")' line is there for me since it's already installed for me. I've removed it from those files for now. I'll try testing it on some other machines. Thanks for pointing the issue out.

Interestingly, run_ccd is in my version--I'm wondering if you'll get it if you do a git pull? For ling, I've got to think about it. Maybe I'll think about that today. I was unsatisfied with the implementation.

Joe

On Thu, Apr 20, 2023 at 10:23 PM Saptarshi Roy @.***> wrote:

Hi Dr Ramsey,

I could run the files on my laptop with no issue. However I found that in "sample_r_codeU.R", where $U\in{2, 3, 4, 5}$, it is throwing error because of the above problem. I changed things locally and could run the file with no issue. Thank you so much. I was now wondering whether it would be possible for you to add functions for "ling" and "ccd" algorithms for use in R in the GitHub repo.

Regards, Saptarshi

— Reply to this email directly, view it on GitHub https://github.com/cmu-phil/py-tetrad/issues/4, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACLFSR4B5A47YOFAGUXXV73XCHVSRANCNFSM6AAAAAAXGIRUFA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

roys8001 commented 1 year ago

Thank you so much, Dr Ramsey. Yes I can see run_ccd in your version. I might have to clone the repository again if git pull does not work for me. On the other hand, actually I do need this ling algorithm for my current project, so if you could do something about it, that would be great.

jdramsey commented 1 year ago

@roys8001 I looked at ling--I may be able to get you something in the next few days. The code needed a lot of attention, though the article is clear. Anyway I'll see if it can be salvaged.

roys8001 commented 1 year ago

@jdramsey Thank you so much. Please let me know when you are done with this.

jdramsey commented 1 year ago

Would you like to help?

On Sun, Apr 23, 2023 at 1:04 PM Saptarshi Roy @.***> wrote:

@jdramsey https://github.com/jdramsey Thank you so much. Please let me know when you are done with this.

— Reply to this email directly, view it on GitHub https://github.com/cmu-phil/py-tetrad/issues/4#issuecomment-1519111630, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACLFSR7DUHQQ436DLPJHSOTXCVOIRANCNFSM6AAAAAAXGIRUFA . You are receiving this because you were mentioned.Message ID: @.***>

jdramsey commented 1 year ago

I spent some time on it today. I had to rewrite it from scratch, so it may be another week or so before it's ready to compare to other algorithms. I'll ask Peter on Tuesday what he thinks. But honestly, if you would like to help ensure it's behaving correctly, let me know, especially if you're making a comparison--it would be good to know it's correct.

On Sun, Apr 23, 2023 at 6:48 PM Joseph Ramsey @.***> wrote:

Would you like to help?

On Sun, Apr 23, 2023 at 1:04 PM Saptarshi Roy @.***> wrote:

@jdramsey https://github.com/jdramsey Thank you so much. Please let me know when you are done with this.

— Reply to this email directly, view it on GitHub https://github.com/cmu-phil/py-tetrad/issues/4#issuecomment-1519111630, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACLFSR7DUHQQ436DLPJHSOTXCVOIRANCNFSM6AAAAAAXGIRUFA . You are receiving this because you were mentioned.Message ID: @.***>

jdramsey commented 1 year ago

I won't promise a date--I'll work on it when I have time.

jdramsey commented 1 year ago

@roys8001 I made some progress on LiNG (which I should call LiNG-D according to the paper). I have an implementation that mainly works, and I am thinking about how to make it work well. Sorry for all the delays; I did not do this code initially, and there were several issues. I opted, in the end, to completely reimplement it, so now I'm thinking about the theory for it...I could also solve some of its outstanding issues and backport some of its features to LiNGAM.

roys8001 commented 1 year ago

Thank you so much, Dr Ramsey.

jdramsey commented 1 year ago

@roys8001 I finished my initial work on LiNGAM and LiNG-D and posted new versions of each. I made them available in R-tetrad if you want to try them.

roys8001 commented 1 year ago

Thank you so much, Dr Ramsey. This would be of great help.

jdramsey commented 1 year ago

In case it's unclear, I implemented it with two thresholds, a threshold on the spine (to make a strong diagonal hopefully quickly) and a threshold on the B matrix (to set small coefficients to zero). You'll have to play with these. I'm thinking of ways to make the algorithms work more automatically, but the things I tried today weren't all that effective. Also, I need to compare my implementations to Shimizu's.

jdramsey commented 1 year ago

Oops, clicked the close button by misake!

jdramsey commented 1 year ago

Hi @roys8001

Can this issue be closed now? I think I've fixed all of the issues you mentioned--if there are more issues can you open them separately (for accounting purposes)?

Joe

roys8001 commented 1 year ago

Yes thank you Dr Ramsey.

jdramsey commented 1 year ago

Great! Thanks.