Principal Component Coefficients in princomp
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi all, The first output of the princomp function is The Principal Component Coefficients(the normalized eigenvectors)and the second output is The Component Scores.I used this code:[_coefs,scores,variances,t2_] = princomp(sr); but the computed result of sr*coefs is not euqal to scores.Why? I am confused!How can I get the eigenvectors of the input matrix?
Thanks for all your kindly answering.
0 comentarios
Respuesta aceptada
Tom Lane
el 7 de Feb. de 2012
The princomp function works on the centered data (variance/covariance matrix), so you need to remove the mean to reproduce the scores:
load hald
[a,b] = princomp(ingredients);
bsxfun(@minus,ingredients,mean(ingredients))*a
Más respuestas (0)
Ver también
Categorías
Más información sobre Operating on Diagonal Matrices en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!