I've been looking all over the interwebs and have been having trouble finding good uses of a covariance matrix to find the correlation coefficient.

For example, given a problem like:

Suppose that $x = \begin{bmatrix} x_1 \\ x_2 \end{bmatrix}$ is a vector with a mean of $0$ and covariance $P = \begin{bmatrix}4.5 & -1 \\ -1 & 2 \end{bmatrix}$. What is the correlation coefficient of $x_1$ and $x_2$?

I know that to find the correlation coefficient of $x_1$ and $x_2$, it is: $$P_{x_1 x_2} = \frac{cov(x_1, x_2)}{\sigma_1 \sigma_2}$$

Furthermore, I believe the $\sigma$ can be derived from the diagonals of the covariance matrix, but I'm not sure how to find $cov(x_1, x_2)$. How can one derive a single covariance from the matrix?

Thanks for your help in advanced!


There's no derivation needed. All you have is to read the covariances appropriately from their corresponding position in the covariance matrix. The covariance matrix is read as follows \begin{equation} P = \begin{bmatrix} var(X_1) & cov(X_1,X_2) \\\\ cov(X_1,X_2) & var(X_2) \\ \end{bmatrix} \end{equation} where $\sigma_1^2 = var(X_1)$ and $\sigma_2^2 = var(X_2)$. So, yes, as you say, the $\sigma^2_k$'s are at the diagonals and the covariances are at the off-diagonals. Therefore \begin{equation} P_{x_1x_2} = \frac{cov(x_1, x_2)}{\sigma_1 \sigma_2}= \frac{-1}{\sqrt{4.5}\sqrt{2}} \end{equation}

| cite | improve this answer | |
  • $\begingroup$ Awesome, answer, thank you so much! Is there ever a possibility where the opposite $cov(X_1,X_2)$ diagonals could be different? $\endgroup$ – Billy Thorton Sep 17 '18 at 3:06
  • $\begingroup$ No you always have $cov(X_1,X_2) = cov(X_2,X_1)$. $\endgroup$ – Ahmad Bazzi Sep 17 '18 at 3:06
  • $\begingroup$ btw, if you found the answer helpful, you could upvote and mark it as correct so that other people searching the same topic could know that it was helpful. $\endgroup$ – Ahmad Bazzi Sep 17 '18 at 3:07

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.