Search for notes by fellow students, in your own course and all over the country.

Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.

My Basket

You have nothing in your shopping cart yet.

Title: The correlation coefficient
Description: Linear algebra course

Document Preview

Extracts from the notes are below, to see the PDF you'll receive please use the links above


The correlation
coefficient

2
...
The correlation coefficient
...
, (xn , yn ), it is often useful to seek a
line which gives a “best fit” to this collection of points
...
2
...

The problem of finding a “best fit” line to some data is called linear regression, and we will address
that task using later linear algebra techniques in Chapter 7
...
There is a widely used measure of whether one
should seek such a line: this measure is called the correlation coefficient of the data points
...
4
...
Consider the 5 data points (xi , yi ) given by
(−3, 4), (−2, 1), (0, −1), (1, −1), (4, −3)
...
4
...
In Chapter 7 we will
learn how to determine which line may be reasonably considered to be the one that best fits the data, but it is appropriate to
first ask if such a line should be considered useful or not
...
4
...
Data points: (−3, 4), (−2, 1), (0, −1), (1, −1), (4, −3)
...

Let’s describe a process that answers this question for the data in Example 2
...
1, using the 5-vectors
 
 
 
 
−3
4
x1
y1
−2
1
x2   
y2   
 =  0  , Y = 
...


...
  
1
−1
x5
y5
4
−3
whose entries respectively record the x-coordinates and the y-coordinates of the data
...
Since any effect of multiplying all entries of X or Y by a common
scaling factor, such as arise under change of units of measurement (e
...
, measuring in feet or in meters),
cancels out when passing to these unit vectors, we get a concept that is insensitive to “change of units” in
the measurements and hence has more genuine significance
...
, (xn , yn ) in R2
...
e
...


Definition 2
...
2
...
The correlation coefficient r between the xi ’s and yi ’s is defined to be the cosine of the
angle between X and Y, or equivalently between the unit vectors X/kXk and Y/kYk:
X·Y
X
Y
·
r = cosine of the angle between X and Y =
=

...
4
...
4
...
4
...
Returning

kXk = 30, kYk = 28
...
9316
...
4
...

Remark 2
...
4
...
What is done in real-world problems is that the
data is recentered: we replace xi with x
bi = xi − x and replacing yi with ybi = yi − y
...
e
...
The correlation coefficient of the
original data is defined to be the application of Definition 2
...
2 to this recentered data
...

Having defined the correlation coefficient as a cosine and computed it in an example, we next address
the meaning of this number
...
4
...
The correlation r always lies between −1 and 1
...

A correlation coefficient close to 0 means that there does not appear to be a strong linear relation
between xi and yi
...
4
...
5
...

Let’s imagine the case of 3 data points (x1 , y1 ), (x2 , y2 ), and (x3 , y3 ) for which the y-components
depend exactly linearly on the x-components
...
Assume furthermore (as in the setup for Definition 2
...
2) that
the xi ’s aren’t all equal to each other, the yi ’s aren’t all equal to each other (so X, Y 6= 0), and that the
1
1
averages x = (x1 + x2 + x3 ) and y = (y1 + y2 + y3 ) both equal 0
...
Hence, yi = mxi for all i, so Y = mX
...
Hence, the nonzero vectors Y and X point in the same direction if
m > 0 and point in opposite directions if m < 0
...
2
...
The correlation coefficient
is the cosine of the angle between these vectors by its definition, so it is cos(0°) = 1 if m > 0 and is
cos(180°) = −1 if m < 0
...
, (xn , yn ) that lie near a line of slope m 6= 0, then the correlation coefficient
r reflects this by being very near 1 if m > 0, and very near −1 if m < 0
...


Often people work with r2 , which is always non-negative
...
4
...

Don’t confuse the value of r with the slope of a “best-fit line”! The nearness of r2 to 1 (or of r to
±1) is a measure of quality of fit
...


Example 2
...
6
...
4
...
9316
...
This property can be seen from the plot of the
5 given data points in Figure 2
...
1
...
Correlation coefficients go hand in hand with linear regression (finding a “best fit” line for
data) and help one to understand how meaningful the results of a linear regression are
...
Moreover, in the spirit of the old adage that
“correlation does not imply causation” (e
...
, monthly crime rates and monthly ice cream sales), note
that the correlation coefficient treats X and Y in a symmetric manner whereas any causal relationship is
asymmetric
...
4
...
Here is an example of how correlation coefficients are used in analyzing the statistics in
a lab science experiment
...
In this discipline, correlation
coefficients are often used to understand the relationship between the activity level of a neuron or group
of neurons and observations by the subject of the experiment (such as a monkey, dog, or human)
...
4
...
Activity graphs for three neurons in response to a visual stimulus
Imagine showing a subject a moving object
...
We can calculate a correlation coefficient between a neuron’s activity
(quantified as the number of spikes it fires per second) and the speed of the moving object
...
4
...

The first neuron is selective for fast speeds: it fires more when the stimulus is moving quickly,
so its activity is positively correlated with the speed
...
The response of the final neuron is uncorrelated with the
speed, which might mean that this neuron has a role in the brain that is unrelated to observing motion
...
4
...
For each of the following collections of 5 data points, all of which are plotted in Figure
2
...
3 below, verify the correlation coefficient and inspect the plot to see if it lies near a line
...
490

7
6
5
4
3
2
1
0
-1
-2
-3
-4
-5









7
6
5
4
3
2
1
0
-1
-2
-3
-4
-5

-2 -1 0 1 2 3
r ≈ −
...
513

F IGURE 2
...
3
...
4
...

(−2, −5), (−1, 3), (0, 1), (1, −3), (2, 4) with r = 6/5 ≈ 0
...


(−2, 6), (−1, 2), (0, −1), (1, −2), (2, −5) with r = −13/(5√7) ≈ −0
...

(−2, 4), (−1, −2), (0, −1), (1, 3), (2, −4) with r = −11/(2 115) ≈ −0
...


(In each case, we have arranged that the averages x and y equal 0
...
4
...
Let’s see why the correlation coefficient equals 1 precisely when the points
(xi , yi ) all lie exactly on a line y = mx whose slope m is positive
...
) By then replacing yi with −yi everywhere, it would follow that the correlation coefficient
equals −1 precisely when the points (xi , yi ) all lie exactly on a line y = mx whose slope m is negative
...
We want to show that the correlation coefficient is 1 precisely when
the Y = mX for some m > 0
...
In Example
2
...
3 we discussed why the angle θ between the (nonzero) vectors X and Y is 0° precisely when
Y = mX for some m > 0
Title: The correlation coefficient
Description: Linear algebra course