Do you mean that dim(0) are the components of
the eigenvectors and dim(1) is which eigenvector
and corresponds to the eigenvalue number?

--Chris

On 1/26/2012 12:01 PM, ANJAN PURKAYASTHA wrote:
Thank you Chris. Figured it out- the eigenvectors are arranged columnwise.
Good Luck!
Anjan

On Wed, Jan 25, 2012 at 7:39 PM, chm<[email protected]>  wrote:

On 1/25/2012 10:26 AM, ANJAN PURKAYASTHA wrote:

Chris,
Thanks for your prompt reply. Multiplying the centered and squared
distance
matrix by -0.5 seems to  have corrrected the problem.
My last question to you is: for the ith eigenvalue in the list $eigen_val,
what is the corresponding eigenvector? Is it the ith row or the ith column
of $eigen_vec?


I don't know but you could plug the eigen vector into the
eigenvalue equation and verify the result.  If you have
it wrong, you won't get expected eigenvalue*eigenvector
result.


--Chris

  On Tue, Jan 24, 2012 at 5:47 PM, Chris 
Marshall<devel.chm.01@gmail.**com<[email protected]>
wrote:

  The two lists are the same within a factor of -2 and
the fact that the R eigenvalues seem to be missing
the value 0.

--Chris

On Tue, Jan 24, 2012 at 5:13 PM, ANJAN PURKAYASTHA
<[email protected]>   wrote:

Hi all,
Sorry for this data intensive post. I am a PDL newbie and am writing
multidimensional scaling module in PDL.
I used the following code: my ($eigen_vec, $eigen_val)=
PDL::Math::eigens($g); to generate the eigenvalues (and vectors) for a
matrix $g which is:
[
  [-0.46762857 -0.24672857  0.13132857  0.13132857  0.13132857
  0.13132857
0.13132857  0.13132857 -0.35872857  0.13132857 -0.24672857  0.16482143
0.16482143 0.070871429]
  [-0.24672857 -0.46762857  0.13132857  0.13132857  0.13132857
  0.13132857
0.13132857  0.13132857 -0.24672857  0.13132857 -0.35872857  0.16482143
0.16482143 0.070871429]
  [ 0.13132857  0.13132857 -0.27791429 -0.15541429 -0.15541429
-0.15541429
-0.15541429 -0.15541429  0.13132857 -0.15541429  0.13132857  0.25967857
0.25967857  0.16572857]
  [ 0.13132857  0.13132857 -0.15541429 -0.27791429 -0.15541429
-0.15541429
-0.15541429 -0.15541429  0.13132857 -0.15541429  0.13132857  0.25967857
0.25967857  0.16572857]
  [ 0.13132857  0.13132857 -0.15541429 -0.15541429 -0.27791429
-0.15541429
-0.15541429 -0.15541429  0.13132857 -0.15541429  0.13132857  0.25967857
0.25967857  0.16572857]
  [ 0.13132857  0.13132857 -0.15541429 -0.15541429 -0.15541429
-0.27791429
-0.15541429 -0.15541429  0.13132857 -0.15541429  0.13132857  0.25967857
0.25967857  0.16572857]
  [ 0.13132857  0.13132857 -0.15541429 -0.15541429 -0.15541429
-0.15541429
-0.27791429 -0.15541429  0.13132857 -0.15541429  0.13132857  0.25967857
0.25967857  0.16572857]
  [ 0.13132857  0.13132857 -0.15541429 -0.15541429 -0.15541429
-0.15541429
-0.15541429 -0.27791429  0.13132857 -0.15541429  0.13132857  0.25967857
0.25967857  0.16572857]
  [-0.35872857 -0.24672857  0.13132857  0.13132857  0.13132857
  0.13132857
0.13132857  0.13132857 -0.46762857  0.13132857 -0.24672857  0.16482143
0.16482143 0.070871429]
  [ 0.13132857  0.13132857 -0.15541429 -0.15541429 -0.15541429
-0.15541429
-0.15541429 -0.15541429  0.13132857 -0.27791429  0.13132857  0.25967857
0.25967857  0.16572857]
  [-0.24672857 -0.35872857  0.13132857  0.13132857  0.13132857
  0.13132857
0.13132857  0.13132857 -0.24672857  0.13132857 -0.46762857  0.16482143
0.16482143 0.070871429]
  [ 0.16482143  0.16482143  0.25967857  0.25967857  0.25967857
  0.25967857
0.25967857  0.25967857  0.16482143  0.25967857  0.16482143  -1.2027286
-1.1127286 -0.16157857]
  [ 0.16482143  0.16482143  0.25967857  0.25967857  0.25967857
  0.25967857
0.25967857  0.25967857  0.16482143  0.25967857  0.16482143  -1.1127286
-1.2027286 -0.16157857]
  [0.070871429 0.070871429  0.16572857  0.16572857  0.16572857
  0.16572857
0.16572857  0.16572857 0.070871429  0.16572857 0.070871429 -0.16157857
-0.16157857  -1.1204286]
]

The list of eigenvalues I get is:
  -0.1089 -0.3329 8.5614601633457e-15 -0.1225 -0.1225 -0.1225 -0.1225

-0.1225

-2.9792477876937 -0.1225 -0.1089 -1.88386103059169 -0.0900000000000002
-1.10299118171461

However the eigenvalues returned for the same matrix,in R are:
1.4896239 0.9419305 0.5514956 0.1664500 0.0612500 0.0612500 0.0612500
0.0612500 0.0612500 0.0612500 0.0544500 0.0544500 0.0450000

The two lists clearly do not match. Any idea where I am going wrong?

Thank you,
Anjan

______________________________**_________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.**edu/mailman/listinfo/perldl<http://mailman.jach.hawaii.edu/mailman/listinfo/perldl>






-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1416 / Virus Database: 2109/4766 - Release Date: 01/25/12


_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to