Comments (8)
@ungvilde Here you go; I put an answer here:
As I said there, if you need to do this a different way, let me know.
from causal-learn.
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.
@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.
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.
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.
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.
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.
from causal-learn.
Related Issues (20)
- PNL - Test2 HOT 3
- Data correlation matrix is singular HOT 5
- when will the Causal-Learn support causal evaluation HOT 2
- Reference PC stable HOT 1
- FCI implementation HOT 7
- Questions about is_dseparated_from HOT 3
- does this codebase support some recent causal discovery methods like, notears, dag-gnn,and so on HOT 2
- A potential Bug in GES.py HOT 1
- Null Hypothesis in Conditoinal Independence Tests HOT 2
- How to construct a causallearn.graph.Graph object from an numpy array? HOT 2
- Boostrap Utilities HOT 1
- Background knowledge not used correctly? HOT 1
- Implementation for CCI? HOT 1
- How to estimate the causal effect? HOT 1
- Different results with Tetrad and causal-learn implementations. HOT 6
- numpy version HOT 1
- Understanding the FCI outputs (graph vs. printed edges) HOT 3
- Handling Data with Interventions HOT 4
- array must not contain infs or NaNs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from causal-learn.