GithubHelp home page GithubHelp logo

Comments (8)

jdramsey avatar jdramsey commented on June 25, 2024 1

@ungvilde Here you go; I put an answer here:

cmu-phil/py-tetrad#18

As I said there, if you need to do this a different way, let me know.

from causal-learn.

kunwuz avatar kunwuz commented on June 25, 2024

Yes, and you can check how to incorporate background_knowledge here: https://github.com/py-why/causal-learn/blob/main/tests/TestBackgroundKnowledge.py. The following code would be enough, where the data is of the shape (# of samples, # of observed variables):

g, edges = fci(data, independence_test_method, background_knowledge)

from causal-learn.

ungvilde avatar ungvilde commented on June 25, 2024

@kunwuz Thanks for the quick reply!

However, I was hoping to find a method for using the FCI algorithm with a CI oracle. As far as I understand it, doing

fci(data, independence_test_method, background_knowledge)

will use CI tests based on the data sample and the chosen method.

But if G is a DAG with N variables, then I can do

fci(np.empty(shape=(1, N)), d_separation, true_dag=G, background_knowledge=bk)

to get the FCI output with a CI oracle for G, incorporating background knowledge. But what if G is only partially observed? In other words, if G is a subgraph of some other DAG G_true.

Thanks again.

EDIT: The reason I want to do this is to compare the theoretical results of the algorithm with the finite sample result. The structures I am studying are known to have latent variables, so I want to see how they affect the results.

from causal-learn.

kunwuz avatar kunwuz commented on June 25, 2024

Hi, I think it might be possible but can't be sure for now since I haven't tried FCI with a CI Oracle for some time. A quick option, as suggested by @jdramsey, would be to try tetrad (or py-tetrad as a Python wrapper) for this. Perhaps Joe (@jdramsey) could provide a better response?

from causal-learn.

jdramsey avatar jdramsey commented on June 25, 2024

Sure, this is something that's actually very easy to do in Tetrad (or py-tetrad); I could show you the basic idea if you like. The basic idea is you'd make the full DAG with all of the variables but set the type of some of the nodes to Latent. Then you define your background knowledge and do an FCI search with the knowledge using the "MsepTest." That will give you the ideal PAG you're looking for, I think.

from causal-learn.

ungvilde avatar ungvilde commented on June 25, 2024

Thanks for the reply, @jdramsey. That sounds exactly like what I want to do! It could actually be really helpful if you showed me the basic idea... Only if it is not too much trouble, of course.

from causal-learn.

jdramsey avatar jdramsey commented on June 25, 2024

Absolutely! I'll type out some py-tetrad code and send it by tomorrow. You should be able to morph it into your example.

from causal-learn.

ungvilde avatar ungvilde commented on June 25, 2024

from causal-learn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.