Sufficient Causes

A walkthrough of Pearl. J Causal Infer 2019; 20190026.

This paper considers the example of Oxygen, Matches, and Fire in The Book of Why:

“A fire broke out after someone struck a match, and the question is ‘What caused the fire, striking the match or the presence of oxygen in the room?’ Note that both factors are equally necessary, since the fire would not have occurred absent one of them. So, from a purely logical point of view, the two factors are equally responsible for the fire. Why, then, do we consider lighting the match a more reasonable explanation of the fire than the presence of oxygen”

Pearl then introduces the idea of sufficiency: that striking a match is much more likely to be a sufficient condition for the fire than the presence of oxygen. 

Let F denote the presence (F=1) or absence (F=1) of a fire, and let M denote whether a match was struck (M=1) or not (M=0). The probability that the match was a sufficient condition can be represented as

PS[M] = P[F[M=1]=1|M=0, F=0].

Here, F[M=1]=1 denotes a counterfactual. That is, the event that F=1 had only M=1. Note, however, that this probability is conditioned on observing a situation where the match was not struck. Thus, Eq. 1 quantifies the probability that a fire would occur had a match instead been struck. 

Now let O be the condition that oxygen is present (O=1) or not (O=0). 

Pearl constructs the following graphical model for the situation:

G = Graph[{"(Subscript[U, 1])"\[DirectedEdge]"O", "(Subscript[U, 2])"\[DirectedEdge]"M", "O"\[DirectedEdge]"F", "M"\[DirectedEdge]"F"}];
GraphPlot[G, 
			VertexCoordinates->{
				"(Subscript[U, 1])"->{0, 1}, 
				"(Subscript[U, 2])"->{1, 1},
				"O"->{0, 0.5},
				"M"->{1, 0.5}, 
				"F"->{0.5, 0}},
			EdgeLabels->{"(Subscript[U, 1])"\[DirectedEdge]"O" -> "(Subscript[p, o])", "(Subscript[U, 2])"\[DirectedEdge]"M" -> "(Subscript[p, m])"},
			VertexSize->0.3,
			PlotTheme->"IndexLabeled",
			ImageSize->175]

Above, the (Subscript[U, 1]) and (Subscript[U, 2]) nodes are noise that generate random variables M and O with probabilities P[M=1]=(Subscript[p, m]) and P[O=1]=(Subscript[p, o]), respectively, where (Subscript[p, o])>>(Subscript[p, m]). These distributions are Bernoulli:

(Subscript[d, O])=BinomialDistribution[1, (Subscript[p, o])];
(Subscript[d, M])=BinomialDistribution[1, (Subscript[p, m])];

We have that F=(KroneckerDeltaSeq[M,O]), where (KroneckerDeltaSeq[x,y]) is Kronecker’s delta. The joint distribution over M ∧ O is as follows:

(Subscript[P, OM])[o_, m_]:=Probability[
(O==o) ∧(M==m), {O\[Distributed](Subscript[d, O]), M\[Distributed](Subscript[d, M])}]

The consequent probability distribution over F is

(Subscript[P, F])[F_]:=({{\[Piecewise], ({{(Subscript[P, OM])[1,1], F==1}, {FullSimplify[(Subscript[P, OM])[0,0]+(Subscript[P, OM])[1,0]+(Subscript[P, OM])[0,1]], True}})}})

Computing the Probability of Sufficiency

Pearl describes a three step procedure for making this counterfactual claim. 

1. Abduction: “Updating history in light of available evidence”
2. Action: “Bending the course of history (minimally) to comply with the antecedent”
3. Prediction: “Predicting the outcome based on the updated past and modified model”.

He sets out to compute the following quantities:

PS[M]=P[F[M=1]|M=0, F=0]

PS[O]=P[F[O=1]|O=0, F=0]

Step 1. Abduction

Note that in both cases of Eqs. 2 and 3, we have that F=0. We need to therefore adjust the probabilities of M and O to account only for the situation in which we did not observe a fire. 

Pearl does this using Bayes’ rule.

(Subscript[p, o]^′)=P[O=1|F=0]=((P[O=1,F=0])/(P[F=0]))

(Subscript[p, m]^′)=P[M=1|F=0]=((P[M=1,F=0])/(P[F=0]))

Note that P[O=1, F=0] is equivalent to P[O=1, M=0].

(Subscript[p, o]^′)=(((Subscript[P, OM])[1, 0])/((Subscript[P, F])[0]))

(Subscript[p, m]^′)=(((Subscript[P, OM])[0, 1])/((Subscript[P, F])[0]))

We can now update the graphical model with these new probabilities:

G1 = Graph[{"(Subscript[U, 1])"\[DirectedEdge]"O", "(Subscript[U, 2])"\[DirectedEdge]"M", "O"\[DirectedEdge]"F", "M"\[DirectedEdge]"F"}];
GraphPlot[G1, 
			VertexCoordinates->{
				"(Subscript[U, 1])"->{0, 1}, 
				"(Subscript[U, 2])"->{1, 1},
				"O"->{0, 0.5},
				"M"->{1, 0.5}, 
				"F"->{0.5, 0}},
			EdgeLabels->{"(Subscript[U, 1])"\[DirectedEdge]"O" -> "(Subscript[p, o]^′)", "(Subscript[U, 2])"\[DirectedEdge]"M" -> "(Subscript[p, m]^′)"},
			VertexSize->0.3,
			PlotTheme->"IndexLabeled",
			ImageSize->175]

(Subscript[d, O]^′)= BinomialDistribution[1, (Subscript[p, o]^′)];
(Subscript[d, M]^′)= BinomialDistribution[1, (Subscript[p, m]^′)];

The updated joint distribution is therefore as follows:

(Subscript[P, OM]^′)[o_, m_]:=Probability[
(O==o) ∧(M==m), {O\[Distributed](Subscript[d, O]^′), M\[Distributed](Subscript[d, M]^′)}]

Step 2: Action

In this stage, we compute PS[M] and PS[O] by taking the new priors (Subscript[p, o]^′) and (Subscript[p, m]^′), and “simulate the action do[M=1]” (in Pearl’s words from the paper). Graphically, this corresponds to the following models. 

Model (Subscript[G, M=1]) is

G2 = Graph[{"(Subscript[U, 1])", "(Subscript[U, 2])", "O", "M=1", "F"}, 
			{"(Subscript[U, 1])"\[DirectedEdge]"O", "O"\[DirectedEdge]"F", "M=1"\[DirectedEdge]"F"}];
GraphPlot[G2, 
			VertexCoordinates->{
				"(Subscript[U, 1])"->{0, 1}, 
				"(Subscript[U, 2])"->{1, 1},
				"O"->{0, 0.5},
				"M=1"->{1, 0.5}, 
				"F"->{0.5, 0}},
			EdgeLabels->{"(Subscript[U, 1])"\[DirectedEdge]"O" -> "(Subscript[p, o]^′)"},
			VertexSize->0.3,
			PlotTheme->"IndexLabeled",
			ImageSize->175]

and model (Subscript[G, O=1]) is as follows:

G3 = Graph[{"(Subscript[U, 1])", "(Subscript[U, 2])", "O=1", "M", "F"}, 
			{"(Subscript[U, 2])"\[DirectedEdge]"M", "M"\[DirectedEdge]"F", "O=1"\[DirectedEdge]"F"}];
GraphPlot[G3, 
			VertexCoordinates->{
				"(Subscript[U, 1])"->{0, 1}, 
				"(Subscript[U, 2])"->{1, 1},
				"O=1"->{0, 0.5},
				"M"->{1, 0.5}, 
				"F"->{0.5, 0}},
			EdgeLabels->{"(Subscript[U, 2])"\[DirectedEdge]"M" -> "(Subscript[p, m]^′)"},
			VertexSize->0.3,
			PlotTheme->"IndexLabeled",
			ImageSize->175]

Step 3: Prediction

Now, we have to simply compute P[F=1] under (Subscript[G, M=1]) and (Subscript[G, O=1]), respectively.

(Subscript[PS, M])=FullSimplify[(((Subscript[P, OM]^′)[1,1])/((∑_(i=0)^1)(Subscript[P, OM]^′)[i, 1]))]

Note that (Subscript[PS, M])=(Subscript[p, o]^′):

FullSimplify[(Subscript[p, o]^′)==(Subscript[PS, M])]

Note that (Subscript[PS, O])=(Subscript[p, m]^′):

(Subscript[PS, O])=FullSimplify[(((Subscript[P, OM]^′)[1,1])/((∑_(i=0)^1)(Subscript[P, OM]^′)[1, i]))]

FullSimplify[(Subscript[p, m]^′)==(Subscript[PS, O])]

So, is the Match a Better Explanation for the Fire?

We can now answer the question of whether a match being lit is a better explanation for the fire than is the presence of oxygen. Namely, the match is a better explanation if its probability of sufficiency PS[M] is greater than that of the oxygen PS[O].

expr = (Subscript[PS, M])>(Subscript[PS, O])

FullSimplify[expr, Assumptions->1≥(Subscript[p, o])>(Subscript[p, m])≥0]