Conditioning (probability)


Beliefs depend on the available information. This idea is formalized in probability theory by conditioning. Conditional probabilities, conditional expectations, and conditional probability distributions are treated on three levels: discrete probabilities, probability density functions, and measure theory. Conditioning leads to a non-random result if the condition is completely specified; otherwise, if the condition is left random, the result of conditioning is also random.

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 — 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
More generally,
One may also treat the conditional probability as a random variable, — a function of the random variable X, namely,
The expectation of this random variable is equal to the probability,
namely,
which is an instance of the law of total probability
Thus, may be treated as the value of the random variable corresponding to X = 1. On the other hand, 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 More generally,
One may also treat the conditional expectation as a random variable, — a function of the random variable X, namely,
The expectation of this random variable is equal to the expectation of Y,
namely,
or simply
which is an instance of the law of total expectation
The random variable is the best predictor of Y given X. That is, it minimizes the mean square error on the class of all random variables of the form f. This class of random variables remains intact if X is replaced, say, with 2X. Thus, It does not mean that rather, In particular, More generally, 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
of the sample space Ω into disjoint sets. Given an arbitrary partition α of Ω, one may define the random variable E. Still, E = E.
Conditional probability may be treated as a special case of conditional expectation. Namely, P = E 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 = P = P, α = αX = αg.
On the other hand, conditioning on an event B is well-defined, provided that irrespective of any partition that may contain B as one of several parts.

Conditional distribution

Given X = x, the conditional distribution of Y is
for 0 ≤ y ≤ min. It is the hypergeometric distribution H, or equivalently, H. The corresponding expectation 0.3 x, obtained from the general formula
for H, is nothing but the conditional expectation E = 0.3 x.
Treating H as a random distribution, one may take its expectation, getting the unconditional distribution of Y, — the binomial distribution Bin. This fact amounts to the equality
for y = 0,1,2,3; which is an instance of the law of total probability.

Conditioning on the level of densities

Example. A point of the sphere x2 + y2 + z2 = 1 is chosen at random according to the n-sphere#Generating points on the surface of the n-ball The random variables X, Y, Z are the coordinates of the random point. The joint density of X, Y, Z does not exist, but the joint density fX,Y of X, Y exists,
The density of X may be calculated by integration,
surprisingly, the result does not depend on x in,
which means that X is distributed uniformly on. The same holds for Y and Z.
Example. A different measure of calculating the marginal distribution function is provided below

Conditional probability

Calculation

Given that X = 0.5, the conditional probability of the event Y ≤ 0.75 is the integral of the conditional density,
More generally,
for all x and y such that −1 < x < 1 and . One may also treat the conditional probability as a random variable, — a function of the random variable X, namely,
The expectation of this random variable is equal to the probability,
which is an instance of the law of total probability E = P.

Interpretation

The conditional probability P cannot be interpreted as P / P, since the latter gives 0/0. Accordingly, P cannot be interpreted via empirical frequencies, since the exact value X = 0.5 has no chance to appear at random, not even once during an infinite sequence of independent trials.
The conditional probability can be interpreted as a limit,

Conditional expectation

The conditional expectation E is of little interest; it vanishes just by symmetry. It is more interesting to calculate E treating |Z| as a function of X, Y:
More generally,
for −1 < x < 1. One may also treat the conditional expectation as a random variable, — a function of the random variable X, namely,
The expectation of this random variable is equal to the expectation of |Z|,
namely,
which is an instance of the law of total expectation E = E.
The random variable E is the best predictor of |Z| given X. That is, it minimizes the mean square error E 2 on the class of all random variables of the form f. Similarly to the discrete case, E = E for every measurable function g that is one-to-one on.

Conditional distribution

Given X = x, the conditional distribution of Y, given by the density fY|X=x, is the arcsin distribution; its cumulative distribution function is
for all x and y such that x2 + y2 < 1.The corresponding expectation of h is nothing but the conditional expectation E. The mixture of these conditional distributions, taken for all x is the unconditional distribution of Y. This fact amounts to the equalities
the latter being the instance of the law of total probability [|mentioned above].

What conditioning is not

On the discrete level conditioning is possible only if the condition is of nonzero probability. On the level of densities, conditioning on X = x is possible even though P = 0. This success may create the illusion that conditioning is always possible. Regretfully, it is not, for several reasons presented below.

Geometric intuition: caution

The result P = 5/6, mentioned [|above], is geometrically evident in the following sense. The points of the sphere x2 + y2 + z2 = 1, satisfying the condition x = 0.5, are a circle y2 + z2 = 0.75 of radius on the plane x = 0.5. The inequality y ≤ 0.75 holds on an arc. The length of the arc is 5/6 of the length of the circle, which is why the conditional probability is equal to 5/6.
This successful geometric explanation may create the illusion that the following question is trivial.
It may seem evident that the conditional distribution must be uniform on the given circle. Sometimes it really is, but in general it is not. Especially, Z is distributed uniformly on and independent of the ratio Y/X, thus, P = 0.75. On the other hand, the inequality z ≤ 0.5 holds on an arc of the circle x2 + y2 + z2 = 1, y = cx. The length of the arc is 2/3 of the length of the circle. However, the conditional probability is 3/4, not 2/3. This is a manifestation of the classical Borel paradox.
Another example. A random rotation of the three-dimensional space is a rotation by a random angle around a random axis. Geometric intuition suggests that the angle is independent of the axis and distributed uniformly. However, the latter is wrong; small values of the angle are less probable.

The limiting procedure

Given an event B of zero probability, the formula is useless, however, one can try for an appropriate sequence of events Bn of nonzero probability such that BnB. One example is given above. Two more examples are Brownian bridge and Brownian excursion.
In the latter two examples the law of total probability is irrelevant, since only a single event is given. By contrast, in the example above the law of total probability [|applies], since the event X = 0.5 is included into a family of events X = x where x runs over, and these events are a partition of the probability space.
In order to avoid paradoxes, the following important distinction should be taken into account. If a given event is of nonzero probability then conditioning on it is well-defined, as was noted above. By contrast, if the given event is of zero probability then conditioning on it is ill-defined unless some additional input is provided. Wrong choice of this additional input leads to wrong conditional probabilities. In this sense, "the concept of a conditional probability with regard to an isolated hypothesis whose probability equals 0 is inadmissible." a symmetry ; a sequence of events Bn such that BnB, P > 0; a partition containing the given event. Measure-theoretic conditioning investigates Case, discloses its relation to in general and to when applicable.
Some events of zero probability are beyond the reach of conditioning. An example: let Xn be independent random variables distributed uniformly on, and B the event "Xn → 0 as n → ∞"; what about P ? Does it tend to 1, or not? Another example: let X be a random variable distributed uniformly on, and B the event "X is a rational number"; what about P ? The only answer is that, once again,

Conditioning on the level of measure theory

Example. Let Y be a random variable distributed uniformly on, and X = f where f is a given function. Two cases are treated below: f = f1 and f = f2, where f1 is the continuous piecewise-linear function
and f2 is the Weierstrass function.

Geometric intuition: caution

Given X = 0.75, two values of Y are possible, 0.25 and 0.5. It may seem evident that both values are of conditional probability 0.5 just because one point is congruent to another point. However, this is an illusion; see below.

Conditional probability

The conditional probability P may be defined as the best predictor of the indicator
given X. That is, it minimizes the mean square error E 2 on the class of all random variables of the form g.
In the case f = f1 the corresponding function g = g1 may be calculated explicitly,
Alternatively, the limiting procedure may be used,
giving the same result.
Thus, P = g1. The expectation of this random variable is equal to the probability, E = P, namely,
which is an instance of the law of total probability E = P.
In the case f = f2 the corresponding function g = g2 probably cannot be calculated explicitly. Nevertheless it exists, and can be computed numerically. Indeed, the space L2 of all square integrable random variables is a Hilbert space; the indicator I is a vector of this space; and random variables of the form g are a subspace. The orthogonal projection of this vector to this subspace is well-defined. It can be computed numerically, using finite-dimensional approximations to the infinite-dimensional Hilbert space.
Once again, the expectation of the random variable P = g2 is equal to the probability, E = P, namely,
However, the Hilbert space approach treats g2 as an equivalence class of functions rather than an individual function. Measurability of g2 is ensured, but continuity is not. The value g2 is determined uniquely, since the point 0.5 is an atom of the distribution of X. Other values x are not atoms, thus, corresponding values g2 are not determined uniquely. Once again, "the concept of a conditional probability with regard to an isolated hypothesis whose probability equals 0 is inadmissible." may be defined as the Radon–Nikodym derivative
where measures μ, ν are defined by
for all Borel sets That is, μ is the distribution of X, while ν is one third of its conditional distribution,
Both approaches treat g as an equivalence class of functions; two functions g and g′ are treated as equivalent, if g = g′ almost surely. Accordingly, the conditional probability P is treated as an equivalence class of random variables; as usual, two random variables are treated as equivalent if they are equal almost surely.

Conditional expectation

The conditional expectation may be defined as the best predictor of Y given X. That is, it minimizes the mean square error on the class of all random variables of the form h.
In the case f = f1 the corresponding function h = h1 may be calculated explicitly,
Alternatively, the limiting procedure may be used,
giving the same result.
Thus, The expectation of this random variable is equal to the expectation, namely,
which is an instance of the law of total expectation
In the case f = f2 the corresponding function h = h2 probably cannot be calculated explicitly. Nevertheless it exists, and can be computed numerically in the same way as g2 above, — as the orthogonal projection in the Hilbert space. The law of total expectation holds, since the projection cannot change the scalar product by the constant 1 belonging to the subspace.
Alternatively, the same function h may be defined as the Radon–Nikodym derivative
where measures μ, ν are defined by
for all Borel sets Here is the restricted expectation, not to be confused with the conditional expectation

Conditional distribution

In the case f = f1 the conditional cumulative distribution function may be calculated explicitly, similarly to g1. The limiting procedure gives:
which cannot be correct, since a cumulative distribution function must be right-continuous!
This paradoxical result is explained by measure theory as follows. For a given y the corresponding is well-defined as an equivalence class of functions. Treated as a function of y for a given x it is ill-defined unless some additional input is provided. Namely, a function must be chosen within every equivalence class. Wrong choice leads to wrong conditional cumulative distribution functions.
A right choice can be made as follows. First, is considered for rational numbers y only. Thus, only a countable set of equivalence classes is used; all choices of functions within these classes are mutually equivalent, and the corresponding function of rational y is well-defined. Second, the function is extended from rational numbers to real numbers by right continuity.
In general the conditional distribution is defined for almost all x, but sometimes the result is continuous in x, in which case individual values are acceptable. In the considered example this is the case; the correct result for x = 0.75,
shows that the conditional distribution of Y given X = 0.75 consists of two atoms, at 0.25 and 0.5, of probabilities 1/3 and 2/3 respectively.
Similarly, the conditional distribution may be calculated for all x in or.
The value x = 0.5 is an atom of the distribution of X, thus, the corresponding conditional distribution is well-defined and may be calculated by elementary means ; the conditional distribution of Y given X = 0.5 is uniform on. Measure theory leads to the same result.
The mixture of all conditional distributions is the distribution of Y.
The conditional expectation is nothing but the expectation with respect to the conditional distribution.
In the case f = f2 the corresponding probably cannot be calculated explicitly. For a given y it is well-defined as an equivalence class of functions. The right choice of functions within these equivalence classes may be made as above; it leads to correct conditional cumulative distribution functions, thus, conditional distributions. In general, conditional distributions need not be atomic or absolutely continuous. Probably, in the considered example they are singular.
Once again, the mixture of all conditional distributions is the distribution, and the conditional expectation is the expectation with respect to the conditional distribution.

Technical details