Re: order of eigenvalues
- From: "Roger Stafford" <ellieandrogerxyzzy@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 1 Feb 2008 19:59:02 +0000 (UTC)
"Willem Geert " <wgphaff@xxxxxxxxx> wrote in message <fnv8sh$puv
$1@xxxxxxxxxxxxxxxxxx>...
...........----------
Using the angle between the differenct is also an option,
but not based on the cosine; round-off error is too large.
...........
Willem, if you are worried about accuracy in determining when vectors are
nearly parallel, there is a more accurate alternative as compared with finding
their scalar product and comparing its absolute value to 1, though it requires
more computation. The scalar product is the product of the norms of the
vectors multiplied by the cosine of the angle between them. As you
indicated, there is a loss of accuracy due to the infinite slope that is
approached by the arccosine function as its argument approaches 1 or -1.
Instead, we can directly compute the absolute value of the sine of the angle
between vectors in the following manner.
The absolute value of the sine of the angle between two real n-dimensional
(n-element) column vectors v and w is given in matlab by
norm(t(:))/sqrt(2)/norm(v)/norm(w)
where t is computed as
t = v*w.'-w*v.';
Of course with unit-length eigenvectors, the division by norm(v) and norm(w)
can be omitted. Unfortunately, finding t and norm(t(:)) are order n^2
computations.
When this sine quantity is nearly zero, the vectors are nearly parallel, even if
pointing in opposite directions. It should also be noted that this same
quantity approaches zero even when v and w are complex-valued and are
nearly parallel in the complex sense that one is nearly a complex scalar
multiple of the other, as can occur with eigenvectors of non-Hermitian
matrices.
Note: Just for the record, you can get the actual angle between the real
vectors, lying in the range 0 to pi, using
ang = atan2(norm(t(:))/sqrt(2),dot(v,w));
Roger Stafford
.
- References:
- order of eigenvalues
- From: Willem Geert
- Re: order of eigenvalues
- From: John D'Errico
- Re: order of eigenvalues
- From: Willem Geert
- order of eigenvalues
- Prev by Date: wav files(reading and playing back)
- Next by Date: Re: Break Line
- Previous by thread: Re: order of eigenvalues
- Next by thread: Re: Matlab help error?
- Index(es):
Relevant Pages
|