cca

computes canonical correlation analysis between leftVar and rightVar.

leftVar rightVar {weight1} {weight2} [ Tgrid ... ] pm qm cca

Arguments
labeltypedescription
leftVar variable Variable with same time dimension as predicand
rightVar variable Variable with same time dimension as predictor
weight1 proc a procedure to be applied as weight for both right and left variables if no other optional procedure is set up, or for the left variable otherwise. (optional)
weight2 proc a procedure to be applied as weight for right variable. (optional)
Tgrid grid set Time grid
pm number Number of modes to keep from leftVar SVD.
qm number Number of modes to keep from rightVar SVD.
Returns
cca dataset Dataset containing CCA outputs
Here is a brief description of what the Canonical Corrlation Analysis does. The inputs of the function are italic and the outputs of the function are bold.
  1. Computes the Singular Value Decomposition (SVD) for leftVar (rightVar);
  2. reduces the left (right) space where leftVar (rightVar) covariance matrix is diagonal to the pm (qm) eigenvectors - Principal Components (PCs) - with the highest explained variance;
  3. computes the correlation matrix between the left and right PCs;
  4. finds the basis of orthonormal vectors r and s that diagonalize the correlation matrix into a matrix of which elements are the canonical correlations mu;
  5. projects the standardized singular values (representing the percentage of explained variance) of leftVar (rightVar) SVD on r (s) to form the left (right) explained variance exvarl (exvarr) showing how each CCA mode explains each of the original datasets;
  6. projects the left (right) PCs on r (s) to form unit variance canonical time series u (v);
  7. projects leftVar (rightVar) on the left (right) canonical time series u (v) to form the left (right) canonical patterns g (h).
Properties:
Example (note the use of shift data to have time series of different time grid actually match):
 SOURCES .NOAA .NCDC .ERSST .version2 .SST
   X (30E) (180) (80W) RANGE
   Y (30S) (30N) RANGE
   T (Sep-Nov 1961-2000) seasonalAverage
   dup [T]average sub
   T -3 shiftdata
 SOURCES .WCRP .GCOS .GPCC .FDP .version4 .0p5 .prcp
   X (118E) (128E) RANGE
   Y (5N) (20N) RANGE
   T (Dec-Feb 1961-2001) seasonalAverage
   dup [T]average sub
 [T]15 10 cca