Covar

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

COVARIANCE AND CORRELATION

Covariance and correlation describe how two variables are related.

 Variables are positively related if they move in the same direction.


 Variables are inversely related if they move in opposite directions.

Both covariance and correlation indicate whether variables are positively or inversely related. Correlation
also tells you the degree to which the variables tend to move together.

As economic growth increases, stock market returns tend to increase as well. These variables
are said to be positively related because they move in the same direction.

As world oil production increases, gasoline prices fall. These variables are said to be negatively,
or inversely, related because they move in opposite directions.

To determine the actual relationships of these variables, you would use the formulas for covariance and
correlation.

Covariance

Covariance indicates how two variables are related. A positive covariance means the variables are
positively related, while a negative covariance means the variables are inversely related.

x = the independent variable


y = the dependent variable
n = number of data points in the sample
= the mean of the independent variable x
= the mean of the dependent variable y

To understand how covariance is used, consider the table below, which describes the rate of economic
growth (xi) and the rate of return on the S&P 500 (yi).

Using the covariance formula, you can determine whether economic growth and S&P 500 returns have
a positive or inverse relationship. Before you compute the covariance, calculate the mean of x and y.
(The Summary Measures topic of the Discrete Probability Distributions section explains the mean
formula in detail.)
Now you can identify the variables for the covariance formula as follows.

x = 2.1, 2.5, 4.0, and 3.6 (economic growth)


y = 8, 12, 14, and 10 (S&P 500 returns)
= 3.1

= 11

Substitute these values into the covariance formula to determine the relationship between economic
growth and S&P 500 returns.
The covariance between the returns of the S&P 500 and economic growth is 1.53. Since the
covariance is positive, the variables are positively related—they move together in the same direction.

Correlation

Correlation is another way to determine how two variables are related. In addition to telling you whether
variables are positively or inversely related, correlation also tells you the degree to which the variables
tend to move together.

As stated above, covariance measures variables that have different units of measurement. Using
covariance, you could determine whether units were increasing or decreasing, but it was impossible to
measure the degree to which the variables moved together because covariance does not use one
standard unit of measurement. To measure the degree to which variables move together, you must use
correlation.

Correlation standardizes the measure of interdependence between two variables and, consequently, tells
you how closely the two variables move. The correlation measurement, called a correlation coefficient,
will always take on a value between 1 and – 1:

 If the correlation coefficient is one, the variables have a perfect positive correlation. This means
that if one variable moves a given amount, the second moves proportionally in the same
direction. A positive correlation coefficient less than one indicates a less than perfect positive
correlation, with the strength of the correlation growing as the number approaches one.
 If correlation coefficient is zero, no relationship exists between the variables. If one variable
moves, you can make no predictions about the movement of the other variable; they are
uncorrelated.
 If correlation coefficient is –1, the variables are perfectly negatively correlated (or inversely
correlated) and move in opposition to each other. If one variable increases, the other variable
decreases proportionally. A negative correlation coefficient greater than –1 indicates a less than
perfect negative correlation, with the strength of the correlation growing as the number
approaches –1.

To calculate the correlation coefficient for two variables, you would use the correlation formula, shown
below.

r(x,y) = correlation of the variables x and y


COV(x, y) = covariance of the variables x and y
sx = sample standard deviation of the random variable x
sy = sample standard deviation of the random variable y

Earlier in this discussion, you saw how the covariance of S&P 500 returns and economic growth was
calculated using data from the following table. Now consider how their correlation is measured.
To calculate correlation, you must know the covariance for the two variables and the standard deviations
of each variable. From the earlier example, you know that the covariance of S&P 500 returns and
economic growth was calculated to be 1.53. Now you need to determine the standard deviation of each of
the variables. You would calculate the standard deviation of the S&P 500 returns and the economic
growth from the above example as follows. (For a more detailed explanation of calculating standard
deviation, refer to the Summary Measures topic of the Discrete Probability Distributions section of the
course.)
Using the information from above, you know that

COV(x,y) = 1.53
sx = 0.90
sy = 2.58

Now you can calculate the correlation coefficient by substituting the numbers above into the correlation
formula, as shown below.
A correlation coefficient of .66 tells you two important things:

 Because the correlation coefficient is a positive number, returns on the S&P 500 and economic
growth are postively related.
 Because .66 is relatively far from indicating no correlation, the strength of the correlation between
returns on the S&P 500 and economic growth is strong.

Both covariance and correlation identified that the variables are positively related. By standardizing
measures, correlation is also able to measure the degree to which the variables tend to move together.

Carlos

Given the following return information, what is the covariance between the return of Stock A and the
return of the market index?

Solution

0.314

Guided Solution

To calculate the covariance of the returns listed in the table, use the formula for sample covariance.

To calculate the covariance of the returns of both Stock A and the returns of the market index, you will
first need to calculate the average return for each. The formula used to calculate the average return is
First, calculate the average of the returns of Stock A.

Next, calculate the average of the returns of the market index.

Now, insert the calculated averages into the formula for covariance and solve. The following table
demonstrates the calculation of covariance; the four steps taken to calculate this value are explained
below.

step 1 step 2 step 3


Stock Market
A Ret
2.30 1.30 0.0600 -0.7200 -0.0432
2.50 5.00 0.2600 2.9800 0.7748
1.90 0.80 -0.3400 -1.2200 0.4148
2.40 1.90 0.1600 -0.1200 -0.0192
2.10 1.10 -0.1400 -0.9200 0.1288
sum 1.2560
average 2.24 2.02
Covariance 0.314

 Calculate the difference between each value of Stock A and the mean for Stock A. This step is
shown in column 3.
 Calculate the difference between each value of the market return and the average return for the
market. This step is shown in column 4.
 Multiply the Stock A difference by the market return difference. This calculation is shown in
column 5.
 The final step is to sum the products in the fifth column and divide the sum by the number of
returns, less one. The resulting covariance is .314, and it is shown at the bottom of the fifth
column.

4. Using the table and your calculations from above, calculate the correlation of Stock A's returns and the
return of the market index.

Solution
.76

Guided Solution

The correlation between two random variables is calculated using the formula for correlation. The formula
is

You can see that in order to calculate the correlation of the two variables, you must first calculate the
standard deviation. The formula used to calculate the standard deviation of a random variable is

The calculation of the standard deviation is shown in table format below.

step 1 step 2
Market
Stock A
Return
2.30 1.30 0.0036 0.5184
2.50 5.00 0.0676 8.8804
1.90 0.80 0.1156 1.4884
2.40 1.90 0.0256 0.0144
2.10 1.10 0.0196 0.8464
Sum 0.2320 11.7480
Average 2.24 2.02
Sum ÷ 4 0.0580 2.9370
Standard deviation 0.2408 1.7138

The steps to calculate the standard deviation of the returns of Stock A are as follows:

 Find the difference between each value of a Stock A return and the average return of Stock A,
and then square this difference. This step is shown in the third column of the table

labeled .
 Next, sum the squared differences. This calculation is shown at the base of the column in the row
titled Sum.
 Divide the sum of squared differences by the total number of returns, less one (5 – 1 = 4). This
calculation is shown at the base of the column in the row titled Sum/4.
 To calculate the standard deviation, find the square root of the number sum divided by four which
you have just calculated. This figure is at the base of the column in the row titled standard
deviation. The standard deviation is .2408.
Perform the same set of steps to find the standard deviation of market returns. The standard deviation is
1.7138.

Now that you know the covariance between the variables and the standard deviation of each, you can
calculate the correlation using the correlation formula.

The correlation of the returns of Stock A to the market is .76, which indicates a strong positive correlation.

You might also like