Skip to content

Principal Components (and EOFs)

miturbide edited this page Oct 6, 2016 · 6 revisions

EOF analysis

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] Done

The 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")

<-- Home page of the Wiki

`

Clone this wiki locally