
A command that creates a canonical correlation object from the selected SSCP object.
The partition for the square SSCPmatrix is as follows:
The canonical correlation equations we have to solve are:
(1) (S_{yx} S_{xx}^{1} S_{yx}′ λ S_{yy})y = 0 
(2) (S_{yx}′ S_{yy}^{1} S_{yx} λ S_{xx})x = 0 
where S_{yy} [ny × ny] and S_{xx} [nx × nx] are symmetric, positive definite matrices belonging to the dependent and the independent variables, respectively.
These two equations are not independent and we will show that both equations have the same eigenvalues and that the eigenvectors x for equation (2) can be obtained from the eigenvectors y of equation (1).
We can solve equation (1) in several ways, however, the numerically stablest algorithm is probably by performing first a Cholesky decomposition of S_{xx} and S_{yy}, followed by a generalized singular value decomposition. The algorithm goes as follows:
The Cholesky decompositions ("square roots") of S_{yy} and S_{xx} are:
S_{yy} = U′ U and S_{xx} = H′ H, 
where U and H are upper triangular matrices. From these decompositions, the inverse for S_{xx}^{1} is easily computed. Let K be the inverse of H, then we can write:
S_{xx}^{1} = K K′. 
We next substitute in equation (1) and rewrite as:
((K′S_{yx}′)′ (K′S_{yx}′)  λ U′ U)x = 0 
This equation can be solved for eigenvalues and eigenvectors by the generalized singular value decomposition because it is of the form A′A λ B′B.
Now, given the solution for equation (1) we can find the solution for equation (2) by first multiplying (1) from the left with S_{yx}′S_{yy}^{1}, resulting in:
(S_{yx}′S_{yy}^{1}S_{yx}S_{xx}^{1}S_{yx}′ λ S_{yx}′) y = 0 
Now we split of the term S_{xx}^{1}S_{yx}′ and obtain:
(S_{yx}′S_{yy}^{1}S_{yx}  λ S_{xx}) S_{xx}^{1}S_{yx}′ y = 0 
This equation is like equation (2) and it has therefore the same eigenvalues and eigenvectors. (We also proved this fact in the algorithmic section of TableOfReal: To CCA....)
The eigenvectors x is now
x = S_{xx}^{1}S_{yx}′ y. 
© djmw 20031103