Law of Iterated Expectations
Discrete caseβ
Under discrete case, Expectation is defined as follows
E[X]=x1βp1β+x2βp2β+...+xnβpnβ=i=1βnβxiβpiβ,
can also be written as
E[X]=i=1βnβ(X=xiβ)P(X=xiβ),
where random variable X can take values {x1β,x2β,...,xnβ} with probabilities {p1β,p2β,...,pnβ} respectively.
The Law of Iterated Expectations (LIE) states that:
E[X]=E[E[Xβ£Y]]
that is, the expected value of the conditional expected value of X given Y is the same as the expected value of X.
Proof:
E[E[Xβ£Y]]β=yiβββE[Xβ£Y=yiβ]P(Y=yiβ)=yiβββxiβββxiβP(X=xiββ£Y=yiβ)P(Y=yiβ)β
according to the Bayes' theorem
P(X=xiββ£Y=yiβ)P(Y=yiββ£X=xiβ)βΉP(X=xiββ£Y=yiβ)P(Y=yiβ)β=P(Y=yiβ)P(X=xiβΒ andΒ Y=yiβ)β,Β and=P(X=xiβ)P(X=xiβΒ andΒ Y=yiβ)β.=P(Y=yiββ£X=xiβ)P(X=xiβ).β
Therefore
E[E[Xβ£Y]]β=yiβββxiβββxiβP(X=xiββ£Y=yiβ)P(Y=yiβ)=yiβββxiβββxiβP(Y=yiββ£X=xiβ)P(X=xiβ)=yiβββxiβββxiβP(X=xiβ)P(Y=yiββ£X=xiβ)=xiβββxiβP(X=xiβ)=1yiβββP(Y=yiββ£X=xiβ)ββ=xiβββxiβP(X=xiβ)=E[X]β β