Supongamos que XX e YY son variables aleatorias.
Sea y 0y0 un número real fijo , digamos y 0 = 1y0=1 . Entonces,
E [ X ∣ Y = y 0 ] = E [ X ∣ Y = 1 ]E[X∣Y=y0]=E[X∣Y=1] es un
número : es el valor condicional esperado de XX dado que YY tiene el valor 11 . Ahora, tenga en cuenta para algún otro número real fijo y 1y1 , digamos y 1 = 1.5y1=1.5 , E [ X ∣ Y = y 1 ] = E [ X ∣ Y = 1.5 ]E[X∣Y=y1]=E[X∣Y=1.5] sería el valor condicional esperado de
XX dado Y = 1.5Y=1.5 (un número real). No hay razón para suponer que E [ X ∣ Y = 1.5 ]E[X∣Y=1.5] y E [ X ∣ Y = 1 ]E[X∣Y=1] tienen el mismo valor. Por lo tanto, también podemos considerar E [ X ∣ Y = y ]E[X∣Y=y] como unafunción de valor real g ( y )g(y)
que asigna números reales yy a números reales E [ X ∣ Y = y ]E[X∣Y=y] . Tenga en cuenta que la afirmación en la pregunta del OP de que E [ X ∣ Y = y ]E[X∣Y=y] es una función de
xx es incorrecta: E [ X ∣ Y = y ]E[X∣Y=y] es una función de valor real de yy .
On the other hand, E[X∣Y]E[X∣Y] is a random variable ZZ which
happens to be a function of the random variable YY. Now, whenever
we write Z=h(Y)Z=h(Y), what we mean is that whenever the random variable
YY happens to have value yy, the random variable ZZ has value
h(y)h(y). Whenever YY takes on value yy, the random variable
Z=E[X∣Y]Z=E[X∣Y] takes on value E[X∣Y=y]=g(y)E[X∣Y=y]=g(y).
Thus, E[X∣Y]E[X∣Y] is just another name for the random
variable Z=g(Y)Z=g(Y). Note that E[X∣Y]E[X∣Y] is a function of YY
(not yy as in the statement of the OP's question).
As a a simple illustrative
example, suppose that
XX and YY are discrete random variables with joint distribution
P(X=0,Y=0)=0.1, P(X=0,Y=1)=0.2,P(X=1,Y=0)=0.3, P(X=1,Y=1)=0.4.P(X=0,Y=0)P(X=1,Y=0)=0.1, P(X=0,Y=1)=0.2,=0.3, P(X=1,Y=1)=0.4.
Note that XX and YY are (dependent) Bernoulli random variables
with parameters 0.70.7 and 0.60.6 respectively, and so E[X]=0.7E[X]=0.7
and E[Y]=0.6E[Y]=0.6.
Now, note that conditioned on Y=0Y=0, XX is a Bernoulli random variable
with parameter 0.750.75 while conditioned on Y=1Y=1, XX is a Bernoulli
random variable with parameter 2323. If you cannot see why this is
so immediately, just work out the details: for example
P(X=1∣Y=0)=P(X=1,Y=0)P(Y=0)=0.30.4=34,P(X=0∣Y=0)=P(X=0,Y=0)P(Y=0)=0.10.4=14,P(X=1∣Y=0)=P(X=1,Y=0)P(Y=0)=0.30.4=34,P(X=0∣Y=0)=P(X=0,Y=0)P(Y=0)=0.10.4=14,
and similarly for P(X=1∣Y=1)P(X=1∣Y=1) and P(X=0∣Y=1)P(X=0∣Y=1).
Hence, we have that
E[X∣Y=0]=34,E[X∣Y=1]=23.E[X∣Y=0]=34,E[X∣Y=1]=23.
Thus, E[X∣Y=y]=g(y)E[X∣Y=y]=g(y) where g(y)g(y) is a real-valued function
enjoying the
properties: g(0)=34,g(1)=23.g(0)=34,g(1)=23.
On the other hand, E[X∣Y]=g(Y)E[X∣Y]=g(Y) is a random variable
that takes on values 3434 and 2323 with
probabilities 0.4=P(Y=0)0.4=P(Y=0) and 0.6=P(Y=1)0.6=P(Y=1) respectively.
Note that E[X∣Y]E[X∣Y] is a discrete random variable
but is not a Bernoulli random variable.
As a final touch, note that
E[Z]=E[E[X∣Y]]=E[g(Y)]=0.4×34+0.6×23=0.7=E[X].E[Z]=E[E[X∣Y]]=E[g(Y)]=0.4×34+0.6×23=0.7=E[X].
That is, the expected value of this function of YY, which
we computed using only the marginal distribution of YY,
happens to have the same numerical value as E[X]E[X] !! This
is an illustration of a more general result that many
people believe is a LIE:
E[E[X∣Y]]=E[X].E[E[X∣Y]]=E[X].
Sorry, that's just a small joke. LIE is an acronym for Law of Iterated
Expectation which is a perfectly valid result that everyone
believes is the truth.