I was reading about conditional variance in Wikipedia and then the following property showed up
$$E[V[Y \mid X]]=E[(Y-f(X))^2]-E[(E[Y \mid X]-f(X))^2]$$
Which i interpret as an irreducible error, meaning that if I want to approximate the random variable $Y$ by the random variable $X$ there is a constant term that i can´t affect regardless of what f(X) i choose.
Basically my question is how to estimate that irreducible error.
I tried two different approaches:
$\quad$ First one is using different f(X) and then averaging the results, as an example:
$$E[V[Y \mid X]] \simeq \sum_{i=0}^n\frac{E[(Y-X^i)^2]-E[(E[Y \mid X]-X^i)^2]}{n}$$
$\quad$Second one is to use the definition of $V[Y \mid X]$:
$$E[V[Y \mid X]]=E[E[Y^2 \mid X]-E^2[Y \mid X]]=E[Y^2]-E[E^2[Y \mid X]]$$
Both approaches have the same flaw, they rely on $E[Y \mid X]$, and i don´t know how to estimate it without making assumptions on the behaviour of $Y$.
I would consider optimal, a way to calculate that parameter without relying on $E[Y \mid X]$ explicitly
Edit: I don't consider the answer i posted is the "optimal way" of estimating it since it requires a lot of computational power and a huge data set. I have the feeling that the first approach could lead to an optimal answer, i just don't know how to develop it.