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.

*

*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

*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

*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

*Refutation: validate the assumptions
a.  Lets see if we can refute the estimate i.e. come up with a reason not to trust it


The "identification" step refers to identifying an estimator for the quantity of interest and whether or not it can be computed given the causal model. For example, if there are unknown confounders, or undirected edges in a causal graph, an effect may not be identifiable.
A counterfactual is estimated by changing the value of a given set of nodes, leaving the rest in their "factual" state, and re-computing the state of the system. It is similar to an intervention, with the important difference that we are interested in the alternative state of the system, rather than only the change due to the intervention. This requires knowledge about the values of the other system variables that are not intervened upon.
