On Using These Lecture Notes
On Using These Lecture Notes
On Using These Lecture Notes
drops
out. While it is easy to see how this additional information is valuable when Y is a dummy
variable, it is a bit more difficult to see that it is valuable when Y is a continuous variable why
might we want to look at the multiplied value, X Y ?
Use Your Eyes
We are accustomed to looking at graphs that show values of two variables and trying to
discern patterns. Consider these two graphs of financial variables.
This plots the returns of Hong Kong's Hang Seng index against the returns of Singapore's
Straits Times index (over the period from Dec 29, 1989 to Sept 1, 2010)
This next graph shows the S&P 500 returns and interest rates (1-month Eurodollar) during Jan
2, 1990 Sept 1, 2010.
You don't have to be a highly-skilled econometrician to see the difference in the relationships.
It would seem reasonable to state that the Hong Kong and Singapore stock indexes are closely
linked; while US stock returns are not closely related to US interest rates.
We want to ask, how could we measure these relationships? Since these two graphs are rather
extreme cases, how can we distinguish cases in the middle? And then there is one farther,
even more important question: how can we try to guard against seeing relationships where, in
fact, none actually exist? The second question is the big one, which most of this course (and
much of the discipline of statistics) tries to answer. But start with the first question.
How can we measure the relationship?
Correlation measures how/if two variables move together.
Recall from above that we looked at the average of X Y when Y was a dummy variable taking
only the values of zero or one. Return to the case where Y is not a dummy but is a continuous
variable just like X. It is still useful to find the average of X Y even in the case where Y is from
a continuous distribution and can take any value,
1
1
n
i i
i
XY X Y
n
=
=
. It is a bit more useful if we
re-write X and Y as differences from their means, so finding:
( )( )
1
1
N
i i
i
X X Y Y
N
=
.
This is the covariance, which is denoted cov(X,Y) or
XY
.
A positive covariance shows that when X
is above its mean, Y tends to also be
above its mean (and vice versa) so either
a positive number times a positive
number gives a positive or a negative
times a negative gives a positive.
A negative covariance shows that when X
is above its mean, Y tends to be below its
mean (and vice versa). So when one is
positive the other is negative, which gives
a negative value when multiplied.
A bit of math (extra):
( )( )
1
1
N
i i
i
X X Y Y
N
=
=
( )
1
1
N
i i i i
i
X Y XY X Y XY
N
=
+
=
1 1 1 1
1 1 1 1
N N N N
i i i i
i i i i
X Y XY X Y XY
N N N N
= = = =
+
=
1 1 1 1
1 1 1 1
1
N N N N
i i i i
i i i i
X Y X Y Y X XY
N N N N
= = = =
+
=
1
1
N
i i
i
X Y XY YX XY
N
=
+
=
1
1
N
i i
i
X Y XY
N
=
(a strange case because it makes FOIL look like just FL!)
Covariance is sometimes scaled by the standard deviations of X and Y in order to eliminate
problems of measurement units, so define the correlation as:
( )( )
1
1
N
i i
i XY
XY
X Y X y
X X Y Y
N o
o o o o
=
= =
or Corr(X,Y),
where the Greek letter "rho" denotes the correlation coefficient. With some algebra you can
show that is always between negative one and positive one; 1 1
XY
s s .
Two variables will have a perfect correlation if they are identical; they would be perfectly
inversely correlated if one is just the negative of the other (assets and liabilities, for example).
Variables with a correlation close to one (in absolute value) are very similar; variables with a
low or zero correlation are nearly or completely unrelated.
Sample covariances and sample correlations
Just as with the average and standard deviation, we can estimate the covariance and
correlation between any two variables. And just as with the sample average, the sample
covariance and sample correlation will have distributions around their true value.
Go back to the case of the Hang Seng/Straits Times stock indexes. We can't just say that when
one is big, the other is too. We want to be a bit more precise and say that when one is above
its mean, the other tends to be above its mean, too. We might additionally state that, when
the standardized value of one is high, the other standardized value is also high.
Tthe standardized value of a variable, X, is
,
i
X i
X
X X
Z
s
= .
Multiplying the two values together,
, , X i Y i
Z Z , gives a useful indicator since if both values are
positive then the multiplication will be positive; if both are negative then the multiplication will
again be positive. So if the values of Z
X
and Z
Y
are perfectly linked together then multiplying
them together will get a positive number. On the other hand, if Z
X
and Z
Y
are oppositely
related, so whenever one is positive the other is negative, then multiplying them together will
get a negative number. And if Z
X
and Z
Y
are just random and not related to each other, then
multiplying them will sometimes give a positive and sometimes a negative number.
Sum up these multiplied values and get the (population) correlation,
, ,
1
1
N
X i Y i
i
Z Z
N
=
.
This can be written as
( )( )
, ,
1 1 1
1 1 1 1
N N N
i i
X i Y i i i
i i i
x Y x Y
X X Y Y
Z Z X X Y Y
N N s s N s s
= = =
| || |
= =
| |
\ . \ .
.
The population correlation between X and Y is denoted
XY
; the sample correlation is
XY
r .
Again the difference is whether you divide by N or (N 1). Both correlations are always
between -1 and +1; 1 1; 1 1 r s s s s .
We often think of drawing lines to summarize relationships; the correlation tells us something
about how well a line would fit the data. A correlation with an absolute value near 1 or -1 tells
us that a line (with either positive or negative slope) would fit well; a correlation near zero tells
us that there is "zero relationship."
The fact that a negative value can infer a relationship might seem surprising but consider for
example poker. Suppose you have figured out that an opponent makes a particular gesture
when her cards are no good you can exploit that knowledge, even if it is a negative
relationship. In finance, if a fund manager finds two assets that have a strong negative
correlation, that one has high returns when the other has low returns, then again this
information can exploited by taking offsetting positions.