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

Cyclic Causal Discovery Algorithms #1577

Closed
ghost opened this issue Apr 4, 2023 · 20 comments
Closed

Cyclic Causal Discovery Algorithms #1577

ghost opened this issue Apr 4, 2023 · 20 comments

Comments

@ghost
Copy link

ghost commented Apr 4, 2023

The TETRAD GUI application does not support any cyclic causal discovery algorithms like CCD, CCI, LiNG as of now, right??

@jdramsey
Copy link
Collaborator

jdramsey commented Apr 4, 2023

Well, CCD I can never get to work correctly (very hit or miss), so I took it out of the interface. CCI for us refers to a certain test, not a search algorithm. We have code for LiNG, but it needs to be recorded. The implementation was not coded well before; after many refactorings, I realized I just needed to recode it from scratch. I'll do that. Maybe GPT4 can help.

We do have one algorithm that does well with cyclic graphs, which is FASK... let me see if I can find the paper for that...

https://www.biorxiv.org/content/10.1101/245936v1.abstract

We compared FASK and a Matlab algorithms called Two Step on a cyclic fMRI task.

@cg09
Copy link

cg09 commented Apr 4, 2023 via email

@ghost
Copy link
Author

ghost commented Apr 4, 2023

Thank you so much Dr. Ramsey & Dr. Glymour. This is like a big fan moment for me to get a reply from your side. I shall go through the papers that you have mentioned. Thank you so much.

On a side note, I must mention that I am finding it difficult to run the rcausal package in R, which is an wrapper written in R for Tetrad library. There is a ccd() function for Cyclic Causal Discovery algorithm (Richardson, 1996) there but it is giving error everytime I run. The error I am getting is as follows,

data("audiology")
#Compute Cyclic Causal Discovery
ccd <- ccd(df=audiology, continuous = FALSE, depth = -1, verbose = TRUE)

Error in ccd(df = audiology, continuous = FALSE, depth = -1, verbose = TRUE) :
unused argument (continuous = FALSE)

Could you help me with this? I am well aware of the fact that the rcausal package has not been updated since 2019 and this is the next project that you are going to take up in future.

@jdramsey
Copy link
Collaborator

jdramsey commented Apr 4, 2023

It's interesting that you should ask this question right at this time; just this week (including work in the last few hours by me) we've been trying to come up with a way to use the most recent Tetrad jar for including Tetrad in R. Maybe you want to be a Guinea pig? This is fresh code; there could still be bugs, but your feedback would be invaluable.

Here's the project--the part of the project for incorporating Tetrad into Python already works quite well, but we just added a Python class, TetradSearch, that seems to work quite well from R. I'd be very curious whether you can follow the instructions for getting it to work and if not where you get stuck.

https://github.com/cmu-phil/py-tetrad

@jdramsey
Copy link
Collaborator

jdramsey commented Apr 4, 2023

I did not put CCD into this build, though I could if you really want to use it. I've just had so much trouble with accuracy for it.

@jdramsey
Copy link
Collaborator

jdramsey commented Apr 4, 2023

And I'm glad you're able to use Tetrad--that's nice!

@ghost
Copy link
Author

ghost commented Apr 4, 2023

Thanks Dr Ramsey. I am happy to be the guinea pig for this noble cause. It would be great if you could put CCD in this build and I can check on that too.

@jdramsey
Copy link
Collaborator

jdramsey commented Apr 4, 2023

I will add it and organize the instructions a little better. :)

@ghost
Copy link
Author

ghost commented Apr 4, 2023

Thank you so much, Dr Ramsey.

@jdramsey
Copy link
Collaborator

jdramsey commented Apr 4, 2023

The setup for this may be annoying, but the payoff of going through all the setup will be very nice--it will be so easy to run Tetrad algorithms in R! @bja43, and I thought up this way of doing it yesterday. Very experimental, but very curious about what you think.

I've put the instructions in the R README.md file in py-tetrad. I'll edit them there.

@jdramsey
Copy link
Collaborator

jdramsey commented Apr 4, 2023

By the way, I edited the above several times, and to anyone who as a result go a slew of emails, I humbly apologize!

@ghost
Copy link
Author

ghost commented Apr 4, 2023

Thank you so much, Dr Ramsey. It would be helpful if you give me sometime to go through the steps and apply it on my MAC.

@jdramsey
Copy link
Collaborator

jdramsey commented Apr 4, 2023

Take your time. Also, if a step is not working for you, let me know, but you're using a Mac; I think it should work in principle.

@ghost
Copy link
Author

ghost commented Apr 4, 2023

I was trying to follow what you explicitly wrote in the README file for calling the python class from R.
However when I am sourcing the run_continuous.py file, the following error is shown.

source_python("run_continuous.py")
Error: ModuleNotFoundError: No module named 'jpype'

However I must mention that I have python 3.11 installed on my MAC with pycharm as an IDE. I have installed JPype in the pycharm terminal with the following command -

pip install JPype1

And there was no error during the installation process. Could you point me to the direction where I am doing wrong?

@jdramsey
Copy link
Collaborator

jdramsey commented Apr 4, 2023

I'll add a note--installing JPype was part of the installation process for setting up py-tetrad. Let me fix that.

@jdramsey
Copy link
Collaborator

jdramsey commented Apr 4, 2023

OK, I pasted the py-tetrad install instructions into that page; I may simplify it though, especially since as you say all you really need to do it type pip install JPype1. Let me think about it. Anyway here's the revision:

https://github.com/cmu-phil/py-tetrad/blob/main/pytetrad/R/README.md

@jdramsey
Copy link
Collaborator

jdramsey commented Apr 4, 2023

Yeah hold on let me simplify.

@jdramsey
Copy link
Collaborator

jdramsey commented Apr 5, 2023

OK, I simplified it. Hopefully it's clearer!

@jdramsey
Copy link
Collaborator

jdramsey commented Apr 5, 2023

I simplified it more... (I'm really bad at writing instructions like this and have to go through several revisions...)

@jdramsey
Copy link
Collaborator

jdramsey commented Apr 5, 2023

Maybe hold on a bit, @bja43 is doing some revisions...

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

2 participants