In probability theory, the conditional expectation, conditional expected value, or conditional mean of a random variable is its expected value evaluated with respect to the conditional probability distribution. If the random variable can take on only a finite number of values, the "conditions" are that the variable can only take on a subset of those values. More formally, in the case when the random variable is defined over a discrete probability space, the "conditions" are a partition of this probability space. Depending on the context, the conditional expectation can be either a random variable or a function. The random variable is denoted E(X∣Y) analogously to conditional probability. The function form is either denoted E(X∣Y=y) or a separate function symbol such as f(y) is introduced with the meaning E(X∣Y)=f(Y).
Examples
Example 1: Dice rolling Consider the roll of a fair dice and let A = 1 if the number is even (i.e., 2, 4, or 6) and A = 0 otherwise. Furthermore, let B = 1 if the number is prime (i.e., 2, 3, or 5) and B = 0 otherwise.
The unconditional expectation of A is E[A]=(0+1+0+1+0+1)/6=1/2, but the expectation of A conditional on B = 1 (i.e., conditional on the die roll being 2, 3, or 5) is E[A∣B=1]=(1+0+0)/3=1/3, and the expectation of A conditional on B = 0 (i.e., conditional on the die roll being 1, 4, or 6) is E[A∣B=0]=(0+1+1)/3=2/3. Likewise, the expectation of B conditional on A = 1 is E[B∣A=1]=(1+0+0)/3=1/3, and the expectation of B conditional on A = 0 is E[B∣A=0]=(0+1+1)/3=2/3.
Example 2: Rainfall data Suppose we have daily rainfall data (mm of rain each day) collected by a weather station on every day of the ten-year (3652-day) period from January 1, 1990, to December 31, 1999. The unconditional expectation of rainfall for an unspecified day is the average of the rainfall amounts for those 3652 days. The conditional expectation of rainfall for an otherwise unspecified day known to be (conditional on being) in the month of March, is the average of daily rainfall over all 310 days of the ten–year period that fall in March. Similarly, the conditional expectation of rainfall conditional on days dated March 2 is the average of the rainfall amounts that occurred on the ten days with that specific date.
History The related concept of conditional probability dates back at least to Laplace, who calculated conditional distributions. It was Andrey Kolmogorov who, in 1933, formalized it using the Radon–Nikodym theorem. In works of Paul Halmos and Joseph L. Doob from 1953, conditional expectation was generalized to its modern definition using sub-σ-algebras.
Definitions
Conditioning on an event If A is an event in ℱ with nonzero probability, and X is a discrete random variable, the conditional expectation of X given A is
E(X∣A)=∑xxP(X=x∣A)=∑xxP({X=x}∩A)P(A) where the sum is taken over all possible outcomes of X. If P(A)=0, the conditional expectation is undefined due to the division by zero.
Discrete random variables If X and Y are discrete random variables, the conditional expectation of X given Y is
E(X∣Y=y)=∑xxP(X=x∣Y=y)=∑xxP(X=x,Y=y)P(Y=y) where P(X=x,Y=y) is the joint probability mass function of X and Y. The sum is taken over all possible outcomes of X. As above, the expression is undefined if P(Y=y)=0. Conditioning on a discrete random variable is the same as conditioning on the corresponding event:
E(X∣Y=y)=E(X∣A) where A is the set {Y=y}.
Continuous random variables Let X and Y be continuous random variables with joint density fX,Y(x,y), Y's density fY(y), and conditional density fX∣Y(x∣y)=fX,Y(x,y)fY(y) of X given the event Y=y. The conditional expectation of X given Y=y is
E(X∣Y=y)=∫−∞∞xfX∣Y(x∣y)dx=1fY(y)∫−∞∞xfX,Y(x,y)dx. When the denominator is zero, the expression is undefined. Conditioning on a continuous random variable is not the same as conditioning on the event {Y=y} as it was in the discrete case. For a discussion, see Conditioning on an event of probability zero. Not respecting this distinction can lead to contradictory conclusions as illustrated by the Borel-Kolmogorov paradox.
L2 random variables All random variables in this section are assumed to be in L2, that is square integrable. In its full generality, conditional expectation is developed without this assumption, see below under Conditional expectation with respect to a sub-σ-algebra. The L2 theory is, however, considered more intuitive and admits important generalizations. In the context of L2 random variables, conditional expectation is also called regression. In what follows let (Ω,ℱ,P) be a probability space, and X:Ω→ℝ in L2 with mean μX and variance σX2. The expectation μX minimizes the mean squared error:
minx∈ℝE((X−x)2)=E((X−μX)2)=σX2. The conditional expectation of X is defined analogously, except instead of a single number μX, the result will be a function eX(y). Let Y:Ω→ℝn be a random vector. The conditional expectation eX:ℝn→ℝ is a measurable function such that
ming measurable E((X−g(Y))2)=E((X−eX(Y))2). Note that unlike μX, the conditional expectation eX is not generally unique: there may be multiple minimizers of the mean squared error.
Uniqueness Example 1: Consider the case where Y is the constant random variable that is always 1. Then the mean squared error is minimized by any function of the form
eX(y)={μXif y=1,any numberotherwise. Example 2: Consider the case where Y is the 2-dimensional random vector (X,2X). Then clearly
E(X∣Y)=X but in terms of functions it can be expressed as eX(y1,y2)=3y1−y2 or e'X(y1,y2)=y2−y1 or infinitely many other ways. In the context of linear regression, this lack of uniqueness is called multicollinearity. Conditional expectation is unique up to a set of measure zero in ℝn. The measure used is the pushforward measure induced by Y. In the first example, the pushforward measure is a Dirac distribution at 1. In the second it is concentrated on the "diagonal" {y:y2=2y1}, so that any set not intersecting it has measure 0.
Existence The existence of a minimizer for mingE((X−g(Y))2) is non-trivial. It can be shown that
M:={g(Y):g is measurable and E(g(Y)2)<∞}=L2(Ω,σ(Y)) is a closed subspace of the Hilbert space L2(Ω). By the Hilbert projection theorem, the necessary and sufficient condition for eX to be a minimizer is that for all f(Y) in M we have
… excerpt ends here. Continue reading the full article.
