PCA matrix indexed by Day
2 views (last 30 days)
Show older comments
Hi,
I have successfully run a PCA on one 17x40 matrix using princomp matlab function. But each matrix is indexed by day. Now I would like to get the PCA from 30 days,60 and 90 days (example : 30 days of 17x40 matrix). Do you know the best way to do it?
Thank you for your help.
0 Comments
Answers (1)
Matt Tearle
on 29 Apr 2011
How are the matrices stored? Chances are, this is probably time for an old-fashioned for-loop, possibly using 3-D arrays.
2 Comments
Matt Tearle
on 3 May 2011
Right, PCA is a method for transforming p-dimensional space, in which the n observations live. So it's inherently a matrix operation. So the real question is how are you trying to interpret what you want to do? Do you want each of the 30 days to be an observation? It sounds that way, but then what are the 17 rows that you currently have? Perhaps you need to reshape your data into 17*30 rows and 40 columns. Or perhaps you need to do some kind of averaging or other aggregation. It's hard to say without knowing the point of what you're doing or what you're hoping to get out of it at the end.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!