Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: order of eigenvalues
Date: Fri, 1 Feb 2008 14:25:03 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 54
Message-ID: <fnva3v$43r$1@fred.mathworks.com>
References: <fnv66a$cjt$1@fred.mathworks.com> <fnv7g2$h1o$1@fred.mathworks.com> <fnv8sh$puv$1@fred.mathworks.com>
Reply-To: "John D'Errico" <woodchips@rochester.rr.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1201875903 4219 172.30.248.37 (1 Feb 2008 14:25:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 1 Feb 2008 14:25:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:448760


"Willem Geert " <wgphaff@gmail.com> wrote in message 
<fnv8sh$puv$1@fred.mathworks.com>...
>  
> > Assume that you have two sets of eigenvectors
> > and eigenvalues, related by the fact that they
> > came from systems which were close to each
> > other. Now shuffle the eigenvalues and vectors
> > from system 2 so that its eigenvectors are
> > maximally aligned with those of system 1.
> > 
> > This seems like it might be easy, except that 
> > the tiny eigenvalues for some systems may
> > sometimes end up with virtually random
> > eigenvectors. I'd visualize some potentially
> > nasty problems to resolve.
> > 
> 
> Thanks for the reply!
> 
> I've already looked into the eigenvector-approach. It works 
> most of the time. Since the eigenvectors returned by matlab 
> always have length 1, you can figure out which eigenvectors 
> are close together by inspecting the norm of the 
> difference. Basically, I use
> 
> normOfDifference = sum(abs(evectorOld - evectorNew));
> 
> as the measure of difference. I then figure out which 
> eigenvectors are the best match*. The assumption underlying 
> this however is that:
> 
> sum(abs(evector_i - evector_j)) >>> sum(abs(evector_i_now - 
> evector_i_previous)).
> 
> This fails every once in a while though.
> 
> Using the angle between the differenct is also an option, 
> but not based on the cosine; round-off error is too large.
> 
> Willem Geert
> 
> * Compensating for the fact that eigenvectors are only 
> defined up unto a scalar multiple, sometimes eig() also 
> returns them as the negative of the previous eigenvectors. 

This is why the norm of the difference is not
the right method. instead, use the dot product
of the two vectors, and take the absolute value.

Two vectors which are close, even if the sign is
wrong on one of them, will still have an absolute
dot product near 1.

John