svd - what are the principal components?

2 次查看(过去 30 天)
Hi, I have X = [25, 2000] i.e. 25 subjects and 2000 values (i.e. each subject has a spectrogram that is reduced to 2000 values).
My goal is to reduce from 25 subjects to 1 or 2 "subjects" that best explains the data across the group.
If I do [u,s,v]=svd(X) (in matlab) or [u1,s1,v1]=svd(X')
What would be 1st and 2nd principle components?
Is it just columns of v (in first case) or columns of u (in transposed case)
OR do I have to do T = vX or T=uX and then the 1st and 2nd row of this?

回答(1 个)

Wayne King
Wayne King 2014-2-26
编辑:Wayne King 2014-2-26
To compute the principal components using the SVD, I think you first want to center the data and compute something at least proportional to the covariance matrix of the data (not just using svd on the data matrix).
If you have the Statistics Toolbox, use pca() that is your best bet.
If you do not and must use svd(), then you really want the eigenvectors of the covariance matrix. In which case you can use eig()

类别

Help CenterFile Exchange 中查找有关 Eigenvalues 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by