py-why / dowhy

DoWhy is a Python library for causal inference that supports explicit modeling and testing of causal assumptions. DoWhy is based on a unified language for causal inference, combining causal graphical models and potential outcomes frameworks.
https://www.pywhy.org/dowhy
MIT License
6.88k stars 916 forks source link

What is the purpose of providing observation data in gcm.conventional_samples()? #1155

Closed CrisprM closed 2 months ago

CrisprM commented 2 months ago

Ask your question Hi

About simulating the Impact of Interventions, I would like to understand the difference between using ""observed_data"" and ""num_samples_to_draw"" in gcm.conventional_samples()? I think both generate data using fitted structural equations, what is the effect of providing observed_data? Can you give me an example that shows the difference?

Thank you very much.

samples_1 = gcm.interventional_samples(causal_model, {'X': lambda x: 1}, observed_data=data)

samples_2 = gcm.interventional_samples(causal_model,
                                       {'X': lambda x: 1},
                                       num_samples_to_draw=1000)