Skip to content

Unexplained behaviour with prinComp and grid2PCs #15

@matteodefelice

Description

@matteodefelice

Hi,
I was planning to use prinComp and grid2PCs 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:

rm(list = ls())
library(transformeR)
load(file = 'monthly-erain.rda')
orig_princomp <- prinComp(obs, 4)
get_pc <- PC2grid(orig_princomp)

# reapply on the same grid
reapplied_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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions