# Excepted conditional density and conditional expectation

Apparently one can obtain a regression analysis as

$$g(x)=\frac{\int yf(y,x)dy}{f(x)}$$

where

$$f(x)=\int f(y,x)dy$$

is the marginal density of $X_i$. In effect, I believe, the above expression calculates the expected value of the conditional density $f(y|x)$.

I am confused, is the above expression a generalization of the conditional expectation $E[y|x]$, or are they the same?

• Hmm you are right. Maybe to rephrase my question. What is the difference between g(x) and E[y|x]? – Majte Jan 20 '14 at 22:35
• There isn't any difference - that's what Glen_b told you. In the RHS you wrote the exact expression for $E(Y\mid X=x)$. And if you write the LHS as $g(X)$ then the RHS is the exact expression of $E(Y\mid X)$. – Alecos Papadopoulos Jan 20 '14 at 23:14
• In view of the edit to the question, I think Alecos' comment is now considerably more relevant than mine. – Glen_b Jan 20 '14 at 23:36
• Majte, you may find the Wikipedia entry on the marginal distribution helpful; as it says, a marginal probability can always be written as an expected value. – Glen_b Jan 21 '14 at 0:12
• I got confused because I came across a few articles saying that the above formula should be used in lieu of E[y|x]. Maybe they referred to E[y|x] in the class of linear estimators.. I forgot the source now – Majte Jan 21 '14 at 3:46

There isn't any difference - that's what Glen_b told you. In the RHS you wrote the exact expression for $E(Y\mid X=x)$. And if you write the LHS as $g(X)$ then the RHS is the exact expression of $E(Y\mid X)$. – Alecos Papadopoulos