More non-zero generalized eigenvalues than in theory
Show older comments
Dear all,
I'm trying to compute generalized eigenvalues. First I've tried:
[V,D]=eig(A,B);
Other attempts
[V,D]=eig(A,B,'chol');
[V,D]=eig(A,B,'qz');
[V,D]=eig(A/B);
Well, my problem is that in all cases I obtain more non-zero eigenvalues than in theory. A,B are both of 42x42 size and rank(A)=2, rank(B)=41. (By the way, in case it's useful: A and B are between- and within-scatter matrices from a k=3 multiclass Linear Discriminant Analysis, i.e. three classes/groups).
Theoretically, since rank(A)=2, I would get two non-zero eigenvalues... but results are: [3.1055, 0.9127, 0.7718, etc.] All other are indeed <1e-12. I've also tried computing the scatter matrices of my data having been first transformed to zero-mean unit-stdev, but yet I get three non-negligible eigenvalues!
I don't know where the problem is. I've verified my code (mainly to check if my computation of matrices is correct) against a given example of size 6x6, and I do get two non-zero eigenvalues as expected.
Thank you very much in advance! Best regards,
Fernando
Accepted Answer
More Answers (1)
Fernando García-García
on 29 Oct 2014
0 votes
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!