-1
$\begingroup$

I have the following data set

x=[0.69 -1.31 0.39 0.09 1.29 0.49 0.19 -0.81 -0.31 -0.71]

y=[0.49 -1.21 0.99 0.29 1.09 0.79 -0.31 -0.81 -0.31 -1.01]

for this dataset, I computed the co-variance matrix as follows

co-variance=

0.6165   0.6154
0.6154   0.7165

Eigen values are

0.490
1.284

and the Eigen vectors are

-0.7351   -0.6778
-0.6778   -0.7351

When i try to plot the dataset as well as the Eigen vectors simultaneously, I get the plot as in (plot file). However, in the tutorial that I am following, the Eigen vectors are diagonal lines from one corner of the plot to another lines. The two Eigen vectors form two diagonal line perpendicular to one another forming a letter X. kindly verify this and let me know where I am deviating

enter image description here

2 Answers 2

1

I have found where your problem is : your eigenvectors are not orthogonal due to a sign error: the matrix of eigenvectors should be:

$-0.7351 \ \ -0.6778$

$+0.6778 \ \ -0.7351$

or better:

$x=-0.7351 \ \ x'=+0.6778$

$y=+0.6778 \ \ y'=+0.7351$

(check the orthogonality: $xx'+yy'=0$)

Besides, the first eigenvalue, instead of $0.48$, is $0.048$.

  • 0
    Who has downvoted an answer which has spotted errors as asked by the OP ? It is very discouraging when you have spent time to help.2017-01-29
  • 0
    And there goes an upvote for your time. +12017-02-11
  • 0
    Thanks : it gives impetus for the whole day !2017-02-11
0

if v is your 2x2 eigen vector matrix when use matlab to plot the 2 eigen vector as following

plot([0 v(1,1)],[0 v(2,1)] % the 1st one plot([0 v(1,2)],[0 v(2,2)] % the 2nd one