[R] PCA + x-validation

steven wilson swpt07 at gmail.com
Thu Feb 7 06:43:22 CET 2008


Dear all;

Does anyone have implemented a function for cross-validation in PCA? I
know of one in the package pcaMethods but it doesn't work as I need.
Assuming there's no one available, I tried to write a function for
doing CV using prcomp but I'm not sure to understand how to obtain the
PRESS error. I know that PRESS in PCA can be calculated as the
(x-xhat)^2, but how can I obtain xhat? I used predict.prcomp but what
I get is the predicted scores of the sample not included in the PC
model and no xhat really, am I wrong?

Any suggestions will be more than appreciated

SW



More information about the R-help mailing list