Clarification on 2 'E's for expected value in a conditional probability

158 Views Asked by At

The text I am reading defines the Expected Prediction Error as the squared difference between the actual Y value and the predicted Y value (f(X) in the text). Then it conditions on X. The trouble I'm having is understanding the notation of the formula, because it has 2 E symbols with subscripts for X and Y|X. Here is the formula:
$$EPE(f) = E_XE_{Y|X} ([Y - f(X)]^2 | X)$$ Are the E_x and E_y|x to clarify the conditioning? Or do the 2 multiply or some other type of operation? If describing the point of the equation in words, as the expected value with a single E, I suppose it would be 'what is the expected difference between Y and the predicted value of Y, for a given X?', which would be a question to ask since the error could change over different values of X. For the full context, it is on p. 18 of 'The Elements of Statistical Learning', from http://www-stat.stanford.edu/~tibs/ElemStatLearn/

If more info is needed, I'll be happy to add it.

1

There are 1 best solutions below

3
On BEST ANSWER

Actually,

$$E([Y-f(X)]^2)=E_X\{E_{Y|X} ([Y - f(X)]^2 | X)\} \; .$$

This is known as the law of total expectation.