Page 1 of 1

PCA - Getting back to orginal data

Posted: Sun Aug 04, 2013 9:05 am
by garyyau
Hi regarding PCA I hope to transform the scores back to original data format using the top 3 PCs

I am quite new to the software (version 7) and am not aware that there is a function for this

Instead I was hoping to multiply the scores by the inverse the eigenvector matrix but the answer didnt look quite right (I transpose both the eigenvector matrix and the score matrix produced by the PCA function. I believe this is right?)

I am guessing that this is because operations has been done before PCA produce the eigenvector and scores (centering etc.)

Any tips on this? Thank you very much.

Re: PCA - Getting back to orginal data

Posted: Wed Aug 14, 2013 8:19 am
by EViews Glenn
There's a make principal components scores proc off of a group.

Re: PCA - Getting back to orginal data

Posted: Thu Aug 15, 2013 9:04 am
by garyyau
There's a make principal components scores proc off of a group.
Hi Thanks for the reply.

Did you mean I could create the scores?

If so I have created the scores already. I am looking to going back to the original data using only PC 1 2 3

i.e. Let S = scores, E = eigenvector matrix, X = data

I got S = EX and I am hoping to get X = E^(-1)S but only using PC 1 2 3 rather than the whole E.

Thanks again

Re: PCA - Getting back to orginal data

Posted: Thu Aug 15, 2013 11:28 am
by EViews Glenn
Tell EViews to retain only the first three components when you make the scores. See the docs for more details.

Re: PCA - Getting back to orginal data

Posted: Fri Aug 16, 2013 10:00 am
by garyyau
Tell EViews to retain only the first three components when you make the scores. See the docs for more details.
Hi thanks for the reply

The issue I am facing is after i created the matrix E with full eigenvectors / components, E^(-1)S did not produce the orignial data so I would imagine that doing E^(-1)S with PC 1 2 3 would not give the right answer neither

I am guessing that the original data had some operation done on it (e.g. centering etc.) so E^(-1)S would only give the modified original data, if you see what I mean. In a sense I am wondering if there is anyway to un-do those operations after E^(-1)S.

Thanks and sorry I did not make myself clear.

Re: PCA - Getting back to orginal data

Posted: Mon Aug 19, 2013 6:59 am
by CharlieEVIEWS
I have also been wondering about this and cannot quite decipher the official EViews documentation (and accompanying theory): If I am not mistaken, the default .makepcomp(cov=corr) means EViews automatically standardizes the loadings, meaning we don't have to do something like:

Code: Select all

variable-@mean(variable)/@stdev(variable)
in a pre-amble to the .makepcomp command. However,if we were specifying the covariance option 'cov=cov', this would be necessary. Is that correct?

Thanks as always for clearing up my confusion!

Charlie

Re: PCA - Getting back to orginal data

Posted: Mon Aug 19, 2013 10:05 am
by EViews Glenn
makepcomp mimics whatever the original transformation was in order to do the computation, since that is what the eigenvalues/vectors are dependent on. If you are doing correlations, then we first standardize prior to computing the scores. For covariances, we'll demean but not scale since the computation of the components is unscaled.

What we say in the docs is...

Code: Select all

...EViews will transform the Y to match the data used in the original computation. For example, the data will be scaled for analysis of correlation matrices, and partialing will remove means and any conditioning variables. Similarly, if the preliminary analysis involves Spearman rank-order correlations, the data are transformed to ranks prior to partialing.