# I have problems of understanding two statistical concepts

#### Real9999

The followings are the definitions of Law of Iterated Expectations and Covariance from textbook.

Law of Iterated Expectations:

E[y] = Ex [E [y | x]]

The notation Ex [.] indicates the expectation over the values of x. Note that E [y | x] is a function of x.

Covariance:

In any bivariate distribution,

Cov [x, y] = Covx [x, E[y | x]] = Integration (x - E[x]) E[y | x] fx (x)dx

(Note that this is the covariance of x and a function of x).

Can people explain this two theories in plain words?

What is the meaning of "the expectation over the value of x"?

What does the textbook mean by "this is the covariance of x and a function of (x)"? Why is the textbook saying the equation Cov [x, y] is the covriance of x and a function of x?

#### CaptainBlack

MHF Hall of Fame
The followings are the definitions of Law of Iterated Expectations and Covariance from textbook.

Law of Iterated Expectations:

E[y] = Ex [E [y | x]]

The notation Ex [.] indicates the expectation over the values of x. Note that E [y | x] is a function of x.
First we need Bayes' theorem:

$$\displaystyle p(x,y)=p(x|y)p(y)=p(y|x)p(x)$$

Then

$$\displaystyle \displaystyle E(y)= \int_x \int_y y p(x,y)\;dydx$$

and:

$$\displaystyle \displaystyle E_x(E(y|x))=\int_x \left(\int_y y p(y|x)\;dy \right) p(x)\;dx$$

.............. $$\displaystyle \displaystyle =\int_x \int_y \left( y \frac{p(x|y)p(y)}{p(x)} \right) p(x)\;dy dx= \int_x \int_y y p(x,y)\;dydx$$

etc.

CB

#### CaptainBlack

MHF Hall of Fame
Covariance:

In any bivariate distribution,

Cov [x, y] = Covx [x, E[y | x]] = Integration (x - E[x]) E[y | x] fx (x)dx

(Note that this is the covariance of x and a function of x).

Can people explain this two theories in plain words?

What is the meaning of "the expectation over the value of x"?

What does the textbook mean by "this is the covariance of x and a function of (x)"? Why is the textbook saying the equation Cov [x, y] is the covriance of x and a function of x?
Like the other just write out the definitions and apply Bayes' theorem and some algebra.

CB

#### Real9999

Thank you so so so much XD