I am wondering if I can use the results of EOF to "predict" the EOF loadings of a second set of data?

I have a data set $X$ that consists of sampled light spectra (each column represents a sample and each row is the amplitude of the spectra at a given wavelength). So I first construct a covariance matrix of my data:


This is then decomposed using an eigendecomposition:

$C=E \lambda E^T$

with $E$ being the EOF loadings. I then project my data $X$ onto the loadings to get the principal components $Z$ :

$Z = XE$

Now my question is if I can use the results of the EOF to project a second set of spectra data $Y$ into EOF loadings $E_{\mathrm{pred}}$ using the principal components $Z$ :

$ZY^{-1} = E_{\mathrm{pred}}$

I haven't come across EOF being used in such a way (e.g. as a predictive model) but, given the amount of literature around EOF and PCA, I'm probably just missing something. Is there a problem with this approach? Does anyone know of examples using such EOF as a predictive model?

Many thanks for any advice.

  • $\begingroup$ Is $Y$ always a square matrix? $\endgroup$
    – user10525
    May 22, 2012 at 12:52
  • $\begingroup$ No, $Y$ has the same number of rows as $X$, allowing for its projection onto $Z$. Also, in case you were wondering, $Y^{-1}$ is calculated as the pseudoinverse of $Y$. $\endgroup$ May 22, 2012 at 13:09
  • 1
    $\begingroup$ Confused; $\mathbf{Y}$ should have the same columns as $\mathbf{X}$ for prediction/projection. The EOFs or PCs are linear combinations of the the columns in the original data (the variables). IIRC, the predicted location in the reduced space is the weighted sum of the variable scores on EOFs 1 & 2, the weights coming from the values of the new data $\mathbf{Y}$. See ?predict.prcomp in R as one example. $\endgroup$ May 23, 2012 at 8:12
  • $\begingroup$ @Gavin Simpson - thanks for your reply. I got a similar suggestion through the r-sig-ecology forum. I probably should have specified the dimensions of the matrices - $X$ is an m X n matrix with m variables and n samples. Therefore, $E$ will be the weights of the EOFs (an n X n matrix) and $Z$ will be the EOF coefficients (an m X n matrix), which is just the projection of the data $X$ onto $E$. My question dealt with the projection of the second set of data $Y$ (an m X p) matrix (i.e. a different number of samples p, but same number of variables m) onto $Z$. Thus, $E_{pred}$ is a p X n matrix. $\endgroup$ May 23, 2012 at 8:35

1 Answer 1


I have received an answer through another forum that indicates that this is a common practice - "Basic R stats functions like prcomp have a predict method that can be used to "predict" (calculate) scores with 'newdata'. This is standard, and has been in R for ever. Most textbooks of multivariate analysis should handle this issue."


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.