Conditional mean

77 Views Asked by At

Let $X, Y$ be dependent discrete variables. I need to get $E[X|Y]$ and I found a formula $$E[Y∣X=x]=E[Y]+ \text{corr}(X, Y) \frac{\sqrt{\text{var}(Y)}}{\sqrt{\text{var}(X)}}(x −E[X]).$$

I can not find out how to get this formula and I am not sure if it works for discrete variables.

Thank you for your suggestions

1

There are 1 best solutions below

0
On

First, plug the definition of of $corr(X,Y) = \frac{cov(X,Y)}{\sigma_{x} \sigma{y}}$ where $\sigma$ denoting the standard deviation. Then, consider X is unknown. We get, linear least mean squared linear estimator of $Y$ based on $X$

$$E(Y∣X)=E(Y)+ \frac{Cov(X,Y)}{Var(X)}(X−E(X)).$$

which works not only for discrete, but also continuous random variables assuming that variables are linearly dependent. This does not hold in general. To derive this, assume $Y = a X + b$ and try to minimize the mean squared estimation error

$$E \left[ \left( Y -aX - b \right)^{2} \right]$$

Notice, $b = Y - aX$. So, $b = E \left[ \left( Y -aX \right) \right] = E \left[ Y \right] - a E \left[ X\right] $

Finally,

$$ E\left[ \left( \left( Y - E\left[Y \right] \right) -a \left( X - E\left[X \right] \right) \right)^{2} \right] = E\left[ ( \left( Y - E\left[Y \right] \right)^{2} \right] + -2a E\left[ ( \left( Y - E\left[Y \right] \right) ( \left( X - E\left[X \right] \right) \right] + a^{2} E\left[ ( \left( X- E\left[X \right] \right)^{2} \right] $$

USe the fact, $cov(X,Y) = E\left[ ( \left( Y - E\left[Y \right] \right) ( \left( X - E\left[X \right] \right) \right] $ and then, the variance definition.

$$ \sigma^{2}_{Y} + a^{2}\sigma^{2}_{X} -2a \times cov(X,Y) $$

Equating the quadratic function into 0 results in $a=\frac{cov(X,Y)}{\sigma^{2}_{X}} = \rho \frac{\sigma_{Y}}{\sigma_{X}}$ where $\rho$ is the correlation.

THe intercept is equal to $b= E\left[ Y \right] - \rho \frac{\sigma_{Y}}{\sigma_{X}} E[X]$.

Plugging the parameters into your linear estimator gives us the estimate of Y using X.