CCA: General function for quickly performing canonical correlation...

Description Usage Arguments Value

Description

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.

Usage

1
CCA(X, Y)

Arguments

X

m by n_1 matrix

Y

m by n_2 matrix

Value

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 ])


cozygene/CONFINED documentation built on June 17, 2019, 5:13 p.m.