Description Usage Arguments Value
This function performs CCA on two matrices. As input, it takes
two matrices, X and Y, of size m by n_1 and
m by n_2 respectively, where m > n_1,n_2 (i.e., both
matrices have the same number of rows, but not necessarily the same
number of columns and the number of rows is greater than the number of columns).
This code is based on the algorithm by Gonzalez and Dejean from the package 'CCA
,'
we just simply translated it to C++ using functions from RcppArmadillo for speed.
The canonical variables are returned in decreasing order of correlation.
See https://github.com/cozygene/CONFINED
for more info.
1 | CCA(X, Y)
|
X |
m by n_1 matrix |
Y |
m by n_2 matrix |
A - the loadings for X
B - the loadings for Y
U - canonical variables of X, calculated by column centering X and projecting it on A
V - canonical variables of Y, calculated by column centering Y and projecting it on B
cors - the correlations of each corresponding pair of canonical variables e.g. cors[ i ] = cor(U[, i ], V[, i ])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.