CCA: Canonical correlation analysis

Description Usage Arguments Value Author(s) Examples

Description

Applies a canonical correlation analysis (CCA) to two data sets. The CCA here can be carried out based on an svd based approach (after Bretherton et al. (1992), J. Clim. Vol 5, p. 541, also documented in Benestad (1998): "Evaluation of Seasonal Forecast Potential for Norwegian Land Temperatures and Precipitation using CCA", DNMI KLIMA Report 23/98 at http://met.no/english/r_and_d_activities/publications/1998.html) or ii) a covariance-eigenvalue approach (after Wilks, 1995, "Statistical methods in the Atmospheric Sciences", Academic Press, p. 401).

The analysis can also be applied to either EOFs or fields.

Note: the analysis has sometimes been somewhat unstable, returning inconsistent results. The recommendation is to use EOFs and SVD option.

The CCA analysis can be used to develope statistical models according to:

Y = Psi X

Where Y is the predictand and X the predictor. plotCCA plots the CCA results, testCCA is for code verification, and Psi returns the matrix

Psi

.

stations2field turns a group of station objects into a field by the means of a simple and crude interpolation/gridding. check.repeat is a quality-control function that eliminates repeated years in the station objects.

Try the same type of argument as in lm (' y ~ x, data= ')

Usage

1
2
3
4
5
6
7
8
9
CCA(Y,X,...)
CCA.default(Y,X,...) 
CCA.eof(Y,X,i.eofs=1:8)
CCA.pca(Y,X,i.eofs=1:8)
CCA.field(Y,X,i.eofs=1:8)
test.cca(method="CCA",reconstr=FALSE,mode=1,test=TRUE,LINPACK=TRUE,
         SVD=TRUE,n.pc=4,synthetic=TRUE)

predict.CCA <- function(object, newdata=NULL, ...)

Arguments

Y

An object with climate data: field, eof, pca.

X

Same as Y.

SVD

Use a singular value decomposition as a basis for the PCA.

i.eofs

Which EOFs to include in the CCA.

LINPACK

an option for svd.

object

The result from CCA.

newdata

The same as X.

Value

A CCA object: a list containing a.m, b.m, u.k, v.k, and r, describing the Canonical Correlation variates, patterns and correlations. a.m and b.m are the patterns and u.k and v.k the vectors (time evolution).

Author(s)

R.E. Benestad

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# CCA with two eofs
slp <- slp.NCEP(lat=c(-40,40),anomaly=TRUE)
sst <- sst.NCEP(lat=c(-40,40),anomaly=TRUE)
eof.1 <- EOF(slp,it=1)
eof.2 <- EOF(sst,it=1)
cca <- CCA(eof.1,eof.2)
plot(cca)

# CCA with PCA and EOF:
NACD <- station.nacd()
plot(annual(NACD))
map(NACD,fun="sd")
pca <- PCA(NACD)
plot(pca)
naslp <- slp.NCEP(lon=c(-30,40),lat=c(30,70),anomaly=TRUE)
map(naslp)
eof <- EOF(naslp,mon=1)
nacca <- CCA(pca,eof)
plot(nacca)

metno/esd.test documentation built on May 22, 2019, 7:49 p.m.