|
Science Forum Index » Image Processing Forum » Covariance matrix...
Page 1 of 1
|
| Author |
Message |
| saneman... |
Posted: Fri May 16, 2008 9:30 am |
|
|
|
Guest
|
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). |
|
|
| Back to top |
|
| Jonathan Campbell... |
Posted: Fri May 16, 2008 10:49 am |
|
|
|
Guest
|
saneman wrote:
Quote: 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. |
|
|
| Back to top |
|
| |