From: d on 23 May 2010 16:49 "Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message .... > > Something like this perhaps: > > > > [V,D]=eig(myMatrix); > > [trash,idx]=max(abs(diag(D))); > > PerronVector=V(:,idx); > > Not quite, first we have to note that using max(diag(D)) is correct. But even with that change, I don't believe there is any warranty the above would return Perron vector. .... > for example. Both of course are not Perron's vector. That's where the difficulty arises. > > Bruno thank you for responding. I would like to add that I only need the vector corresponding to the largest (absolute) eigenvalue, therefore I would rather not compute all eigenvalues+eigenvectors. I'm dealing with quite large, somewhat sparse, matrices (~700x700). D
From: Bruno Luong on 23 May 2010 17:05 "d " <dagkatan(a)yahoo.com> wrote in message <htc4bv$so6$1(a)fred.mathworks.com>... > > > I would like to add that I only need the vector corresponding to the largest (absolute) eigenvalue, therefore I would rather not compute all eigenvalues+eigenvectors. I'm dealing with quite large, somewhat sparse, matrices (~700x700). > Do you have an example where [V D]=eigs(A,1,'lm') fails? Bruno
From: d on 23 May 2010 17:06 "Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <htc3p7$l8f$1(a)fred.mathworks.com>... > I suggest to use LINPROG (opt toolbox) to eventually "fix" the eigen vector. > > [V D]=eig(M); > lambda = diag(D); .. .. .. > x = linprog(dummy, A, b, Aeq, beq); > Vperron = V*x > > % Bruno hi Bruno, just saw your suggestion now. it actually had no problem with the size of the matrix, and was even faster then another code I found: http://www.mathworks.de/matlabcentral/fileexchange/22763-perron-root-computation the two methods gave similar results, which I think is a good sign. thank you very much D
From: Bruno Luong on 23 May 2010 17:17 "d " <dagkatan(a)yahoo.com> wrote in message <htc5bs$3ln$1(a)fred.mathworks.com>... > > hi Bruno, just saw your suggestion now. > it actually had no problem with the size of the matrix, and was even faster then another code I found: > http://www.mathworks.de/matlabcentral/fileexchange/22763-perron-root-computation > > the two methods gave similar results, which I think is a good sign. > thank you very much It looks like this code is from people who know about this kind of problem, so you should perhaps use their. Bruno
First
|
Prev
|
Pages: 1 2 Prev: automatically write m files from script Next: Creating a vector from sub vector |