Prev: mcc
Next: sessation problem in command window
From: Roger Stafford on 24 May 2007 11:34 In article <ef57d97.3(a)webcrossing.raydaftYaTP>, "duccio testa" <duccio.testa(a)epfl.ch> wrote: > one example: 1000 frequency points, 11 probes: i have therefore 11 > elements in diag(S) that svd.m sorts out for me in descending order, > which is very useful if you want to find principal components to > regularise a fit. > however, i need to know the position of these 11 elements in diag(S) > before sorting, because i need to associate these 11 (non-sorted) > eigenvectors to equivalent Fourier harmonics, and which specific ones > are dominant is what i must determine before further calculations. > thanks for your help, > duccio testa ----------------- Duccio, what I think you are saying about the eigenvectors from 'svd' being unsorted is untrue! There is always a correspondence in the ordering between the singular values of 'svd' and its left and right singular vectors. If [u,s,v] = svd(m), then the first columns of u and v are the left and right singular vectors, respectively, that correspond to the first singular value in the diagonal of s, and similarly for the other columns. In case the matrix is Hermitian positive semi-definite, these coincide with the eigenvectors and eigenvalues. Thus, when 'svd' is giving eigenvectors and eigenvalues, they are both sorted so as to correspond in this way. The i-th column of u and v give the eigenvector corresponding to the i-th diagonal eigenvalue in s. This contrasts with the 'eig' function which does not necessarily sort the eigenvalues, (though it does maintain the correspondence in positioning between eigenvectors and eigenvalues.) Roger Stafford |