cca.predict {telefit} | R Documentation |
Make predictions using canonical correlation analysis (CCA)
Description
Canonical correlation analysis (CCA) is sometimes referred to as a
double-barreled principal component analysis. Loosely, it fits a linear
regression model to the scores of principal component decompositions for
of the predictors X
and responses Y
. Oftentimes, only the
largest k
principal components are used to make predictions.
Usage
cca.predict(X, Y, X.new, k.x, k.y)
Arguments
X |
An |
Y |
An |
X.new |
An |
k.x |
An integer less than |
k.y |
An integer less than |
Details
CCA has been used to predict a teleconnected response (like precipitation) using the remote field generating the teleconnection (like ocean temperatures). In this application, principal components are often referred to as empirical orthogonal functions (EOFs).
Value
Y.new Predicted values for Y.new
References
Cook, E.R., Briffa, K.R., and Jones, P.D., 1994, Spatial regression methods in dendroclimatology: A review and comparison of two techniques: International Journal of Climatology, v. 14, p. 379-402.
Glahn, H.R., 1968, Canonical Correlation and Its Relationship to Discriminant Analysis and Multiple Regression: Journal of the Atmospheric Sciences, v. 25, p. 23-31.
Examples
data("coprecip")
attach(coprecip)
# compute CCA predictions of Y (CO precipitation) given Z (Pacific ocean SSTs)
# using 2 principal components (aka. EOFs)
preds = cca.predict(X = Z, Y = Y, X.new = Z, k.x = 2, k.y = 2)
# compute R^2
1 - var(as.numeric(preds-Y)) / var(as.numeric(Y))