[R] PCA + x-validation

From: steven wilson <swpt07_at_gmail.com>
Date: Thu, 7 Feb 2008 00:43:22 -0500

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


R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 07 Feb 2008 - 08:43:10 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 07 Feb 2008 - 09:30:12 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive