Covariance and Correlation

So I got what a correlation is it goes form -1 to 1

I will give example, theres Asset A and Asset B the correlation of them is 0,9, so when Asset A goes from 20 to 10 the Asset B goes from 20 to 11 as a example…(if the correlation is positive they will go the same way (and higher the number strenght it is), but of it is negative the price of both assets go opposite ways (and higher the number strenght it is)

But the covariance?

What is the difference of a covariance of 10 and 40?

or -20 and -30?

or the difference between a correlation of 35 and -35?

So far, so good.

Correlation of . . . what, exactly?

Correlation of their prices?

Correlation of their returns?

Correlation of their longitudes?

This isn’t remotely close to what correlation means. I’m not sure what 20, 10, and 11 are supposed to represent (Prices? Returns?), but it doesn’t matter here; correlation does not take into account the absolute magnitude of the changes, nor is it one-directional as your example suggests. (Think of it this way: if your example were true, then when B goes from 20 to 11, A will go from 20 to 11.9, which contradicts A going from 20 to 10.) To get the correlation coefficient, you divide the covariance by the two standard deviations; in doing so, you have effectively removed the magnitudes of the changes.

The correlation coefficient tells you how closely the data fit a straight line; a correlation of 0.9 says that they’re pretty darned close to lying on a straight line. But that line could have a slope of 1, 100, 0.001, or any other (positive, in this case) value.

Again, not even close.

Roughly speaking, the closer the correlation is to +1, if (whatever characteristic of) A increases, a higher percentage of the time (that same characteristic of) B will _ increase _, and the closer the correlation is to −1, if (whatever characteristic of) A increases, a higher percentage of the time (that same characteristic of) B will _ decrease _. But that’s only roughly speaking: a useful way to visualize it.

Covariances are scaled by the standard deviations of the quantities under investigation; the higher their standard deviations (all else equal), the greater the magnitude of the covariance. The covariance also accounts for the frequency with which the quantities move in the same direction (above their respective means together, or below their respective means together), or in opposite directions (one above its mean, the other below its mean).

The latter could be based on quantities that have higher standard deviations than the former, or quantities that have a higher correlation with each other, or some combination of the two.

Same as above, however, this time the regression line will have a negative slope, whereas in the previous example (10 & 40), the regression line will have a positive slope.

You cannot have a correlation of 35 or −35; I presume that you meant covariance.

The former regression line has a positive slope; the latter has a negative slope. Various combinations of volatilities and correlations can lead to having the same magnitudes on the covariances.

Thanks for your explanation, but

I still don`t get the difference of a covariance and a correlation (I only know correlation goes from -1 to 1) and covariance could be a positive or negative number…

Could you give me a situation where both of them are applied and what i the difference of them and what do they mean?

Covariance and correlation are both measures of the linearity between two time series. Covariance gives you the underlying concept. Correlation is a way to express the strength of the linear relationship as a ratio, a way to “standardize” covariance, if you will.

The population covariance is just the average of the products of each pair of observations from their respective means. For example, say we have two simple time series: 3, 6, 3, and 1, 4, 4. Each time series has a mean: (3+6+3)/3 = 4 for the first and (1+4+4)/3 = 3 for the second. The variations of the values from their respective means are (3-4), (6-4), (3-4), and (1-3), (4-3), and (4-3). We find the pairwise products of those differences and add them together: (3-4)(1-3) + (6-4)(4-3) + (3-4)(4-3) = (-1)(-2) + (2)(1) + (-1)(1) = 2 + 2 - 1 = 3. Then divide by 3, which is the number of observations in each time series (so it is the number of pairwise differences between the the two). That gives us 1. So the covariance between these two time series is 1.

You can see how this works. Since the two time series were fairly close together, you got 1, which is a pretty low number. You can also observe that the result could have been negative. The fact that it was positive tells us that on average, when one time series was above its mean, the other one was above its mean also, and vice versa. Likewise, the number need not have been small. If the pairwise differences between the variations of each time series from its mean had been large, the covariance would have been large. In fact, the number could have been very large indeed. This is not ideal when we are trying to compare one covariance to another, since we are less interested in the magnitude of the covariance and more interested in how much the two time series tend to be on the same side of their respective means at the same time.

So the remedy to the difficulty in comparing one covariance to another is that we can use the correlation coefficient to compare the linearity of one relationship to another. We divide the covariance by the product of the standard deviations of each time series, and that gives us a number with definite bounds: -1 and 1. Then, if we want to compare the correlation of for example, small cap stocks with large cap stocks to the correlation of small cap stocks with high yield bonds, then both numbers will be between -1 and 1, so it is a lot more meaningful and easy to use for comparison purposes.

Continuing the example above to see the correlation, the standard deviation of each time series is as follows. We already have the deviations of each time series from their respective means: (3-4), (6-4), (3-4), and (1-3), (4-3), and (4-3), so we just square those and divide by three to get each variance: [(3-4)2 + (6-4)2 + (3-4)2]/3 = 2, and [(1-3)2 + (4-3)2 + (4-3)2]/3 = 2. The standard deviation is just the square root of the variances, so the correlation coefficient is:

(1) / [(Sqrt(2)(Sqrt(2))] = 1/2.

Suppose this were the correlation between small cap stocks and large cap stocks (maybe unrealistic but go with it). Suppose the correlation between small cap stocks and high yield bonds is 0.76. Then we would say the linear relationship between the latter is stronger than the former.

Correlation and covariance are both measures of the strength of the linear relationship between two sets of paired data, like time series. Correlation is a more standardized and useful way to do the measurement for comparison purposes. Keep in mind that in modern portfolio theory, the important thing is minimizing risk, so comparing correlations at the heart of it.

It should be noted that the above is based on the *population* covariance and variance, so we divided by N. Note that the CFA curriculum draws a distinction between population vs. sample covariance and variance. When dealing with a sample, you need to divide by N - 1, or the answer will be incorrect.

I hope this is helpful for you.