Re: Covariance matrix
- From: Jonathan Campbell <jg.campbell.ng@xxxxxxxxx>
- Date: Fri, 16 May 2008 16:49:50 +0100
saneman 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).
But you can fit a straight line through them -- with no error.
I think you want 'correlation', i.e. eqn. (7) of:
http://mathworld.wolfram.com/Covariance.html
That will leave you with:
C =
9.1667/Sx.Sx 91.6667/Sx.Sy
91.6667/Sx.Sy 916.6667/Sy.Sy
where Sx = sqrt(9.1667) = 3.03
Sy = sqrt(916.6...) = 30.3
So the diagonal terms are 1. and the off diagonal terms are approx. 1 (maybe exactly).
Best regards,
Jon C.
.
- References:
- Covariance matrix
- From: saneman
- Covariance matrix
- Prev by Date: Covariance matrix
- Next by Date: texture synthesis
- Previous by thread: Covariance matrix
- Next by thread: texture synthesis
- Index(es):
Relevant Pages
|