Re: Covariance matrix
- From: Ray Vickson <RGVickson@xxxxxxx>
- Date: Fri, 16 May 2008 08:19:27 -0700 (PDT)
On May 16, 4:52 am, "saneman" <a...@xxxxxx> wrote:
I have this matrix:
A =
1 1000
2 1010
3 1020
4 1030
5 1040
6 1050
7 1060
8 1070
9 1080
10 1090
If the first column is the variable X and the second column is the variable
Y I would like to see how correlated the data is. Computing the covariance
matrix gives:
C =
9.1667 91.6667
91.6667 916.6667
I have read that if an element in C is 0 there is no covariance between the
corresponding variables, if its positive there is a covariance between the
two variables and if its negative there is a covariance between X and -Y.
In C the covariance between X and Y is 91.6667. But how should that number
be interpretated and does the magnitude have anything to say?
If I plot the above data X and Y does not seem very correlated (close to
each other).
You are not thinking. Look at the data: the values of Y = y and X = x
are related as y = 1000 + 10*(x-1) for x = 1, 2, ..., 10. Y and X are
perfectly, 100% correlated. You could also get this from the
covariance matrix: the standard deviations of X and Y are sx =
sqrt(9.1667), sy = sqrt(916.6667), so the correlation coefficient of X
and Y is r(X,Y) = Cov(X,Y)/[sx * sy} = 0.999999, which would have be 1
exactly if you computed infinitely many decimal places in C.
You seem to misunderstand the interpretation of covariance. See, eg.,
http://en.wikipedia.org/wiki/Correlation
R.G. Vickson
.
- References:
- Covariance matrix
- From: saneman
- Covariance matrix
- Prev by Date: Re: A Letter Of Einstein 1954
- Next by Date: Re: A Letter Of Einstein 1954
- Previous by thread: Covariance matrix
- Next by thread: Misconceptions - Jihad, War & Terrorism
- Index(es):
Relevant Pages
|