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}[...]$?

  • $\begingroup$ I don't get it, $\rho_{X,Y}$ is always a constant. Taking expectations of it leads itself. So perhaps I am misunderstanding your question? How could any other be accepted besides that? $\endgroup$ Commented Oct 11, 2021 at 18:05

1 Answer 1


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]$.

  • $\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$ Commented Nov 16, 2017 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
    Commented Nov 16, 2017 at 19:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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