{'fraction_non_alphanumeric': 0.028913745081568593, 'fraction_numerical': 0.005371590255979487, 'mean_word_length': 4.354995265151516, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Reconciling Causality and Statistics

Statisticians have warned us since the early days of their discipline that experimental correlation between two observations by no means implies the existence of a causal relation. The question about what clues exist in observational data that could informs us about the existence of such causal relations is nevertheless more that legitimate. It lies actually at the root of any scientific endeavor. For decades however the only accepted method among statisticians to elucidate causal relationships was the so called Randomized Controlled Trial. Besides this notorious exception causality questions remained largely taboo for many. One reason for this state of affairs was the lack of an appropriate mathematical framework to formulate such questions in an unambiguous way. Fortunately thinks have changed these last years with the advent of the so called Causality Revolution initiated by Judea Pearl and coworkers. The aim of this pedagogical paper is to present their ideas and methods in a compact and self-contained fashion with concrete business examples as illustrations.


A Stormy Relationship
Consider the following three pairs of concomitant events: "the sun rises shortly after the first crow of the rooster", "the number of visit to some website tends to increase when an ad banner is shown in some appropriate location" and "the rate of skin cancer parallels the sale of ice creams on the French Riviera". While common sense dictates that there is little chance to reduce cancer by limiting ice cream sales or to speed up sunrise by tickling so it crows earlier, it is not unlikely though that trying to optimize the position of an ad banner might indeed be worth the effort. So it seems our intuition about how the world works tells us something about this concomitant events which goes beyond what mere statistics can describe. Statistics indeed only deals with correlation, meaning it quantifies how likely it is that an event B will occur assuming that we have observed another event A. It tells us nothing however about what happens if we act on a system and it even provides no means to describe what an intervention on a system is. The conclusion is thus straightforward: in general we need more than just probability and statistics to express and answer causality questions. The method of Randomized Controlled Trials (RCT) which entirely rests on statistic analysis and is widely recognized as the gold standard for clinical trial is one noteworthy exception that we shall have more to say about later on.
The innate inability of plain statistics to properly deal with causality in all its generality has only been recognized at the turn of this century [1]. Before that, a controversy had been going on for nearly one century. We won't enter these lengthy debates because fortunately nowadays there is no reason for controversy anymore! The pioneering work of Judea Pearl [1,2,3], a philosopher and statistician, put a definitive end to these quarrels by providing a mathematically sound framework that allows both to formulate causality questions in an unambiguous way and to answer them systematically whenever this is possible [3]. Judea Pearl is largely responsible for a complete reshaping of the causality debate, which has since then been termed the Causal Revolution. For this and his other outstanding achievements on causal reasoning in AI he was awarded the Turing prize in 2011.
Before we dive into the subtleties of Judea Pearl conceptions of causality, let's acknowledge that many data scientist who use supervised machine learning as their everyday tool never bother about causality issues. As a matter of fact they could could run into serious trouble because of this but it is nevertheless a legitimate attitude in two common situations that we briefly mention.
• First, it could be that simply learning a correlation between to two type of events has value in its own right. An image detection system for instance associates a probability of presence of an object within a picture. The important point is that any subsequent action driven by such a correlation based prediction should no retro-act in any way on the measure variables.
• Second, there are other situations where a passive observation of some feature X has indeed the same effect (on predicting a target variable Y ) as an intervention where we prescribe the value of that feature. Imagine for instance that X is the rotation speed of an air pump and Y is the pressure it maintains in a room. Once we have learned the relation between X and Y by passive observations, we will be able to predict the air pressure when we set the speed of the pump. Intuitively, the causal relationship from X to Y is direct and unperturbed. We will precisely characterize theses situations in section 2.4 when we describe the do Calculus.
Where Judea Pearl's approach really shines is in less obvious situations where we would like to infer the effect of setting X = x on the value of Y in the presence of a whole network of causal relationships that involves other variables Z. These variables are often called concomitants [4] and may be observed or not. In its simplest version the root of the difficulty in answering causal questions is depicted in figure 1 which illustrates the notion of a confounder Z. In intuitive terms a confounder Z is a variable that could potentially hinder the identification of a causal relationship between two other variables X and Y by being a cause of both. An observed change in the value of Y that results from a change of X could just as well be attributed to a change of Z. Yet, if Figure 1: Suppose X designates the choice to administer a medicine to a patient, Y is the state of health of that patient and Z his or her age. If a doctor chooses to whom he or she administers the treatment, then the age Z could become a confounder impacting both the choice X of the treatment and the health state Y .
had access to the values of the confounder Z, we could perhaps adjust for its effect and thus extract the desired effect of X on Y . The procedure for doing this, when it is possible, is well known to statisticians and goes under the name "controlling for Z". In a nutshell, what Pearl's machinery achieves is a vast generalization of this controlling procedure: Pearl's graphic and algebraic tools allow the identification of situations in which we may possibly disambiguate a causal relationship between two variables X and Y . Wherever this is possible these tools provide explicit formulas for computing the effect on a variable Y of an intervention that prescribes the value x of another variable X. These formulas merge two kinds of information. First, they uses the values of some concomitants Z which are just observed. Second, they leverage a causal graph G which encapsulates our knowledge of the causal relationships between the variables within a system of interest.
Later we shall consider still another way to interpret Pearl's work namely as a vast generalization of RCT's.
Pearl's conceptual and computational tools have several important merits: • From a practical point of view, they allow to anticipate the effect of an intervention on a system without actually having to perform any action on it. This is obviously extremely useful in situations where we cannot afford to act on a system, whether for ethical or financial reasons.
• Still from a practical point of view, they all to integrate causal prior knowledge about a system with measurements in a fully consistent manner.
• From conceptual stand point, they provide clear definitions of what is meant by a causal influence and by an intervention, as we shall see shortly.
This settles the secular causality controversy and reconciles statistics with causality.
The sequel of this article is organized as follows. Section 2 introduces the main concepts and tools defined by Pearl and coworkers. After a brief review of Bayesian networks which allows us to introduce the notion of d-separation, we define what a functional causal model is and describe the extent to which it can be inferred from data. We define the notions of intervention and of identifiabiliy. We explain the graphical back-door and front-door criteria that allow to identify causal effects in some specific circumstances. At last we introduce the rules of the do-calculus that are even more flexible. Section 3 discusses various business examples as illustrations. The last section offers some concluding remarks and tries to explain why in our opinion these tools still remain little known within the data scientist community at large.

The Causal Revolution in a Nutshell
In this section we will present the main definitions and mathematical results underpinning the Causal Revolution. We define what causal relationships are, how and when we can identify them from data. Then we define what an intervention is and describe the graphical and algebraic tools which allow to identify situations where we can compute the consequences of an intervention using data collected from pure observation. For proofs we refer to Pearl's book on Causality [2] and to the original papers [3].

Bayesian Networks Recap
The tools we shall present in the following subsections rely heavily on a graphical method called the d-separation criterion that allows answering general independence questions among groups of random variables (r.v). These tools were pioneered by Pearl who developed the concept of a Bayesian Network.
There are many good textbooks on this topic [9] but we provide a brief introduction both to introduce notations and to make the presentation reasonably self-contained. Readers familiar with this material are invited to jump to subsection 2.2.
We use upper case letters like X, Y or Z to designate r.v. and boldface upper case to denote sequences (or sets) of r.v X = (X 1 , X 2 , ..., X m ), with lower indices to denote the components of X. For simplicity we shall assume that each component takes only a finite number of values. The corresponding realizations of these r.v. will be denoted with corresponding lower case letters x = (x 1 , x 2 , ..., x m ).
The first step is to associate a graph G to a probability distribution p(x) = p(x 1 , x 2 , ..., x m ). Iterating the product rule for conditional probabilities we have: where the conditioning set for j = 1 is empty. Now if X j is only conditioned on a subset of X 1 , ..., X j−1 , let's denote the minimal such subset by PA j , the parents of X j , so that we can write: A natural representation of (2) is to use a Bayesian network which is a directed acyclic graph (DAG) where each node of the graph corresponds to a variable X j and a directed link points from each member of PA j towards X j as figure 2 shows. We say that the probability distribution p and the graph G are compatible. Note also that according to (1) the DAG associated to a generic distribution p with no specific factorization properties is a fully connected graph. Hence all information in a DAG is really contained it the missing links.
For a given order of the r.v. this graph G is unique. However, if we had chosen another order for the r.v. in p we would have obtained another graph G . Therefore, the natural question that arises is to determine when two DAG G and G observationally equivalent. More precisely we want to ask whether any probability distribution p which is compatible with G is also compatible with G . The following can be shown [2]: Theorem 1 (observationnal equivalence). Two DAG's are observationally equivalent if two conditions are met. First the graphs that result from stripping of the arrows on the edges of G and G (their skeletons) should be the same. Second, G and G should have the same ν-structures, which are nodes with converging arrows whose tails are not connected by an arrow.
Let X, Y and Z be three groups of r.v. whose joint distribution is p. Of particular interest is the question whether X is independent of Y conditionally on observing Z, that is whether or, equivalently, whether p(x| y, z) = p(x|z).
When the answer is yes, we denote this by X ⊥ ⊥ Y |Z. The d-separation theorem below allows us to answer this question graphically by looking at the graph G associated to p. For this we need the following graphical concept: Definition 1 (d-separation). A path γ in a DAG G (a sequence of consecutive edges oriented in any direction) is said to be blocked by a set of nodes Z if and only if one of the following two conditions is met: 2. γ contains a collider i → m ← j such that neither m nor any of its descendants (as defined by the arrows on the edges in G) belongs to Z.
A set Z is said to d-separate X from Y whenever Z blocks every path from a node in X to a node in Y.

Figure 3:
Observed nodes are depicted as filled circles. In (a) the path from X to Y is neither blocked by Z2, because it is an observed descendant of the collider Z1, nor is it by Z3 which is an unobserved fork. In (b) the path from X to Y is blocked by Z3 because it is an observed fork.
We can now formulate the d-separation criterion which relate the factorization properties of p described by a compatible DAG G and the independence relationships they imply: Theorem 2 (d-separation theorem). Let X, Y, Z be three disjoint sets of nodes in a DAG G compatible with a distribution p. Then the corresponding r.v. distributed according to p satisfy X ⊥ ⊥ Y | Z whenever X and Y are d-separated by Z.
The converse is true as well. An important consequence from theorem 2 is that the set of conditional independence among r.v. is determined by the topology of G only, while the ordering of the r.v. plays no role. When we consider the d-separation criterion as a graphical test on the nodes of a DAG G we shall write (X ⊥ ⊥ Y | Z) G . Using (4) we can rewrite theorem 2 compactly as We insist that that so far there has been no discussion of causality, only independence questions were examined. There is however an easy mnemonic for the d-separation criterion if we momentarily allow ourselves to associate a causal meaning to the arrows in G. Indeed, if we fix the value of the middle node m in a chain or a fork we block the information flow between the two end nodes i and j which thus become independent. If, on the contrary, we observe the value of a collider node m, or of some of its descendants, we actually observe a common consequence of i and j. Knowing both i and m for example will thus tell us something about j, which thus opens the information flow. This independence analysis based on d-separation prefigures the genuine causal analysis we develop in the next subsections.

Structural Equations
A conditional probability p(y|x) tells us how the probability of seeing Y = y is affected by having observed that X = x. It tells us nothing however about what happens when we prescribe the value of X. To answer that question we need more information than p contains, namely information about how the probabilistic model p will change under an external intervention. This is precisely what a functional causal model M does. It is defined as a set of functional relationships which describe how each r.v. X j is determined as a function of the others and of some noisy disturbances. It thus explains how the data is generated. Using the notation PA j to denote the set of r.v. that directly influence X j , a causal model is then defined as a set of structural equations: where the f j 's are deterministic functions of both the parents variables PA j and some noisy disturbance j . An important point is that the j should be independent. In other words each relation is assumed to be disturbed by a single random perturbation. If a perturbation were to affect several r.v. simultaneously, we should promote it to an unobserved X j with a structural equation describing its influence on other variables. A causal graph G can be associated to a causal model M as shown in figure 4 which also defines the notion of a confounding arc. The probability distribution p on a set of r.v. X is be completely specified by the model M which comprises the set of deterministic functions f j and the distributions of the disturbances j . In practice these will however remain unspecified. Beware that the links in figure 2 represent conditional dependencies p(x j |pa j ) while they represent deterministic dependencies x j = f j (pa j , j ) in Assume that we are given a causal graph G associated to causal model M which generates a probability distribution p. What independence relationships hold for this p ? The answer is as simple as we could have dreamed: they are precisely those determined by the d-separation criterion applied to G. This follows from the fact that p is compatible with G in the Bayesian network sense and from the d-separation theorem 1 .

The do-Operator
An intervention on a system described by a causal model is an alteration of the structural equations (6) where some relationships are replaced by others. In the simplest case were we fix the value of say X i to a this amounts to replacing the equation The corresponding causal graph of the modified model is thus obtained from G by removing all links connecting the nodes to X i to their parents PA i as figure 5 shows. After the intervention, the probability distribution p(x) is replaced by a new one which we denote by p(x| do(x i = a)). This defines the do-operator. Using this definition and the factorization (1) for the distribution p we can also express the post intervention distribution as a truncated factorization: In general p(x| do(x i = a)) is of course different from the classical conditional p(x| x i = a). One trivial case where both expressions are indeed identical is 1 To see this note that (6) implies that the joint distribution p(x 1 , ..., xn, 1 , ..., n) on the original r.v. and on the disturbances is compatible, in the Bayesian network sense, with the graph G constructed from G by adding to it all nodes corresponding to the disturbances j together with their links directed towards the nodes X j . The same paths γ in G which separate some groups of variables in G also separate them in G . The statement thus directly follows from the d-separation theorem 2 applied to G . when X i has no parents (PA i = ∅). The general question of when an action on a variable X has the same consequence on another variable Y as an observation will be answered precisely when we present the do-calculus in section 2.4.
To get more intuition about the do-operator let's compute the effect of an intervention do(x i = a) on a single variable Y which is different from both X i and its parents PA i . Plugging into (7) for x i = a and marginalizing over all variables except on y and on x i we obtain This conditioning and weighting operation (9) on the variables PA i to compute p(y| do(x i = a)) is known as adjusting for the direct causes of X i . This wording comes from the fact that the ordinary conditioning p(y|x i ) is obtained by simply marginalizing p(y|x i , pa i ) over pa i . The weights p(pa i ) thus appear as correcting factors which are necessary for computing the intervention p(y| do(x i )).
When the parents PA i of a manipulated variable X i are all measurable then (7) shows that the effect of an intervention can be computed from passive observations as these determine p(x) and hence p(x i | pa i ). In practice though, we could rather use (9) and determine the prior p(pa i ) and the conditional p(y|x i = a, pa i ) using machine learning for instance.
The interesting question then is whether we can compute the effect of an intervention when this is not the case, that is when some of the r.v. in PA i are not measurable? More generally, the question that naturally arises is then the following. Given a causal graph G and a subset Z of observable concomitants can we express p(y| do(x = a)) in terms of the distribution on the observed variables Z, X and Y only? When this is the case we shall say that the causal effect of X on Y is identifiable. Lets compactly summarize this concept of identifiability [11].
Passive observation of the variables X and Y and a group Z observable concomitants informs us on their joint distribution p(x, y, z), as long as we have enough data of course. However, the effect p(y|do(x)) on Y of an intervention on X is only encoded in the causal model M which generates this p, but not in p itself! The problem we thus face is that two different causal models M 1 and M 2 could generate the same p. To predict the effect of an intervention we thus need more information than is contained in p. The causal graph G associated to the causal model M can sometimes provide this missing information, without the need for a complete knowledge of the causal model M . When this is the case, we say that the intervention p(y|do(x)) is identifiable from G.
In subsections 2.3 and 2.4 we shall describe graphical and symbolic tools to answer these questions.

Interpreting Randomized Control Trials with the do-Operator
Lets quickly make contact between the definition (7) of the do operator and the Randomized Control Trial (RCT) procedure. Consider a situation where we would like to assess the effectiveness of a treatment on a group of patients. Say that X = 1 means we apply the treatment and X = 0 we don't and that Y represents the resulting impact of their health ("improved", "stable", "deteriorated"). Patients are characterized by features like Z 1 =age, Z 2 =gender and Z 3 ="is diabetic" which could also influence their health state. The corresponding causal diagram is shown in figure 6 (a). For this diagram we would like to compute p(y|do(x)). If the experimenter chooses which patient she will administer the treatment to, she could inadvertently transform the features Z into confounders that will simultaneously impact the decision X to administer the treatment and the health Y of the patient. This is represented in figure 6 (b). The RCT procedure subordinates the decision to administer the treatment to the result of flipping a perfect coin C whose outcome is neither influenced by Z nor has any direct influence on Y . It thus cuts the same incoming links to the instrumented variable X as those which had to be removed to define p(y| do(x)) in (7). In such a circumstance p(y|x, c) = p(y|x), because X blocks the path between C and Y . Therefore (9) implies that p(y| do(x)) = p(y|x). In other words, when using the RCT procedure observing X has the same effect on predicting Y as prescribing the value of X.
Can we Infer a Causal Graph from Raw Data?
In sections 2.3 and 2.4 we shall describe tools to answer the identifiability question above assuming that we are given a causal graph G and that some of its variables Z can be measured. But what if we have no causal graph G available in the first place? Can we infer it directly from data? This is secular question which has sparked a lot of controversy. In every day life we all use some clues to identify causal relationship, the most important one being the assumption that a cause always precedes its effects. Analyzing these temporal aspects of causality would however quickly drive us into discussing the origin of the asymmetry between the past and the future and other foundational issues in physics [8]. As interesting as they are, we will not address these issues here, because this would take us too far away from our subject of analyzing the patterns of data which can identity functional causal relations as defined by structural equations (6). We refer to [1] for a broader panorama of causality.
The common wisdom among statisticians has long been that this identifying a causal model from data is plain impossible. And, indeed, in general it is impossible as we shall confirm. The interesting point though is that contrary to this common belief there are practically relevant situations where this identification of G is possible, at least in part. Again, a thorough discussion of these matters would be out of the scope for this short paper. We therefore limit ourselves to summarizing one significant result in [2] which shows that, assuming a specific interpretation of Occam's razor, an equivalence class of causal graphs G can be inferred when all variables X in G are measurable.
So lets assume that the variables X are all measurable and that their probability distribution is p(x). With no further assumptions there could exist many different causal graphs compatible with p. Therefore we need to put further restrictions on the causal models we are trying to infer. We shall indeed put two such restrictions. The first, minimality, conforms with standard scientific practice and restricts our search to the simplest possible causal graphs G only, the second, stability, will be a condition on the causal model M itself: 1. We say that a graph G 1 is preferable to another graph G 2 whenever any probability distribution p compatible with G 1 is also compatible with G 2 . In other words, G 2 is more expressive than G 1 . Among all graphs compatible with p we shall look for a minimal graph, that is one which is preferable to all others in that set [2].
2. Given causal model M which generates a distribution p compatible with a DAG G, we have to make sure that p has no accidental independence relationships. More formally, if θ are the values of the parameters of the causal model M which defines p through (6), we demand that no independence relationships satisfied by p (which can be read-off from G) gets destroyed when we change θ to some other value θ . When this holds we say that the causal model generates a stable distribution [2].
Theorem 1 on observational equivalence then implies the following: Theorem 3. If a distribution p is generated by a stable causal model M then, up to observational equivalence, there is a unique minimal causal graph G compatible with p.
A class of observationally equivalent graphs can be represent graphically by a representation called a pattern [2]. A pattern is a partially directed DAG where some edges are directed while others are not. The directed ones correspond to edges that are common to all members of the pattern, while the undirected one could be oriented in either direction. Pearl and Verma [6,7] developed an algorithm, the IC algorithm (for Inferred Causality) which constructs the pattern associated to any stable distribution p on a set of observable variables. We refer to [2] for a detailed description of the IC algorithm and for various extensions of IC to causal models with latent variables. Other interesting results obtained by Pearl pertain to the falsifiability of some assumptions in a causal graph [12,13].

Answering Causality Questions with Graphs
As we have seen earlier, the causal effect p(y|do(x) is identifiable as soon as the parents PA(X) of the cause X are measurable. Formula (9) answers the question by showing how we should adjust the conditionals p(y|x, pa) according to the prior probabilities p(pa) of the direct causes. In this subsection we describe two simple graphical criteria which answer the question in more general cases.

The Back-Door Criterion
The following holds [2,3]: Theorem 4. The effect p(y|do(x)) on Y of an intervention on X is identifiable from the causal graph G when a group Z of observable r.v. satisfy the following two conditions: In other words X should have no influence on any of the variables in Z.

2.
The group of variables Z should block any path γ between X and Y in G that has an incoming arrow into X (back-door paths).
When both conditions are verified we have the reduction: The above reduction formula can be considered as a generalization of the basic adjustment formula (9). Both conditions in theorem 4 can be easily tested systematically. Various sets Z can be tried to optimize the cost of their measurement. Figure 7: An example of a group of r.v. Z = (Z3, Z4) that make the intervention of X on Y identifiable. Indeed Z3 is a measured chain that blocks γ1 and γ2 while Z4 blocks γ3 as a measured chain and γ4 as a measured fork. On the other hand Z = (Z4) does not because the path γ2 remains unblocked by Z4 which is a measured collider. Figure 7 gives an example of a group Z = (Z 3 , Z 4 ) which makes the causal influence of X on Y identifiable while Z = (Z 4 ) does not.

The Front-Door Criterion
Condition 1 in theorem 4 requires that the cause X should not affect the observable variables Z. Fortunately, another criterion, namely the Front-Door criterion allows us to prove that the effect of X on Y is nevertheless identifiable in other some cases. Consider the situation depicted in figure 8 obtained by amalgamating Z 1 to Z 5 in figure 7 into a group U which we assume to be unobserved then renaming Z 6 as Z and denoting Z = (Z). This variable Z is under direct influence of X and does not block the path X → U → Y . Therefore Z meet neither of the two back-door criteria. Note that the following three conditions hold in the example of figure 8: 1. The variables Z block the directed path from X to Y .
2. All back-door paths from X to Z are blocked. Indeed in the example the path X ← U → Y ← Z is blocked at Y which is an unconditioned collider.
3. All back-door paths from Z to Y are blocked by X. Indeed in the example the path Z ← X ← U → Y is blocked by X which is a conditioned chain.
When these three conditions are met we say that the variables Z satisfie the frond-door criterion relative to the causal effect of X on Y . The following then holds: Theorem 5. When the variables Z satisfy the front-door criterion for the effect of a variable X on a variable Y , then this effect is identifiable and is given by Notice that the variables u do not appear in the above reduction formula as should be the case for unmeasured variables. This second graphical tool thus complements our arsenal for discovering identifiable causal graphs. We will prove it in subsection 2.4 as an example application of the do calculus.

Answering Causality Questions with the Do-Calculus
Graphical tools are nice because they allow us to identify causal relationships without having to do any math. Unfortunately, this is not always possible. In this subsection we present three simple algebraic rules [3] that can be combined to transform expressions containing both ordinary conditioning .|x and interventions .|do(x) into equivalent expressions. These rules are the rule of the do Calculus. Our goal of course is to find an appropriate sequence of these transformation to eventually get rid of all .|do(x) in order to prove that an intervention is identifiable.
Assume we are given four disjoint subsets of variables X, Y, Z and W in a causal graph G. Let us denote by G X and G X the graphs obtained from G by respectively deleting the links incoming into X and outgoing from X. To represent simultaneous removal of incoming and outgoing links we use a notation like G XZ . At last, Z(W) will denote the set of Z-nodes which are not ancestors of any W -nodes in G X .
In the 3 rules below, X always enters as a do(X) intervention, while W occurs as a passive observation and Y as the consequences we would like to predict. We also define a mixed conditional probability on Y given an intervention on X and an observation of W: Theorem 6. (do Calculus rules) The following holds: • Rule 1 [removing an observation] p(y|do(x), z, w)) = p(y|do(x), w)) when (Y ⊥ ⊥ Z| X, W) G X .
• Rule 3 [replacing an intervention with an observation] These rules generalize the basic d-separation rule (5) which recall here for comparison: In fact (13) is a special case of rule 1 when X = ∅. In the other way around, we can easily understand rule 1 as a consequence of (13) when we remember that an intervention do(x) simply removes from G all links entering into X. What results is precisely the graph G X used in rule 1. Rules 2 and 3 use sub-graphs of G X . Rule 3 answers the important question of whether an intervention on the variable Z has the same effect as its passive observation. The simplest case where rule 3 applies is when G is the two-node graph Z → Y, describing a direct causal effect, for which G Z reduces to two disconnected nodes thus trivially ensuring Z ⊥ ⊥ Y.
An Example -Deriving the Front-Door formula As an example of an application of the do Calculus let's see how we can use them to derive the front door rule (11), referring to figure 9 for the various subgraphs that we shall need to examine. Lets go through this step by step following [3].
• First, using the sum rule and definition (12), the desired quantity can be written as: p(y| do(x)) = z p(y, z| do(x)) = z p(y| z, do(x)) p(z| do(x)). (14) • Now we can apply rule 3 to remove the do operator on x in the second factor of (14) to write p(z| do(x)) = p(z|x) because (Z ⊥ ⊥ X) G X as Y is an unconditionned collider in G X .
• Lets now focus on the factor p(y| z, do(x)) in (14). Using rule 3 again on G XZ which satisfies (Y ⊥ ⊥ Z|X) G XZ , because there is no path at all between Y and Z in G XZ , we can replace z by do(z) • Rule 2 now allows deleting the do(x) action from the right member of (16) because (Y ⊥ ⊥ X| Z) G XZ , therefore p(y| do(z), do(x)) = p(y| do(z)).
• Lets thus compute p(y| do(z)). Apply definition (12) on mixed conditioning and marginalizing over x We can apply rule 2 which implies p(x|do(z)) = p(x) because (X ⊥ ⊥ Z) G Z , the path between X and Z being blocked by Y which is an unconditionned collider. We can also apply rule 3 which implies p(y|x, do(z)) = p(y|x, z) because (Y ⊥ ⊥ Z|X) G Z because X is an observed fork which blocks the path between Y and Z. Altogether (18) and these last two results imply Combining (16), (17) and (19), we get • Eventually, combining (14), (15) and (20), we get the desired result which is the same as the front door rule (11).
As this example shows, the do Calculus allows for elegant derivations of identifiability cases but by no means is it obvious! On the contrary, it requires a fair amount of intuition and practice.

Strengths and Limitations of the Do Calculus
The rules of the do Calculus have been shown to be complete [10] in the sense that, if an intervention is identifiable at all, then there exists indeed a sequence of these 3 rules that will produce an expression free of any do operator. Unfortunately, there is no general rule for deciding whether an expression is identifiable or not [2]. In fact one the main difficulty in applying the do calculus is that there is no general guiding principle that tells us which rule to apply at each step. Luckily, courageous people have been compiling both identifiable and non identifiable causal diagrams that we can reuse. Figure 10 shows examples which are identifiable. Figure 10: Examples of simple causal graphs where the effect of X on Y is identifiable.
All graphs are maximal.
One important remark is that we can generate many more identifiable diagrams from these as soon as we realize the following two facts: Figure 11: Examples of simple causal graphs where the effect of X on Y is not identifiable.
• Adding an edge to any causal diagram G can only decrease the chances that the new graph will be identifiable. This is a direct consequence of the fact that all rules we have been discussing, whether graphical or algebraic, ultimately amount to testing whether some paths within subsets of G are blocked. Adding an edge obviously increases the number of paths to test and thus decreases the chances that they will all be blocked.
• Adding an observed variable on an edge of a graph has the opposite effect. It can only increase the chances that the new graph will be identifiable because it adds an observed chain which is an additional blocking point that can only enhance the chances of d-separation between groups or variables.
All diagrams shown in figure 10 are maximal in the sense that adding a single edge to any of them will destroy their identifiability. They are thus the most useful graph to list. Figure 11 shows examples which are not identifiable.

Causal Analysis of Simple Business Examples
Examples of causal analysis are often drawn from fields like agronomy, social sciences or economics which rely on complex causal models. We rather chose to illustrate how causal analysis naturally occurs in even the most common business examples.

Assessing the Effectiveness of a Loyalty Campaign
The level of satisfaction of customers with a service can often be judged from their observable behavior such as the number of visits to a website or the time spent for using that service. This information can help the service provider to identify early signs that some customers intend to leave the service. Marketing can then decide to launch a loyalty campaign that aims at retaining the customers whose faith wavers. These campaigns of course have a cost and its therefore important to be able to assess their effectiveness. Does a loyalty campaign of a certain type really have an impact on the attrition rate?
To answer this question let's formalize the problem. First, let U be a binary variable that corresponds to the intention of the customer to leave the service or not, before being targeted by any loyalty campaign. This, of course, will be an unmeasured variable. This initial intention U certainly has an impact on the behavior of the customer that can be measured, let's call this Z. This behavior Z will determine in turn the decision by the service provider whether this customer should be targeted by a loyalty campaign. Let's call this decision X. Eventually, the final decision of the customer to cancel the service is again a binary variable, call it Y . This final decision of the customer is certainly dependent both on his initial intention U and whether he has been targeted or not by the campaign (X). So, formally, our question translates as : can we identify the causal impact of being target X on the final decision Y when we measure Z ? Figure 12 shows the corresponding causal diagram. This diagram is nothing but the diagram (c) from the list of identifiable diagrams in figure 10 with the direct link from Z to Y removed. Therefore it is identifiable.
On the other hand Z satisfies the two condition of the back-door criterion in theorem 4. It is not a descendant of X and it blocks the back-door path between X and Y because it is an observed chain. Thus (10) gives the explicit reduction of the causal impact of X on Y into observable quantities.

Claim Provisioning by an Insurance Company
When a claim is reported by an insured, an insurer usually sets aside a certain amount. This is especially true when personal injury is reported. The final compensation will obviously depend on the extent of the damage. But, as insurers have become aware, this compensation will also depend on the initial provisioning. The aim of causal analysis here is to determine the impact of this provisioning on the final compensation granted to the insured.
Let U be the complete claim characterization. Its value is unknown at the time of reporting but it will determine both the declaration Z by the insured and the final compensation Y granted after investigations. The initial evaluation Z is what directly determines the expert's provisioning X which in turns impacts the final compensation Y . The causal graph is thus exactly the same as in figure  12 and, as a consequence, the same back-door reduction formula (10) applies here as well.

Impact of Sales Force Training on Turnover
To improve the efficiency of its sales teams, a company can invest in their training. This has an easily measurable cost X which it is hoped will help to increase the turnover Y by increasing sales. As such, the causal relationship would be direct and thus trivially identifiable. However there is at least one unmeasured confounding variable which spoils this identifiability, namely the competitive pressure U . Indeed a strong competitive pressure U will encourage investment X in a training effort but, simultaneously, it will also impact the turnover Y . Fortunately though, we can restore identifiability if we can find a measurable "deconfounding" variable Z within the causal chain from X to Y . The skills and motivation of salespeople induced by these training and measured by surveys or polls could play this role. The causal graph is depicted in figure 13, it is the same as in figure 8 which was the basic graph for which the front-door rule applies. We can thus use the front-door reduction formula (11).

Impact of Pricing on Sales
The turnover Y for a company on a product is a function of the price X of the item and its sales volume Z. For instance Y could be proportional to X ·Z. Now the price X impacts both the turnover Y but also the sales volume Z, because lower prices generally increasing the volume. As such, the corresponding causal graph would be identifiable because it corresponds to graph (b) from in the list of identifiable graphs from figure 10 with the confounding link between Y and Z removed. Unfortunately the competition pressure U which is an unknown variables is a confounder which impacts both the price X and the sales volume Z rendering the graph shown in figure 14 unidentifiable as it is the same as the graph (c) in the list of unidentifiable graphs in figure 11.

Stuff Worth Knowing for Data Scientists?
Once one fully grasps the importance of the paradigm shift implied by the Causal Revolution, a question will occur to many newcomers. Why hasn't anyone ever told me about this while I as learning statistics, probability or machine learning? How come as a data scientist I've never heard of the do Calculus? Is it really useful in practice? In what area? There are probably several answers to this. We list some of them below.
• The first reason we see is of cultural nature. This has been well analyzed in [5] for instance. In reality the word "causality" has long remained almost taboo in the statistical community which remained faithful to the classical associationist point of view of the founders of the discipline in the last century like Pearson and Fisher. They considered that there can be no evidence about causation within data (except for RCT). It took all the perseverance and scientific stature of Judea Pearl to reverse people's minds on the relationship between causality and statistics. Apparently, this paradigm shift has yet to infuse the newer data science community at large.
• The graphical and algebraic machinery we presented in section 2 obviously only makes sense when the causal graph G is non trivial. This explains why fields like social sciences, economics, medicine or agronomy, which have all developed a rich set of causal models, have benefited most from this renewed perspective on causality. For an elementary causal relationship like G = X → Y there is however no difference between the passive observation of the cause X and an intervention on it. Many use cases worked out by data scientist fall into this category, perhaps in some cases just by chance. But without such luck, neglecting the difference between observation and intervention could lead to predictions errors. We presented a number of examples of such cases in section 3.
• While the graphical rules are rather accessible, the judicious application of the do Calculus to new causal diagrams undoubtedly requires skill and intuition. As was suggested in [5], the do Calculus could certainly benefit from a cookbook for those who cannot afford here to become experts.
• One last reason, a more subjective one, has to do with Pearl's writing style [2] which, at times lacks perhaps a bit of conciseness. This can certainly discourage many readers, even those those who have all prerequisites in statistics and probability theory. The sheer number of historical anecdotes, examples and comments that Pearl gratifies his readers with sometimes runs counter to a clear presentation of the key mathematical facts. The Causality Revolution probably still lacks a concise textbook like presentation of the subject.
The founding fathers of statistics were certainly right when they insisted that, in general, we cannot infer causal relations from mere data. But in the enthusiasm of their nascent discipline, many of their disciples and epigones have somehow become overzealous. They neglected that in most cases we have more information available than just data! We have some prior knowledge of how the world works! Perhaps not a full-fledged causal model, but at least a partial causal graph. What Pearl tells us is that in some favorable conditions (that we discussed in section 2), we can merge those two pieces of knowledge in order to predict the effect of an intervention on a system. If it turns out that these predictions do not match observations, we just have to work harder and think of some better model. But, in any case, we have to give up the hope of automating the discovery of how the world works from observation only. Nature won't reveal its charms in front of some dumb algorithm. She is a demanding mistress and expects us to engage in a thoughtful conversation with her, as curious and creative minds. So, let's rejoice, because this is why science is so much fun!