law of iterated expectations

# law of iterated expectations - Notes on Law of Iterated...

This preview shows pages 1–3. Sign up to view the full content.

Notes on Law of Iterated Expectations Cyrus Samii The law of iterated expectations is the foundation of many derivations and theorems in applied statistics. I provide the basic statement of the law and then illustrate how it applies to some important results. A basic statement is as follows: E ( Y ) = E (E ( Y | X )) . Here is a proof for the continuous case: E (E ( Y | X )) = Z E ( Y | X ) f X ( x ) dx = Z Z yf Y | X ( y | x ) dy f X ( x ) dx = Z Z yf X,Y ( x, y ) dxdy = Z y Z f X,Y ( x, y ) dx dy Z yf Y ( y ) dy = E ( Y ) , and for the discrete case, E (E ( Y | X )) = X x E ( Y | X = x ) p ( x ) = X x ˆ X y yp ( y | x ) ! p ( x ) = X x X y yp ( x, y ) = X y y X x p ( x, y ) = X y yp ( y ) = E ( Y ) . Example 1. Suppose Y | X N (2 X, 1) and X Multinomial ( . 25 , . 25 , . 5) . This defines a joint distribution for Y and X (since f ( Y | X ) f ( X ) = f ( X, Y ) ). Take a large number of draws from this joint distribution. Average the Y realizations. Then, bin the Y realizations by their associated X values, take the average of the Y realizations within each bin, and finally take the probability-weighted average over the bins. This should equal the mean of the Y s. Here is a demonstration with a finite (though rather large) sample using R: > n <- 5000 > p <- c(.25,.25,.5) > x <- t(rmultinom(n,1,p))% * %c(1,2,3) > y <- rnorm(n, mean=2 * x, sd=1) > mean(y) [1] 4.500761 > tapply(y, x, mean) 1 2 3 1.994880 3.973878 6.033394 > tapply(y, x, mean)% * %as.matrix(p) [,1] [1,] 4.508887 As the example illustrates, E ( Y | X ) is itself a random variable. In the example, we have, E ( Y | X ) = 2 if X = 1 4 if X = 2 6 if X = 3 , 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
where the probability of any of those E ( Y | X ) realizations is equal to the probability of realizing X = 1 vs X = 2 vs X = 3 , respectively. Thus, E ( Y | X ) is random with respect to the variation in X , and so the outer expectation is taken with respect to this source of random variation—namely, the density of X . Iterated expectations can be taken with nested conditioning sets. For example, we have E ( Y | X ) = E (E ( Y | X, Z ) | X ) . The proof is no more complicated than what we have above—just substitute in the appropriate conditional densities (e.g., replace f Y with f Y | X ). What is important is the statistical interpretation, which typically looks at the condition-
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern