Re: Generalized eigenvector problem



Luca <lucazapp@xxxxxxxxxxx> wrote in message
<25081522.1207238002409.JavaMail.jakarta@xxxxxxxxxxxxxxxxxxxxxx>...
Hello,
I've been struggling with this problem during the last two days. I'm working
on a paper where they reach the equation

( D - W ) y = Lambda D y

where W is a positive matrix and D is a diagonal matrix where the value of
the element D(i,i) is equal to the sum of the values on the row "i" of the
matrix W.

They say that this system can be solved by solving the generalized
eigenvalue system. And they also prove that this system is equivalent to the
following:

D^(-1/2) ( D - W ) D^(-1/2) z = Lambda z

where z = D^(1/2) y

The point is that I found at least 5 different versions for solving the
problem and they all (almost) give different solutions so I wonder which is the
good one?

I attach the code with the four methods so that you can have a look.

Thank you for any help.
Luca

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc
W = [1 2 3; 4 5 6; 7 3 9];
d=sum(W,2);
D=diag(d);

% compute the pseudo inverse. This would be useful
% if d has zero values which anyway is not the case
disp('Pseudo Inverse way ');
ind = find(d > 0.0001);
q = zeros(1, length(d));
q(ind) = 1./sqrt(d(ind));
D2 = diag(q);
[U, S, V] = svd(D2*(D-W)*D2)


% svd first
disp('svd first ');
D2 = diag(d.^(-1/2));
[U, S, V] = svd(D2*(D-W)*D2)


% svd second
disp('svd Second');
D2 = diag(sqrt(d));
[U, S, V] = svd(D2*(D-W)*D2)


% svd third
disp('svd third');
D2 = 1./sqrt(diag(d)+eps);
[U, S, V] = svd(D2*(D-W)*D2)


% Eig
disp('eig');
[U, S] = eig(D-W, D, 'qz')
--------
Luca, why are you using the singular value decomposition function, 'svd', to
find the eigenvectors and eigenvalues for the matrix

M = D^(-1/2)*(D-W)*D^(-1/2) ?

M, as you have defined it, is not necessarily symmetric, and therefore does
not give the same values for 'svd' as it does for 'eig'. You need to be
comparing the values of [v,d] = eig(M) with those of [v,d] = eig(D-W,D),
bearing in mind that they are related by z = D^(1/2)*y. The corresponding
eigenvalues should be the same, but only a proportionality can be established
between the z eigenvectors and D^(-1/2)*y of the y eigenvectors. (Also keep
in mind that the generalized eigenvectors will not be normalized.) As you are
aware, if a solution y has been found, then any multiple of y is also a solution
to your original equations.

Also in your "svd second" case it looks as though you used the wrong value
for D2.

Roger Stafford

.



Relevant Pages

  • Re: Eigenvectors and SVD
    ... > large sparse symmetric arrays. ... however have C++ for evaluating SVD of sparse matrices which I've ... > SVD of a matrix and the eigenvectors, but I don't have theory to know ... V' is a NxN matrix with orthogonal columns ...
    (sci.math.num-analysis)
  • Re: Adaptive PCA problem
    ... the problem is related to the SVD updating. ... most entries of x_are zeros! ... The question is "is there any method to obtain eigenvectors of S' are ...
    (sci.math.num-analysis)
  • Re: svd in two ways not equal..
    ... On May 25, 7:56 pm, "Roger Stafford" ... and complex values may be encountered, which is not true of 'svd'. ... eigenvectors are not unique but only span the corresponding vector space. ... simply equivalent functions doing the same task in different ways. ...
    (comp.soft-sys.matlab)
  • Eigenvectors and SVD
    ... large sparse symmetric arrays. ... however have C++ for evaluating SVD of sparse matrices which I've ... SVD of a matrix and the eigenvectors, but I don't have theory to know ... an equivalent set of eigenvectors? ...
    (sci.math.num-analysis)