PCA for a vector such as [100-by-1]
Show older comments
Is it reasonable to do a PCA on a vector? I've been using Matlab with this code:
[M,N] = size(A); mn = mean(A);
A = A - repmat(mn,1,N);
B = A'; [u,s,pc] = svd(B);
S_diag = diag(S); V = S_diag .* S_diag;
Aout = PC' * A;
and I got PC is a [100,100] matrix and principal component 1 is Aout(1,1), principal component 2 is Aout(2,1) and so on.
Not sure if this is correct. Please help and Thank you.
2 Comments
Greg Heath
on 4 Nov 2013
I don't understand your terminology "PCA on a vector". You have performed PCA on a matrix, which is correct.
Or am I missing something?
Andrea Le
on 4 Nov 2013
Accepted Answer
More Answers (0)
Categories
Find more on Dimensionality Reduction and Feature Extraction 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!