Square root of expectation squared equals square root of squared expectation?

536 Views Asked by At

I have in my notes that:

$$\text{CorrCoeff}(x_i,a+bx_i)=\frac{\mathbb{E}[(x_i-\mathbb{E}[x_i])(bx_i - b\mathbb{E}[x_i])]}{\sqrt{\mathbb{E}[(x_i - \mathbb{E}[x_i])^2] \mathbb{E}[(bx_i - b\mathbb{E}[x_i])^2]}} $$

Which is understandable: co-variance divided by the respective standard deviations. But then how come: $\sqrt{\mathbb{E}[(x_i-\mathbb{E}[x_i])^2]} = \mathbb{E}[x_i - \mathbb{E}[x_i]]$. This does not make sense, because when you square root something like: $\sqrt{\mathbb{E}[x_i-\mathbb{E}[x_i]]^2}$ you would get $\mathbb{E}[x_i-\mathbb{E}[x_i]]$, but clearly $\mathbb{E}[(x_i-\mathbb{E}[x_i])^2] \neq \mathbb{E}[x_i-\mathbb{E}[x_i]]^2$, or are they?

1

There are 1 best solutions below

1
On BEST ANSWER

Ok I see the problem. I have not carefully read your first equation previously.

By the linearity of the expectation, the covariance is also linear:

$$ \text{Cov}[X, aY] = \mathbb{E}[(X - \mu_X)(aY - a\mu_Y)] = a \mathbb{E}[(X - \mu_X)(Y - \mu_Y)] = a \text{Cov}[X, Y] $$

And for variance, it is well known that $$ \text{Var}[aX] = a^2\text{Var}[X] $$ and you can verify by yourself if you want.

Now, in your equation, it is a special case: The numerator is

$$ \text{Cov}[X, a + bX] = b\text{Cov}[X, X] = b\text{Var}[X]$$

The denominator is

$$ \sqrt{Var[X]Var[a + bX]} = \sqrt{b^2Var[X]^2} = |b|Var[X]$$

So

$$ \text{Corr}[X, a + bX] = \frac {b\text{Var}[X]} {|b|Var[X]} = \frac {b} {|b|}$$

It is also a well known result: when both variables are perfectly linear, then their correlation will be equal to $\pm 1$, depending on the sign of the coefficient.