You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rm(list= ls())
library(transformeR)
load(file='monthly-erain.rda')
orig_princomp<- prinComp(obs, 4)
get_pc<- PC2grid(orig_princomp)
# reapply on the same gridreapplied_princomp= grid2PCs(orig_princomp, obs)
# compare PCs
plot(reapplied_princomp[[1]][,1] ~get_pc$Data[1,,1,1])
If I use grid2PCs on the same grid file used to compute the prinComp I would expect to have the same identical PCs, am I wrong? Instead they are similar but not identical, what happens here?
The text was updated successfully, but these errors were encountered:
Because you are retaining the first 4 EOFs, you are not capturing the whole variance, but just a large proportion of it. Therefore, when you recover the original field from the PCs, the recovered field is not identical to the original one (it is very similar though...). Try to set the explained variance to 100% and you should obtain exactly the same grid (setting aside minor rounding errors...):
Hi,
I was planning to use
prinComp
andgrid2PCs
to implement a sort of cross-validation for the use of PCA with seasonal forecasts.Here the grid test file I have used: https://www.dropbox.com/s/a699e6wq4zae0vm/monthly-erain.rda?dl=0
Here a reproducible example:
If I use
grid2PCs
on the same grid file used to compute theprinComp
I would expect to have the same identical PCs, am I wrong? Instead they are similar but not identical, what happens here?The text was updated successfully, but these errors were encountered: