Bill:

You are using LAPACK correctly.  The problems are:

(a) The original matrix is wrong.

(b) Coyle's data is weirdly normalized.


  m2=: 4 4 $ 1,(%3),5 1 3 1 5 1, (%5), (%5), 1, (%5), 1 1 5 1
  m2
  1 0.333333 5   1
  3        1 5   1
0.2      0.2 1 0.2
  1        1 5   1

   v=:{."1 (2{::dgeev_jlapack_ m2) NB. principal eigenvector
   v
0.414299 0.731056 0.106322 0.53161
   %:+/*: v  NB. length of v
1
   w  NB. eigenvector in Coyle's paper
0.232 0.402 0.061 0.305
      %:+/*: w  NB. calculate length: not 1
0.558725
   w%%:+/*: w   NB. normalize to length 1
0.415231 0.719495 0.109177 0.545885
   |v-w%%:+/*: w NB. compare v with normalized w: close
0.000932127 0.0115611 0.00285504 0.0142752

Note that eigenvectors are only defined up to scalar multiples.  I have
not read the paper except to get the matrix, so I don't know why it is
being normalized like this.

Best wishes,

JOhn




Bill Harris wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> It's been a while since I've done much linear algebra stuff, and I don't
> think I've ever used LAPACK before.
>
> Recently, I was trying to duplicate the results in
> http://actifeld.com/A%20Possible%20Method.doc.  In particular, Geoff
> Coyle gives a matrix on p. 6 and then shows the eigenvector (presumably
> the principal eigenvector) as (0.232, 0.402, 0.061, 0.305).
>
> I tried using dgeev_jlapack_ as in the lab (J5.04).  Here are snippets
> of my work:
>
> ,----[ His Client Preference Matrix ]
> |  m
> |   1 0.333333 5   1
> |   3        1 5   1
> | 0.2      0.2 1 0.2
> |   1        1 5   1
> `----
>
> ,----[ Eigenvalues; the first is presumably the principal eigenvalues ]
> |   > 1{ dgeev_jlapack_ m
> | 4.1545007 _0.077250375j0.79743768 _0.077250375j_0.79743768_5.5511151e_17
> `----
>
> ,----[ Left eigenvectors; the first is presumably the principal ]
> |    > 0{ dgeev_jlapack_ m
> | 0.25760047      0.25043806j0.32061757    0.25043806j_0.32061757
>    0
> | 0.14598546     0.11143426j_0.18169805     0.11143426j0.18169805
> 1.0965318e_17
> | 0.93661124                _0.87103684               _0.87103684
> _0.98058068
> | 0.18732225 _0.17420737j_2.3592239e_16 _0.17420737j2.3592239e_16
> 0.19611614
> |
> `----
>
> ,----[ Right eigenvectors; the first is presumably  the principal ]
> |  > 2{ dgeev_jlapack_ m
> | 0.41429869  0.15147845j_0.40545658    0.15147845j0.40545658
> 4.86865e_17
> | 0.73105594             _0.82614212              _0.82614212
> _1.2962781e_15
> | 0.10632205 0.043552657j0.055757287 0.043552657j_0.055757287
> _0.19611614
> | 0.53161023   0.21776329j0.27878644   0.21776329j_0.27878644
> 0.98058068
> `----
>
> ,----[ Principle left eigenvector, with components converted to magnitudes
> ]
> |    {. | > 0{ dgeev_jlapack_ m
> | 0.25760047 0.40683516 0.40683516 0
> `----
>
> ,----[ Principal right eigenvector, with components converted to
> magnitudes ]
> |  {. | > 2{ dgeev_jlapack_ m
> | 0.41429869 0.43282878 0.43282878 4.86865e_17
> `----
>
> None of those match his (0.232, 0.402, 0.061, 0.305).  While I'm waiting
> on an answer from him, does anyone here see anything I'm doing dumb?
> Can anyone reproduce his result, perhaps using LAPACK?  I do read that
> people tend to find principal eigenvectors using a power method, which
> only returns the principal eigenvector, but I neither see that in my
> skimming of the LAPACK docs nor do I (yet) know why it's better to go
> that way than to find them all, assuming it's not computationally costly
> to find them all.
>
> TIA,
>
> Bill
> - --
> Bill Harris                      http://facilitatedsystems.com/weblog/
> Facilitated Systems                              Everett, WA 98208 USA
> http://facilitatedsystems.com/                  phone: +1 425 337-5541
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (MingW32)
> Comment: For more information, see http://www.gnupg.org
>
> iD8DBQFEBgbc3J3HaQTDvd8RAtLpAJ9cJie7+cQQMjlX85oqlR485tDGoACfWquT
> 0WPlZFk3b+23JigaeowuKp0=
> =x1/P
> -----END PGP SIGNATURE-----
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to