# How is the counterfactual estimated in Judea Pearls book based on causal inference ? (dowhy)

I have started looking into causal inference, in particular Dowhy package based on Judea Pearls book of why. What i don't understand is how the counterfactual is estimated?

My understanding is that DoWhy package (based on judea pearl book) addresses counterfactuals by creating a bayesian graphical model (at very high level) but i don't understand the math of how this is done. Can anybody point me in right direction of how it is estimated?

Step 2 in the 4 step process also confuses me. When we say step 2 is 'identification' do we mean that the graphical model tries to write the structure of model we feed it in a probabilistic way?

Any light somebody could shed on how counterfactual is created using dowhy/judea pearl way would be great.

4 STEPS:

The four Steps of causal inference.

1. Modelling: create a causal graph to encode assumptions a. This is about creating a causal graph that encodes our assumptions that we are bringing in from our domain knowledge and our knowledge about how world works to augment data that we are using
2. Identification: formulate what to estimate a. Here we are going to be taking those assumptions in causal graph and model and using it to formulate what we need to estimate
3. Estimation: compute the estimate a. Given all the realities of the dataset what is the best way to trade off the bias and variance for whatever task we’re trying to do to get a causual estimate of what is the impact of doing one thing vs the other on outcomes we care about
4. Refutation: validate the assumptions a. Lets see if we can refute the estimate i.e. come up with a reason not to trust it
• Can you please provide a reference as to the "steps" to which you are referring? Commented Jul 5, 2022 at 12:06
• microsoft.com/en-us/research/blog/… @AdrianKeister Commented Jul 5, 2022 at 12:42
• It would be good if you could type up at least a summary of those steps, and add it to the body of your question. Commented Jul 5, 2022 at 14:18
• @AdrianKeister i've added the 4 steps to best of how i understand it Commented Jul 5, 2022 at 15:32