Apr 18

Conditional expectation generalized to continuous random variables

Conditional expectation generalized to continuous random variables

The conditional expectation definition needs to be generalized, to be applicable to continuous random variables. The generalization is accompanied with an example and later will be applied to expected shortfall.

Generalizing conditional expectation definition

Suppose X can take values x_1,...,x_I with probabilities p_i^X=P(X=x_i) and Y can take values y_1,...,y_J with probabilities

(1) p_j^Y=P(Y=y_j).

Denote the joint probabilities p_{ij}=P(X=x_i,Y=y_j). The definition from this post gives

(2) E(X|Y=\bar{y}_j)=\frac{\sum_{i=1}^Ip_{ij}x_i}{p_j^Y},

where \bar{y}_j is a fixed value of Y. The drawback of this definition is its dependence on indexation of values x_i,y_j. Our purpose is to show how from this definition one can obtain a definition that does not use indexation and can therefore be applied to continuous random variables. Denote

1_{\{Y=\bar{y}_j\}}=\left\{\begin{array}{ll}1,&Y=\bar{y}_j;\\0,&\textrm{otherwise}.\end{array}  \right.

Then the sum \sum_{i=1}^Ip_{ij}x_i can be expanded by including zero terms:

(3) \sum_{i=1}^Ip_{ij}x_i=\sum_{i=1}^I\sum_{j=1}^Jp_{ij}x_i1_{\{Y=\bar{y}_j\}}=E(X1_{\{Y=\bar{y}_j\}})

(the sum in the middle includes all points in the sample space). Using (1) and (3) we can rewrite (2) as


Replacing here the conditioning on Y=\bar{y}_j by conditioning on a general set A whose probability is not zero we obtain the definition of conditional expectation:

(4) E(X|A)=\frac{E(X1_A)}{P(A)}.

Example. If z is standard normal and \Phi is its distribution function, then for any number a one has

(5) E(z|z\le a)=-p_z(a)/\Phi(a)

where p_z is the density.

Proof. From the expression of the density


Applying this equation and (4) we get

E(z|z\le a)=\frac{E(z1_{\{z\le a\}})}{P(z\le a)}=\frac{\int_{-\infty}^atp_z(t)dt}{\Phi(a)}=\frac{-\int_{-\infty}^a\frac{dp_z(t)}{dt}dt}{\Phi(a)}=\frac{p_z(-\infty)-p_z(a)}{\Phi(a)}=-\frac{p_z(a)}{\Phi(a)}.