From: Giorgos Tzampanakis on
How can I use the loadings returned by princomp to project new
data to the space given by them?

For example, I have a set of data that I give to princomp and
obtain the loadings and the projected data to the PCA space. Now
I have a new set of data, and I want to project it to the same
space. How can I do that?
From: Doug Schwarz on
In article <Xns9D48CDD33DC77fdnbgui7uhu5h8hrnuio(a)127.0.0.1>,
Giorgos Tzampanakis <gt67(a)hw.ac.uk> wrote:

> How can I use the loadings returned by princomp to project new
> data to the space given by them?
>
> For example, I have a set of data that I give to princomp and
> obtain the loadings and the projected data to the PCA space. Now
> I have a new set of data, and I want to project it to the same
> space. How can I do that?

[coeff,scores_x] = princomp(x);
scores_y = y*coeff;

You might want to subtract the column means from y first.

--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.