The main measure is called covariance. It measures the strength of the linear relationship between two variables and is defined as
Notice that
,
so that variance is simply the covariance of a variable with itself.
Covariance tells us how 2 variables are associated, so we need the joint distribution of the variables. Take the following table as a given.
|
Recall that X is the return on Air.com and Y is the return on Bricks.
We know that E(X) = 0.55. You worked out that E(Y) = -0.35.
We must find .
It is the same rule as before but now we find
the weighted average of X times Y. The weights are the joint probabilities.
This could be a messy calculation as there are 49 of them in this example!
But it starts like this:
and ends:
So that
.
That means that
.
Fact: if 2 random variables are independent then their covariance is zero.
Formula:
The double summation, indicates that we are summing elements that lie in a table. Think of them as rows and columns.