PCA principal component analysis

Curzio Basso Curzio.Basso at unibas.ch
Thu Apr 10 06:47:02 EDT 2003


On Thu, 2003-04-10 at 10:42, sebastien wrote:

> The matrix is :
> 
> ((2,1,3),
> (4,2,3),
> (4,1,0),
> (2,3,3),
> (5,1,9))
> 
> 
> The principal component given by IDL is 
> 
> ((0.87, -0.7, 0.69),
> (0.01, -0.64, -0.66),
> (0.49, 0.32, -0.30))
> 
> Runnnig the same matrix with the program that you have kindly provided
> gives :
> 
> ((-0.58, -0.67, 0.45),
> (-0.23, -0.40, -0.88),
> (-0.77, -0.62, -0.074))
> 
> Do you know why is there such a difference ??

Assuming that the data matrix you used holds the vectors in its rows, as
I would assume from your notation, than the principal components,
normalized to one, are the second you wrote, but not with your notation.
That is, the components are not the rows of the matrix, but the columns.
I got the same result with SVD on Matlab. I don't know where the IDL
results come from, but I would take the correctness of the Matlab ones
for granted... could it be the function in IDL is doing something else?

You could also check the difference in the subspaces, and if the
components given by IDL are really orthogonal.

bye

-- 
Curzio Basso <Curzio.Basso at unibas.ch>






More information about the Python-list mailing list