XX ve Y'ninY rastgele değişkenler olduğunu varsayalım .
Let y 0y0 bir olmak sabit reel sayı, ki y 0 = 1y0=1 . Daha sonra,
E [ X | , Y = y 0 ] = E [ X | , Y = 1 ]E[X∣Y=y0]=E[X∣Y=1] a,
sayı : o koşullu beklenen değer arasında XX verilen YY değerine sahip 11 . Şimdi, başka bir sabit gerçek sayı y 1y1 için not edin , diyelim 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] , Y = 1.5 (gerçek bir sayı)verilen X'inX koşullu beklenen değeri olacaktır
. E [ X ∣ Y = 1.5 ] ve E [ X ∣ Y = 1 ] ' in aynı değere sahipolduğunu varsaymak için hiçbir neden yoktur. Böylece, E [ X ∣ Y = yY=1.5E[X∣Y=1.5]E[X∣Y=1]]E[X∣Y=y] as being a real-valued function g(y)g(y)
that maps real numbers yy to real numbers E[X∣Y=y]E[X∣Y=y]. Note that
the statement in the OP's question that E[X∣Y=y]E[X∣Y=y] is a function of
xx is incorrect: E[X∣Y=y]E[X∣Y=y] is a real-valued function of 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.