Issue with Eigenvalues

34 views
Skip to first unread message

Vijay Chakilam

unread,
Oct 21, 2014, 3:17:16 PM10/21/14
to jblas...@googlegroups.com
Hi,

I am trying to implement a spectral clustering algorithm in java. I am using jblas (as a maven dependency) for matrix algebra. The problem I am running into is I am getting negative eigenvalues for the Laplacian, which shouldn't be possible theoretically. In case of very small matrices (up to 5x5), the values are fine, but once the matrices start getting bigger (for even as small as 15x15), I am seeing negative eigenvalues (for example, in the attachments, the first eigenvalue is -0.05515). Anyone with experience of seeing dubious eigenvalues with Eigen.symmetricEigenValues method before? 

Attached is my Laplacian and the eigenvalues I got from Eigen.symmetricEigenValues method. 

Any suggestion/help is greatly appreciated.

Thanks,
Vijay
Eigenvalues.txt
Laplacian.txt

Mikio Braun

unread,
Oct 22, 2014, 5:05:02 AM10/22/14
to jblas...@googlegroups.com
Hi Vijay,

those are the exact same eigenvalues I get when I put the matrix in a program like octave. Maybe something wrong with the matrix setup? Are you sure it is positive definite?

Best,

Mikio

--
You received this message because you are subscribed to the Google Groups "jblas-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jblas-users...@googlegroups.com.
To post to this group, send email to jblas...@googlegroups.com.
Visit this group at http://groups.google.com/group/jblas-users.
For more options, visit https://groups.google.com/d/optout.



--
Mikio Braun - http://blog.mikiobraun.de, http://twitter.com/mikiobraun

Vijay Chakilam

unread,
Oct 22, 2014, 8:42:26 AM10/22/14
to jblas...@googlegroups.com
Thanks much for your reply Mikio. It indeed is a bug in my program. My laplacian was not PSD. I now see valid eigenvalues. Thanks for the great library and apologies for the inconvenience.

Thanks again,
Vijay

--
You received this message because you are subscribed to a topic in the Google Groups "jblas-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jblas-users/tM_PZrkY1q8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jblas-users...@googlegroups.com.

Mikio Braun

unread,
Oct 22, 2014, 2:43:15 PM10/22/14
to jblas...@googlegroups.com
No problem, you're welcome!

-M
Reply all
Reply to author
Forward
0 new messages