PCA matrix indexed by Day

2 ビュー (過去 30 日間)
SergeK
SergeK 2011 年 4 月 29 日
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.

回答 (1 件)

Matt Tearle
Matt Tearle 2011 年 4 月 29 日
How are the matrices stored? Chances are, this is probably time for an old-fashioned for-loop, possibly using 3-D arrays.
  2 件のコメント
SergeK
SergeK 2011 年 4 月 29 日
Hi, thank you for your quick reply.
I have one matrix per day.
In the case of a for loop I would get one PCA per day.
I want to extract only one PCA for the whole 30 days and as far as I know princomp is accepting only n x p matrix.
Matt Tearle
Matt Tearle 2011 年 5 月 3 日
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.

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by