help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Understanding eig()


From: Henry F. Mollet
Subject: Re: Understanding eig()
Date: Sun, 01 Aug 2004 14:30:12 -0700
User-agent: Microsoft-Entourage/10.1.1.2418

[w,la]=eig(A);
la=diag(la);
imax=find (la==max(real(la)));
v=conj(inv(w));
w1=abs(w(:,imax)); 
v1=abs(real (v(imax,:)))';

It's best to graph all the eigenvalues in the complex plane to see the
eigenvalue spectrum to understand what is going on.
("plot (la, "*")" is all that is needed; but it might be nice to add axis at
the center of a unit circle)
 
The eigenvalue and corresponding right eigenvector (w, others use v) and
left eigenvector (v, others use u) of most interest is usually the dominant
eigenvalue providing the long-term solution when the contribution of the
other eigenvalues has died out. At least that's how it works in my field of
interest. The other eigenvalues and eigenvectors will determine how long it
takes to reach what I call a stable age distribution (w).

The left eigenvectors can be defined in two ways. One is given above but
using v = inv (w) instead of conj(inv(w) will work just as well but one has
to be consistent.

In the real world we need real solutions but there are exceptions.  I assume
that GNU Octave lists the eigenvalues in the order of the absolute value
octave:3> la=diag(la)
la =

   11.72374 +  0.00000i
   -1.05925 +  5.81855i
   -1.05925 -  5.81855i
   -0.00571 +  2.32593i
   -0.00571 -  2.32593i
   -2.03018 +  0.00000i
    0.21818 +  0.82953i
    0.21818 -  0.82953i

If not ordered like that then I can use
octave:5> imax=find (la==max(real(la)))
imax = 1
% The first one is indeed the largest one and is real.

octave:8> w1=abs(w(:,imax))
w1 =

  0.083462
  0.371274
  0.337533
  0.033013
  0.511678
  0.537519
  0.348685
  0.260477
% Right eivenvector associated with la1 is also real.

octave:10> v1=abs(real (v(imax,:)))'
v1 =

  0.95879
  0.49941
  0.38411
  2.28269
  0.17134
  0.33320
  0.40219
  0.47043
% Left eigenvector rendered as a col vector is also real but it is a row
vector when we write out the defining matrix equation.

In my field, matrices are classified as follows:
Nonnegative
Reducible vs. irreducible
If irreducible, primitive vs. imprimitive
(after Caswell 2001, Matrix Population Models p. 85).
Henry
 


on 8/1/04 12:23 PM, Rich Shepard at address@hidden wrote:

> I want to confirm the interpretation of the output I get by feeding a
> matrix to the eig() function. What I read on page 184 of the manual suggests
> that the results of eig(a) are lambda, so the topmost value is the maximum
> eigenvalue. Is this correct?
> 
> My linear algebra review refreshed me on the math. Now I need to
> understand what octave presents to me.
> 
> TIA,
> 
> Rich



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]