The formula for Pearson's correlation coefficient can be written as:


My understanding of the definition of $\operatorname{E}[X]$ for a discrete random variable is:

$\operatorname{E}[X] = x_1p_1 + x_2p_2 + \cdots + x_kp_k$

How does the $\operatorname{E}[...]$ part fit in with the formula above? Or to put it another way would it not be equally legible without the $\operatorname{E}[...]$?


The term in the nominator is the covariance of $X$ and $Y$, $cov(X,Y) = \mathbb E[(x - \mu_{x})(y - \mu_{y})]$ and it measures how much do random variables $X$ and $Y$ vary together.

However, you might get a big value for covariance just because of the large variance of one of the random variables you're considering. That is why the $cov(X,Y)$ is then divided by $\sqrt{var(X) \cdot var(Y)} = \sqrt{cov(X,X) \cdot cov(Y,Y)}$. The math behind guarantees us that thus calculated $\rho$ will always be in the interval $[-1,1]$.

| cite | improve this answer | |
  • $\begingroup$ Thank you for your answer with explanation. Is it true that you are saying Var(X) = cov(X,X)? How would you describe cov(X,X), the product of the deviances of the variable from expected value of the variable? $\endgroup$ – Michael Barton Nov 16 '17 at 19:46
  • 1
    $\begingroup$ Just by definition $cov(X,X) = \mathbb E[(x-\mu_x)(x-\mu_x)] = E[(x - \mu_x)^2] = var(X)$. It's not called co-variance for nothing. $\endgroup$ – martn Nov 16 '17 at 19:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.