forum.alglib.net

ALGLIB forum
It is currently Thu Mar 28, 2024 10:15 pm

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: pcabuildbasis gives incorrect eigenvectors?
PostPosted: Tue Dec 18, 2018 2:37 pm 
Offline

Joined: Tue Dec 18, 2018 1:56 pm
Posts: 1
Hi All,

I noticed that the package pcabuildbasis for principal component analysis has some weird behavior. I compared the results of pcabuildbasis with those obtained from Matlab pca (https://www.mathworks.com/help/stats/pca.html). Surprisingly, ALGLIB's pcabuildbasis and Matlab's pca give different results on the eigenvectors.

For example, given raw data A ={1.0,2.0,3.0;1.0,2.0,3.0;1.0,2.0,3.0;3.0,2.0,1.0}, pcabuildbasis returns the matrix for eigenvectors as
{-0.7071, -0.7071, 0; -0.7071, 1.0, -9.26e+061; 0, -9.26e+061, -9.26e+061},
however, Matlab pca (https://www.mathworks.com/help/stats/pca.html) gives eigenvector matrix as
{-0.7071, 0.7071, 0; 0, 0, 1.0; 0.7071, 0.7071, 0}.
The results are totally different.

I tested two other data inputs (listed at the end), they also gave different results on the eigenvector. I'm totally confused with this problem. I'll be very grateful if you could help solve this problem!

Thanks much,
Lin

Data Input2 =
[1.0, 2.0, 3.0;
1.0, 3.0, 2.0;
3.0, 1.0, 2.0;
3.0, 2.0, 1.0 ]


Data Input3 =
[7 26 6 60
1 29 15 52
11 56 8 20
11 31 8 47
7 52 6 33
11 55 9 22
3 71 17 6
1 31 22 44
2 54 18 22
21 47 4 26
1 40 23 34
11 66 9 12
10 68 8 12]


Top
 Profile  
 
 Post subject: Re: pcabuildbasis gives incorrect eigenvectors?
PostPosted: Fri Dec 21, 2018 10:04 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 903
How exactly you call pcabuildbasis()? I've tried it at my PC, and everything worked fine.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 53 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group