-
Notifications
You must be signed in to change notification settings - Fork 8
Principal Components (and EOFs)
It is a standard practice in atmospheric science to apply principal component analysis (PCA, a.k.a. EOF analysis) to the predictors, eliminating the large amount of redundant information while minimizing the loss of variability, being therefore an efficient technique for reduction of data dimensionality. There is an example on the use of EOFs for downscaling in the wiki of downscaleR.
In transformeR, the PCA/EOF analysis is undertaken by the prinComp function and related methods (gridFromPCs, plotEOF...).
In this example, two different variables, are merged forming a multigrid with makeMultiGrid.
data(NCEP_Iberia_tp)
data(NCEP_Iberia_tas)
pred <- makeMultiGrid(NCEP_Iberia_tas, NCEP_Iberia_tp)
###Principal Components and EOFs
Here, a PCA is performed to the multifield previously loaded. In this example, we will retain the PCs explaining the 90% of the variability of each field (although note that it is also possible to retain all PCs, or a user-defined number of them: type help("prinComp") for details).
pca.pred <- prinComp(pred, v.exp = .90)
## [2016-03-03 15:32:45] Performing PC analysis on 2 variables plus their combination...
## [2016-03-03 15:32:45] DoneThe main spatial modes after the PCA can be visually inspected using the plotEOF function. For instance, for sea-level pressure these are all the EOFs obtained:
plotEOF(pca.pred, "tp")And these are only the first two EOFs:
plotEOF(pca.pred, "tp", n.eofs = 2)###Grid from PCs
The inverse operation is done with function gridFromPCs:
tp <- gridFromPCs(pca.pred, var = "tp")`

- Package Installation
- Included illustrative datasets
- Standard data manipulation
- Principal Components (and EOFs)
- Circulation and Weather Typing

