# Covariance and Correlation

## Covariance

Covariance is a measure of the degree of co-movement between two random variables. For instance, we could be interested in the degree of co-movement between interest rate and inflation rate. The general formula used to calculate the covariance between two random variables, X and Y, is:

$$\ text {cov} [X,Y] = E [(X – E[X ])(Y – E[Y])]$$

While the formula for covariance given above is correct, we use a slightly modified formula to calculate the covariance of returns from a joint probability model. It is based on the probability-weighted average of the cross-products of the random variables’ deviations from their expected values for each possible outcome. Therefore, if we have two assets, I and J, with returns Ri and Rj respectively, then:

$${ \sigma }_{ { R }_{ i },{ R }_{ j } }=\sum _{ i=1 }^{ n }{ P\left( { R }_{ i } \right) \left[ { R }_{ i }-E\left( { R }_{ i } \right) \right] \left[ { R }_{ j }-E\left( { R }_{ j } \right) \right] }$$

The covariance between two random variables can be positive, negative, or zero. A positive number indicates co-movement (i.e. the variables tend to move in the same direction); a value of zero indicates no relationship, and a negative value shows that the variables move in opposite directions.

## Correlation

Correlation is the ratio of the covariance between two random variables and the product of their two standard deviations i.e.

$${ \text{Correlation} }\left( { R }_{ i },{ R }_{ j } \right) =\frac { \text{Covariance}\left( { R }_{ i },{ R }_{ j } \right) }{ \text{Standard deviation}\left( { R }_{ i } \right) \ast \text{Standard deviation}\left( { R }_{ j } \right) }$$

It measures the strength of the linear relationship between two variables. While the covariance can take on any value between negative infinity and positive infinity, the correlation is always a value between -1 and +1.

You should note the following:

First, -1 indicates a perfect inverse relationship (i.e., a unit change in one means that the other will have a unit change in the opposite direction). Secondly, +1 indicates a perfect linear relationship (i.e., the two variables move in the same direction with equal unit changes). Finally, if there is no linear relationship at all, then the correlation will be zero.

### Example

We anticipate a 15% chance that next year’s stock returns for ABC Corp will be 6%, a 60% probability that they will be 8%, and a 25% probability of 10% return. We already know that the expected value of returns is 8.2%, and the standard deviation is 1.249%.

We also anticipate that the same probabilities and states are associated with a 4% return for XYZ Corp, a 5% return, and a 5.5% return. Then the expected value of returns is 4.975, and the standard deviation is 0.46%.

Suppose we wish to calculate the covariance and the correlation between ABC and XYZ returns. Then:

\begin{align*} \text{Covariance}, \text{cov}(\text R_{\text{ABC}},\text R_{\text{XYZ}}) & = 0.15(0.06 – 0.082)(0.04 – 0.04975) \\ & + 0.6(0.08 – 0.082)(0.05 – 0.04975) \\ & + 0.25(0.10 – 0.082)(0.055 – 0.04975) \\ & = 0.0000561 \\ \end{align*}

$${ \text{Correlation} }\left( { R }_{ i },{ R }_{ j } \right) =\frac { \text{Covariance}\left( { R }_{ i },{ R }_{ j } \right) }{ \text{Standard deviation}\left( { R }_{ i } \right) \ast \text{Standard deviation}\left( { R }_{ j } \right) }$$

Therefore:

\begin{align*} \text{Correlation} & =\cfrac {0.0000561}{(0.01249 * 0.0046)} \\ & = 0.976 \\ \end{align*}

Interpretation: the correlation between the returns of the two companies is very strong (almost +1) and the returns move linearly in the same direction.

Shop CFA® Exam Prep

Offered by AnalystPrep

Featured Shop FRM® Exam Prep Learn with Us

Subscribe to our newsletter and keep up with the latest and greatest tips for success

Sergio Torrico
2021-07-23
Excelente para el FRM 2 Escribo esta revisión en español para los hispanohablantes, soy de Bolivia, y utilicé AnalystPrep para dudas y consultas sobre mi preparación para el FRM nivel 2 (lo tomé una sola vez y aprobé muy bien), siempre tuve un soporte claro, directo y rápido, el material sale rápido cuando hay cambios en el temario de GARP, y los ejercicios y exámenes son muy útiles para practicar.
diana
2021-07-17
So helpful. I have been using the videos to prepare for the CFA Level II exam. The videos signpost the reading contents, explain the concepts and provide additional context for specific concepts. The fun light-hearted analogies are also a welcome break to some very dry content. I usually watch the videos before going into more in-depth reading and they are a good way to avoid being overwhelmed by the sheer volume of content when you look at the readings.
Kriti Dhawan
2021-07-16
A great curriculum provider. James sir explains the concept so well that rather than memorising it, you tend to intuitively understand and absorb them. Thank you ! Grateful I saw this at the right time for my CFA prep.
nikhil kumar
2021-06-28
Very well explained and gives a great insight about topics in a very short time. Glad to have found Professor Forjan's lectures.
Marwan
2021-06-22
Great support throughout the course by the team, did not feel neglected
Benjamin anonymous
2021-05-10
I loved using AnalystPrep for FRM. QBank is huge, videos are great. Would recommend to a friend
Daniel Glyn
2021-03-24
I have finished my FRM1 thanks to AnalystPrep. And now using AnalystPrep for my FRM2 preparation. Professor Forjan is brilliant. He gives such good explanations and analogies. And more than anything makes learning fun. A big thank you to Analystprep and Professor Forjan. 5 stars all the way!
michael walshe
2021-03-18
Professor James' videos are excellent for understanding the underlying theories behind financial engineering / financial analysis. The AnalystPrep videos were better than any of the others that I searched through on YouTube for providing a clear explanation of some concepts, such as Portfolio theory, CAPM, and Arbitrage Pricing theory. Watching these cleared up many of the unclarities I had in my head. Highly recommended.