Re: [Vxl-users] Eigenvectors using VNL vs Matlab

 Re: [Vxl-users] Eigenvectors using VNL vs Matlab From: Gehua Yang - 2005-05-10 22:16:30 ```> > maziyar wrote: > >> I am using a 16x3 matrix. The data is the following: >> >> 78.317 81.539 85.283 >> 134.87 135.07 136.71 >> 137.84 136.2 147.03 >> 83.278 82.835 93.192 >> 87.246 86.773 80.599 >> 143.79 138.87 132.94 >> 147.76 147.82 141.45 >> 91.214 95.244 91.233 >> 150.22 144.2 154.16 >> 140.3 141.93 136.84 >> 172.05 171.58 164.5 >> 179.99 174.78 180.63 >> 190.9 198.19 196.92 >> 182.96 181.72 182.31 >> 212.72 211.98 210.58 >> 220.66 225.64 228.5 >> >> This data is yielding me different answers. Thus, as per my earlier >> email, I am transposing this then finding the covariance matrix. >> Then the resulting eigenvector produced using the VNL libraries >> differs from the results produced in matlab. >> Besides Kang's comments, a couple thoughts: You mentioned that this 16x3 matrix is a covariance matrix. However, as covariance matrix is defined as Covar(x) = E[ (x-mean_x)(x-mean_x)^T ], which is always square and symmetric, you may want double-check it. On the other hand, to decompose this 16x3 matrix, Singular Value Decomposition(SVD) is more desired. Gehua ```

 Re: [Vxl-users] Eigenvectors using VNL vs Matlab From: Kongbin Kang - 2005-05-10 21:35:14 ```Your data is a 16x3 matrix and the cov(data.') will produce a 16x16 matrix which is a degenerate matrix (you only have 3 samples in a 16 dimensional space). The eigenvectors cooresponding to 13 zero (or almost zero) eigenvalues span a 13 dimension subspace space. Any vector in this subspace is a eigenvector of the matrix cov(data.'). Therefore it is normal to have different eigenvectors in any algorithms because the eigenvector is not unique. Hope it helps, Kongbin maziyar wrote: >I am using a 16x3 matrix. The data is the following: > >78.317 81.539 85.283 >134.87 135.07 136.71 >137.84 136.2 147.03 >83.278 82.835 93.192 >87.246 86.773 80.599 >143.79 138.87 132.94 >147.76 147.82 141.45 >91.214 95.244 91.233 >150.22 144.2 154.16 >140.3 141.93 136.84 >172.05 171.58 164.5 >179.99 174.78 180.63 >190.9 198.19 196.92 >182.96 181.72 182.31 >212.72 211.98 210.58 >220.66 225.64 228.5 > >This data is yielding me different answers. Thus, as per my earlier email, I >am transposing this then finding the covariance matrix. Then the resulting >eigenvector produced using the VNL libraries differs from the results produced >in matlab. > >Thanks, > >Maz Khorasani > > ```
 Re: [Vxl-users] Eigenvectors using VNL vs Matlab From: Gehua Yang - 2005-05-10 22:16:30 ```> > maziyar wrote: > >> I am using a 16x3 matrix. The data is the following: >> >> 78.317 81.539 85.283 >> 134.87 135.07 136.71 >> 137.84 136.2 147.03 >> 83.278 82.835 93.192 >> 87.246 86.773 80.599 >> 143.79 138.87 132.94 >> 147.76 147.82 141.45 >> 91.214 95.244 91.233 >> 150.22 144.2 154.16 >> 140.3 141.93 136.84 >> 172.05 171.58 164.5 >> 179.99 174.78 180.63 >> 190.9 198.19 196.92 >> 182.96 181.72 182.31 >> 212.72 211.98 210.58 >> 220.66 225.64 228.5 >> >> This data is yielding me different answers. Thus, as per my earlier >> email, I am transposing this then finding the covariance matrix. >> Then the resulting eigenvector produced using the VNL libraries >> differs from the results produced in matlab. >> Besides Kang's comments, a couple thoughts: You mentioned that this 16x3 matrix is a covariance matrix. However, as covariance matrix is defined as Covar(x) = E[ (x-mean_x)(x-mean_x)^T ], which is always square and symmetric, you may want double-check it. On the other hand, to decompose this 16x3 matrix, Singular Value Decomposition(SVD) is more desired. Gehua ```