Prev: for loop problem
Next: mxGetData gets garbage
From: Bruno Luong on 6 Aug 2010 13:41 "Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <i3hg0n$807$1(a)fred.mathworks.com>... > "Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <i3hf0q$3vk$1(a)fred.mathworks.com>... > > > A repeated eigenvalue with multiplicity M has an M-dimensional space of eigenvectors. You can orthogonalize any basis for this M-dimensional space using Gram-Schmidt Don't, Gram-Schmidt is unstable numerically, and only good for educational purpose. Rather use QR or SVD or ORTH. Bruno
From: Matt J on 6 Aug 2010 13:55 "Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <i3hhfh$c2l$1(a)fred.mathworks.com>... > "Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <i3hg0n$807$1(a)fred.mathworks.com>... > > > A repeated eigenvalue with multiplicity M has an M-dimensional space of eigenvectors. You can orthogonalize any basis for this M-dimensional space using Gram-Schmidt > > Don't, Gram-Schmidt is unstable numerically, and only good for educational purpose. Rather use QR or SVD or ORTH. ================ Good to know. This link describes a stabilized, modified Gram-Schmidt incidentally http://en.wikipedia.org/wiki/Gram-Schmidt#Numerical_stability
From: NIcholas on 6 Aug 2010 14:10 > This is not an "issue": there is no warranty that EIG must return the orthogonal basis for multiple-order eigenspace even for Hermitian matrix. Thanks, I was mostly wondering what would guarantee orthogonality; as you suggested SVD does do that. Also, In the above example with A=Q * diag([1 2 3 3]) * Q'; (when the last two eigenvectors were not orthogonal) A was not exactly symmetric. disp(A-A') 1.0e-015 * 0 0 -0.2220 0 0 0 0 0 0.2220 0 0 0 0 0 0 0 But now, if I make A exactly symmetric (which it should be from the above calculation) and do an eigendecomposition the basis IS orthogonal: A=(A+A')/2; [V,D]=eig(A); disp(V'*V) 1.0000 0.0000 0.0000 0.0000 0.0000 1.0000 -0.0000 -0.0000 0.0000 -0.0000 1.0000 0.0000 0.0000 -0.0000 0.0000 1.0000 Does MATLAB detect symmetry and use a different algorithm for eig?
From: Matt J on 6 Aug 2010 14:20 "NIcholas " <dsfadfa(a)aol.com> wrote in message <i3hj6f$225$1(a)fred.mathworks.com>... > Does MATLAB detect symmetry and use a different algorithm for eig? ======== I guess it must. If it didn't detect symmetry, it shouldn't be able to return exactly real eigenvalues, as below >> A=rand(2); A=A+A'; d=eig(A) d = 0.7700 2.2667
From: Matt J on 6 Aug 2010 14:29
"Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <i3hjoq$7po$1(a)fred.mathworks.com>... > "NIcholas " <dsfadfa(a)aol.com> wrote in message <i3hj6f$225$1(a)fred.mathworks.com>... > > > Does MATLAB detect symmetry and use a different algorithm for eig? > ======== > > I guess it must. If it didn't detect symmetry, it shouldn't be able to return exactly real eigenvalues, as below ======= Forget it. That wouldn't verify it. |