Estimate conditional expectations from a sample

49 Views Asked by At

My question is how we can estimate a conditional expectation, when we just have a realization of a sample. Even this application seems to be a classical use case to me, I haven't found any treatments in literature.

To be more concrete, let $(X_1, Y_1), \ldots, (X_N, Y_N)$ be a random sample of the random vector $(X,Y)$, i.e. they are i.i.d. each one with the same distribution as $(X,Y)$. For convenience, we will assume that $X$ and $Y$ are jointly continuous. Given a realization of that sample $(x_1,y_1), \ldots, (x_N, y_N)$, how we can estimate the conditional expectation $$ \mathbb E [g(X,Y) | Y = \hat y] = \frac{\int_{\mathbb R} dx\, g(x,\hat y) \, f_{X,Y} (x, \hat y)}{\int_{\mathbb R} dx \, f_{X,Y} (x,\hat y)} \quad, $$ where $g$ is a given function and $\hat y \in \mathbb R$ a given value with $f_Y(\hat y) > 0$?

And, of course, we will assume, that $X$ and $Y$ are dependent, and that we don't have any/enough pairs in the realization with second coordinate equal to $\hat y$.

In case, we need some further assumptions on the p.d.f. $f_{X,Y}$ to proceed: What would be some "minimal" assumptions to obtain an estimation of the expected value?