# Creating a Covariance Matrix

Lets say that you have the correlation of x,y and you have the standard deviations of x and y , how would you then find the covariance of x,y using the correlation of x,y and and the standard deviation of x,y .

The reason I would like to know this is I would like to take a correlation matrix and the standard deviations of all of the variables and use it to create a covariance matrix .

Thank you for your time , your help will be greatly appreciated

$$covariance(x,y) = {correlation(x,y) * \sigma(x) * \sigma(y)}.$$ where $${\sigma(x) \ and \ \sigma(y) }$$ are standard deviation of x and y respectively

For more details check out this blog post "Baffled by Covariance and Correlation???" https://towardsdatascience.com/let-us-understand-the-correlation-matrix-and-covariance-matrix-d42e6b643c22

and this video "covariance and correlation by Ben Lambert" https://www.youtube.com/watch?v=KDw3hC2YNFc

I hope this helps.

• This is correct, but a more direct answer would express the covariance in terms of the correlation, as the question asks.
– whuber
Jan 28, 2020 at 20:10
• @whuber Yes, correct. Should I edit it? I am a newbie here. This is my first answer. Jan 29, 2020 at 6:57
• We welcome and appreciate improvements to posts. Across SE sites, community norms vary. Here on CV, although anyone with sufficient reputation can edit any post, we typically are content with suggesting improvements to answers and leave it up to you to decide whether and how you want to make any changes. (I write from the perspective of one who has been asked many times to fix or improve an answer!)
– whuber
Jan 29, 2020 at 16:19
• @whuber Thanks for the suggestion, I have edited it to be a more direct answer. I will try to keep that in mind while answering more questions. Jan 29, 2020 at 18:11