# Explanation on minimization of Expected values

1. Nov 3, 2012

### cutesteph

Why is the E[ Y - f(x) ]^2 minimized when choosing f(x) = E[Y|X] ?

2. Nov 3, 2012

### chiro

Hye cutesteph.

Try finding when the expression is zero. Also since you are using two variables, what is the expectation with respect to?

Another thing to note is that E_y[E_x[Y|X]] = E[Y] (also known as conditional expectation).