Lably
Skip to content

Conditioning (probability)

Probability theory term

  • 15 min read
  • 5 chapters

Related on Lably

Through Conditional probability, Probability distribution and Measure (mathematics)

Conditioning on the discrete level

Example: A fair coin is tossed 10 times; the random variable X is the number of heads in these 10 tosses, and Y is the number of heads in the first 3 tosses. In spite of the fact that Y emerges before X it may happen that someone knows X but not Y.

Conditional probability

Given that X = 1, the conditional probability of the event Y = 0 is

P(Y=0|X=1)=P(Y=0,X=1)P(X=1)=0.7

More generally,

P(Y=0|X=x)=(7x)(10x)=7!(10−x)!(7−x)!10!x=0,1,2,3,4,5,6,7.P(Y=0|X=x)=0x=8,9,10.

One may also treat the conditional probability as a random variable, — a function of the random variable X, namely,

P(Y=0|X)={(7X)/(10X)X⩽7,0X>7.

The expectation of this random variable is equal to the (unconditional) probability,

E(P(Y=0|X))=∑xP(Y=0|X=x)P(X=x)=P(Y=0),

namely,

∑x=07(7x)(10x)⋅1210(10x)=18,

which is an instance of the law of total probability E(P(A|X))=P(A).

Thus, P(Y=0|X=1) may be treated as the value of the random variable P(Y=0|X) corresponding to X = 1. On the other hand, P(Y=0|X=1) is well-defined irrespective of other possible values of X.

Conditional expectation

Given that X = 1, the conditional expectation of the random variable Y is E(Y|X=1)=310 More generally,

E(Y|X=x)=310x,x=0,…,10.

(In this example it appears to be a linear function, but in general it is nonlinear.) One may also treat the conditional expectation as a random variable, — a function of the random variable X, namely,

E(Y|X)=310X.

The expectation of this random variable is equal to the (unconditional) expectation of Y,

E(E(Y|X))=∑xE(Y|X=x)P(X=x)=E(Y),

namely,

∑x=010310x⋅1210(10x)=32,

or simply

E(310X)=310E(X)=310⋅5=32,

which is an instance of the law of total expectation E(E(Y|X))=E(Y).

The random variable E(Y|X) is the best predictor of Y given X. That is, it minimizes the mean square error E(Y−f(X))2 on the class of all random variables of the form f(X). This class of random variables remains intact if X is replaced, say, with 2X. Thus, E(Y|2X)=E(Y|X). It does not mean that E(Y|2X)=310×2X; rather, E(Y|2X)=320×2X=310X. In particular, E(Y|2X=2)=310. More generally, E(Y|g(X))=E(Y|X) for every function g that is one-to-one on the set of all possible values of X. The values of X are irrelevant; what matters is the partition (denote it αX)

Ω={X=x1}⊎{X=x2}⊎…

of the sample space Ω into disjoint sets {X = xn}. (Here x1,x2,… are all possible values of X.) Given an arbitrary partition α of Ω, one may define the random variable E ( Y | α ). Still, E ( E ( Y | α)) = E ( Y ).

Conditional probability may be treated as a special case of conditional expectation. Namely, P ( A | X ) = E ( Y | X ) if Y is the indicator of A. Therefore the conditional probability also depends on the partition αX generated by X rather than on X itself; P ( A | g(X) ) = P (A | X) = P (A | α), α = αX = αg(X).

On the other hand, conditioning on an event B is well-defined, provided that P(B)≠0, irrespective of any partition that may contain B as one of several parts.

Conditional distribution

Given X = x, the conditional distribution of Y is

P(Y=y|X=x)=(3y)(7x−y)(10x)=(xy)(10−x3−y)(103)

for 0 ≤ y ≤ min ( 3, x ). It is the hypergeometric distribution H ( x; 3, 7 ), or equivalently, H ( 3; x, 10-x ). The corresponding expectation 0.3 x, obtained from the general formula

nRR+W

for H ( n; R, W ), is nothing but the conditional expectation E (Y | X = x) = 0.3 x.

Treating H ( X; 3, 7 ) as a random distribution (a random vector in the four-dimensional space of all measures on {0,1,2,3}), one may take its expectation, getting the unconditional distribution of Y, — the binomial distribution Bin ( 3, 0.5 ). This fact amounts to the equality

∑x=010P(Y=y|X=x)P(X=x)=P(Y=y)=123(3y)

for y = 0,1,2,3; which is an instance of the law of total probability.

Sign in to keep reading

4 more chapters are free with a Lably account.

More in Topics in mathematics