> For the complete documentation index, see [llms.txt](https://akm5630.gitbook.io/understanding-causal-inference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://akm5630.gitbook.io/understanding-causal-inference/causal-graphs/do-calculus.md).

# do-calculus

Interventions and counterfactuals are represented by **do(x)**, which simulate the physical interventions by deleting certain functions from the model and replacing them with constant (X=x), while keeping the rest of the model unchanged.

When we intervene on a variable, we have a constant variable for the treatment

With observational data, we can build the causal Graph on the left-hand side and to better understand the causal relationships we do an intervention on X and observe the effects of the intervention. The right graph helps us answer what would happen if we do an intervention

Interventions:

![Graphical Representaion of Intervention](https://1457788420-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFIP0MKlNdCTGB9r7S-%2Fsync%2F71479ff4342cb5bf36b47e0e8d746610dbfccc36.png?generation=1598053526853935\&alt=media)

In the figure above,

$$
Left: Title:Length \leftarrow Author's: Skill \\
Right: Title:Length \leftarrow Yes(Constant)
$$

Interventional Distritution:

$$
P(CTR, Authors Skill :| : do(X=Yes)
$$
