Independence decomposition of $Y|X$? Let $X$ and $Y$ be two random variables.
If $Y|X=x$ has a density function of $f(g(x), \sigma)$, where $g(x)$ represents the location of the distribution of $Y|X=x$, i.e. $E(Y|X=x) = g(x)$, and $\sigma$ is a constant not involving $x$, (for example $Y|X=x$ has a normal distribution and $f(g(x), \sigma)$ is the density function of $N(g(x), \sigma^2)$), is it correct that


*

*$(Y|X=x) - g(x)$ has a density function $f(0, \sigma)$?

*$Y|X - g(X)$ and $X$ are independent random variables? Therefore $Y|X - g(X)$ and $g(X)$ are independent random variables?


Thanks!
 A: Hope this helps. 
FACT 1: Given two variables $X$ and $Y$, we have (in general):
$$ Y = \mathbb{E}\left[Y|X \right] + \left( Y- \mathbb{E}\left[Y|X \right]  \right),$$
and 
$$\mathrm{cov}\left(\mathbb{E}\left[Y|X \right], Y- \mathbb{E}\left[Y|X \right]  \right)  = 0. $$
This is true as:
$$ \mathrm{cov}\left(\mathbb{E}\left[Y|X \right], Y- \mathbb{E}\left[Y|X \right]  \right) = \mathbb{E}\left[\mathbb{E}\left[Y|X \right] \left( Y- \mathbb{E}\left[Y|X \right]  \right)\right] $$
$$ = \mathbb{E}\left\{\mathbb{E}\left[\mathbb{E}\left[Y|X \right] \left( Y- \mathbb{E}\left[Y|X \right]  \right)|X\right] \right\}= \mathbb{E}\left\{\mathbb{E}\left[Y|X \right]\mathbb{E}\left[  Y- \mathbb{E}\left[Y|X \right]  |X\right] \right\} = 0,$$ 
by definition of conditional expectation, law of iterated expectations, and taking out of conditional expectation what's already measurable. 
FACT 2: Similarly, it can be proven (in general) that:
$$\mathrm{cov}\left(X, Y- \mathbb{E}\left[Y|X \right]  \right)  = 0. $$
If $X$ and $Y- \mathbb{E}\left[Y|X \right] $ are (bivariate) normals, then they are also independent (not just uncorrelated as per FACT 2). Moreover, under the same strong assumption, $\mathbb{E}\left[Y|X \right]$ and $Y- \mathbb{E}\left[Y|X \right] $ must also be independent, as $\mathbb{E}\left[Y|X \right]$ is just a measurable function of $X$ (no need to go through FACT 1 and bivariate normality arguments).
