A whitening approach to probabilistic canonical correlation analysis for omics data integration

Background Canonical correlation analysis (CCA) is a classic statistical tool for investigating complex multivariate data. Correspondingly, it has found many diverse applications, ranging from molecular biology and medicine to social science and finance. Intriguingly, despite the importance and pervasiveness of CCA, only recently a probabilistic understanding of CCA is developing, moving from an algorithmic to a model-based perspective and enabling its application to large-scale settings. Results Here, we revisit CCA from the perspective of statistical whitening of random variables and propose a simple yet flexible probabilistic model for CCA in the form of a two-layer latent variable generative model. The advantages of this variant of probabilistic CCA include non-ambiguity of the latent variables, provisions for negative canonical correlations, possibility of non-normal generative variables, as well as ease of interpretation on all levels of the model. In addition, we show that it lends itself to computationally efficient estimation in high-dimensional settings using regularized inference. We test our approach to CCA analysis in simulations and apply it to two omics data sets illustrating the integration of gene expression data, lipid concentrations and methylation levels. Conclusions Our whitening approach to CCA provides a unifying perspective on CCA, linking together sphering procedures, multivariate regression and corresponding probabilistic generative models. Furthermore, we offer an efficient computer implementation in the “whitening” R package available at https://CRAN.R-project.org/package=whitening.

In its original formulation CCA is viewed as an algorithmic procedure optimizing a set of objective functions, rather than as a probablistic model for the data. Only relatively recently this perspective has changed. Bach and Jordan [5] proposed a latent variable model for CCA building on earlier work on probabilistic principal component analysis (PCA) by [6]. The probabilistic approach to CCA not only allows to derive the classic CCA algorithm but also provide an avenue for Bayesian variants [7,8].
In parallel to establishing probabilistic CCA the classic CCA approach has also been further developed in the last decade by introducing variants of the CCA algorithm that are more pertinent for high-dimensional data sets now routinely collected in the life and physical sciences. In particular, the problem of singularity in the original CCA algorithm is resolved by introducing sparsity and regularization [9][10][11][12][13] and, similarly, large-scale computation is addressed by new algorithms [14,15].
In this note, we revisit both classic and probabilistic CCA from the perspective of whitening of random variables [16]. As a result, we propose a simple yet flexible probabilistic model for CCA linking together multivariate regression, latent variable models, and high-dimensional estimation. Crucially, this model for CCA not only facilitates comprehensive understanding of both classic and probabilistic CCA via the process of whitening but also extends CCA by allowing for negative canonical correlations and providing the flexibility to include non-normal latent variables.
The remainder of this paper is as follows. First, we present our main results. After reviewing classical CCA we demonstrate that the classic CCA algorithm is special form of whitening. Next, we show that the link of CCA with multivariate regression leads to a probabilistic two-level latent variable model for CCA that directly reproduces classic CCA without any rotational ambiguity. Subsequently, we discuss our approach by applying it to both synthetic data as well as to multiple integrated omics data sets. Finally, we describe our implementation in R and highlight computational and algorithmic aspects.
Much of our discussion is framed in terms of random vectors and their properties rather than in terms of data matrices. This allows us to study the probabilistic model underlying CCA separate from associated statistical procedures for estimation.

Multivariate notation
We consider two random vectors X = X 1 , . . . , X p T and Y = Y 1 , . . . , Y q T of dimension p and q. Their respective multivariate distributions F X and F Y have expectation E(X) = μ X and E(Y ) = μ Y and covariance var(X) = X and var(Y ) = Y . The cross-covariance between X and Y is given by cov(X, Y ) = XY . The corresponding correlation matrices are denoted by P X , P Y , and P XY . By V X = diag( X ) and V Y = diag( Y ) we refer to the diagonal matrices containing the variances only, allowing to decompose covariances as Vector-valued samples of the random vectors X and Y are denoted by x i and y i so that (x 1 , . . . , x i , . . . , x n ) T is the n×p data matrix for X containing n observed samples (one in each row). Correspondingly, the empirical mean for X is given byμ X =x = 1 n n i=1 x i , the unbiased covariance estimate is X = S X = 1 and the corresponding correlation estimate is denoted by P X = R X .

Results
We first introduce CCA from a classical perspective, then we demonstrate that CCA is best understood as a special and uniquely defined type of whitening transformation. Next, we investigate the close link of CCA with multivariate regression. This not only allows to interpret CCA as regression model and to better understand canonical correlations, but also provides the basis for a probabilistic generative latent variable model of CCA based on whitening. This model is introduced in the last subsection.

Classical CCA
In canonical correlation analysis the aim is to find mutually orthogonal pairs of maximally correlated linear combinations of the components of X and of Y . Specifically, we seek canonical directions α i and β j (i.e. vectors of dimension p and q, respectively) for which where λ i are the canonical correlations, and simultaneously and In matrix notation, with A = α 1 , . . . , α p T , B = β 1 , . . . , β q T , and = diag(λ i ), the above can be written as cor(AX, BY ) = as well as cor(AX) = I and cor(BY ) = I. The projected vectors AX and BY are also called the CCA scores or the canonical variables. Hotelling (1936) [1] showed that there are, assuming full rank covariance matrices X and Y , exactly m = min(p, q) canonical correlations and pairs of canonical directions α i and β i , and that these can be computed analytically from a generalized eigenvalue problem (e.g., [2]). Further below we will see how canonical directions and correlations follow almost effortlessly from a whitening perspective of CCA.
Since correlations are invariant against rescaling, optimizing Eq. 1 determines the canonical directions α i and β i only up to their respective lengths, and we can thus arbitrarily fix the magnitude of the vectors α i and β i . A common choice is to simply normalize them to unit length so that α T i α i = 1 and β T i β i = 1. Similarly, the overall sign of the canonical directions α i and β j is also undetermined. As a result, different implementations of CCA may yield canonical directions with different signs, and depending on the adopted convention this can be used either to enforce positive or to allow negative canonical correlations, see below for further discussion in the light of CCA as a regression model.
Because it optimizes correlation, CCA is invariant against location translation of the original vectors X and Y , yielding identical canonical directions and correlations in this case. However, under scale transformation of X and Y only the canonical correlations λ i remain invariant whereas the directions will differ as they depend on the variances V X and V Y . Therefore, to facilitate comparative analysis and interpretation the canonical directions the random vectors X and Y (and associated data) are often standardized.
Classical CCA uses the empirical covariance matrix S to obtain canonical correlations and directions. However, S can only be safely employed if the number of observations is much larger than the dimensions of either of the two random vectors X and Y , since otherwise S constitutes only a poor estimate of the underlying covariance structure and in addition may also become singular. Therefore, to render CCA applicable to small sample highdimensional data two main strategies are common: one is to directly employ regularization on the level of the covariance and correlation matrices to stabilize and improve their estimation; the other is to devise probabilistic models for CCA to facilitate application of Bayesian inference and other regularized statistical procedures.

Background on whitening
Whitening, or sphering, is a linear statistical transformation that converts a random vector X with covariance matrix X into a random vector X = W X X (4) with unit diagonal covariance var X = X = I p . The matrix W X is called the whitening matrix or sphering matrix for X, also known as the unmixing matrix. In order to achieve whitening the matrix W X has to satisfy the condition W X X W T X = I p , but this by itself is not sufficient to completely identify W X . There are still infinitely many possible whitening transformations, and the family of whitening matrices for X can be written as Here, Q X is an orthogonal matrix; therefore the whitening matrix W X itself is not orthogonal unless P X = V X = I p .
The choice of Q X determines the type of whitening [16]. For example, using Q X = I p leads to ZCA-cor whitening, also known as Mahalanobis whitening based on the correlation matrix. PCA-cor whitening, another widely used sphering technique, is obtained by setting Q X = G T , where G is the eigensystem resulting from the spectral decomposition of the correlation matrix P X = G G T . Since there is a sign ambiguity in the eigenvectors G we adopt the convention of [16] to adjust columns signs of G, or equivalently row signs of Q x , so that the rotation matrix Q X has a positive diagonal. The corresponding inverse relation X = W −1 X X = T X X is called a coloring transformation, where the matrix W −1 X = T X is the mixing matrix, or coloring matrix that we can write in terms of rotation matrix Q X as Like W X the mixing matrix X is not orthogonal. The entries of the matrix X are called the loadings, i.e. the coefficients linking the whitened variable X with the original x. Since X is a white random vector with cov X = I p the loadings are equivalent to the covariance cov X, X = X . The corresponding correlations, also known as correlation-loadings, are Note that the sum of squared correlations in each column of X sum up to 1, as diag T X X = diag(P X ) = I p .

CCA whitening
We will show now that CCA has a very close relationship to whitening. In particular, the objective of CCA can be seen to be equivalent to simultaneous whitening of both X and Y , with a diagonality constraint on the cross-correlation matrix between the whitened X and Y . First, we make the choice to standardize the canonical directions α i and β i according to var As a result α i and β i form the basis of two whitening matrices, rows containing the canonical directions. The length constraint α T i X α i = 1 thus becomes W X X W T X = I p meaning that W X (and W Y ) is indeed a valid whitening matrix.
Second, after whitening X and Y individually to X and Y using W X and W Y , respectively, the joint covariance Note that whitening of X T , Y T T simultaneously would in contrast lead to a fully diagonal covariance matrix. In the above P X Y = cor X, Y = cov X, Y is the cross-correlation matrix between the two whitened vectors and can be expressed as and Following the terminology in [17] we may call K the correlation-adjusted cross-correlation matrix between X and Y .
With this setup the CCA objective can be framed simply as the demand that cor X, Y = P X Y must be diagonal. Since in whitening the orthogonal matrices Q X and Q Y can be freely selected we can achieve diagonality of P X Y and hence pinpoint the CCA whitening matrices by applying singular value decomposition to This provides the rotation matrices Q CCA X and the Q CCA Y of dimensions m × p and m × q, respectively, and the m × m matrix = diag(λ i ) containing the singular values of K , which are also the singular values of P X Y . Since m = min(p, q) the larger of the two rotation matrices will not be a square matrix but it can nonetheless be used for whitening via Eqs. 4 and 5 since it still is semi-orthogonal with Q CCA . Thus, the distinctive feature of CCA whitening, in contrast to other common forms of whitening described in [16], is that by construction it is not only informed by P X and P Y but also by P XY , which fixes all remaining rotational freedom.

CCA and multivariate regression Optimal linear multivariate predictor
In multivariate regression the aim is to build a model that, given an input vector X, predicts a vector Y as well as possible according to a specific measure such as squared error. Assuming a linear relationship Y = a + b T X is the predictor random variable, with mean E(Y ) = μ Y = a + b T μ X . The expected squared difference between Y and Y , i.e. the mean squared prediction error is a natural measure of how well Y predicts Y . As a function of the model parameters a and b the predictive MSE becomes Optimal parameters for best linear predictor are found by minimizing this MSE function. For the offset a this yields which regardless of the value of b . ensures μ Y − μ Y = 0. Likewise, for the matrix of regression coefficients minimization results in b all = −1 X XY (14) with XY . If we exclude predictors from the model by setting regression coefficients b zero = 0 then the corresponding optimal intercept is a zero = μ Y and the minimum achieved MSE a zero , b zero = Tr( Y ). Thus, by adding predictors X to the model the predictive MSE is reduced, and hence the fit of the model correspondingly improved, by the amount If the response Y is univariate (q = 1) then reduces to the variance-scaled coefficient of determination σ 2 Y P Y X P −1 X P XY . Note that in the above no distributional assumptions are made other than specification of means and covariances.

Regression view of CCA
The first step to understand CCA as a regression model is to consider multivariate regression between two whitened vectors X and Y (considering whitening of any type, including but not limited to CCA-whitening). Since X = I p and X Y = P X Y the optimal regression coefficients to predict Y from X are given by i.e. the pairwise correlations between the elements of the two vectors X and Y . Correspondingly, the decrease in predictive MSE due to including the predictors X is In the special case of CCA-whitening the regression coefficients further simplify to b all ii = λ i , i.e. the canonical correlations λ i act as the regression coefficients linking CCA-whitened Y and X. Furthermore, as the decrease in predictive MSE is the sum of the squared canonical correlations (cf. Eq. 17), each λ 2 i can be interpreted as the variable importance of the corresponding variable in X CCA to predict the outcome Y CCA . Thus, CCA directly results from multivariate regression between CCA-whitened random vectors, where the canonical correlations λ i assume the role of regression coefficients and λ 2 i provides a natural measure to rank the canonical components in order of their respective predictive capability.
A key difference between classical CCA and regression is that in the latter both positive and negative coefficients are allowed to account for the directionality of the influence of the predictors. In contrast, in classical CCA only positive canonical correlations are permitted by convention. To reflect that CCA analysis is inherently a regression model we advocate here that canonical correlations should indeed be allowed to assume both positive and negative values, as fundamentally they are regression coefficients. This can be implemented by exploiting the sign ambiguity in the singular value decomposition of K (Eq. 10). In particular, the rows signs of Q CCA X and Q CCA Y and the signs of λ i can be revised simultaneously without affecting K . We propose to choose Q CCA X and Q CCA Y such that both rotation matrices have a positive diagonal, and then to adjust the signs of the λ i accordingly. Note that orthogonal matrices with positive diagonals are closest to the identity matrix (e.g. in terms of the Frobenius norm) and thus constitute minimal rotations.

Generative latent variable model for CCA
With the link of CCA to whitening and multivariate regression established it is straightforward to arrive at simple and easily interpretable generative probabilistic latent variable model for CCA. This model has two levels of hidden variables: it uses uncorrelated latent variables Z X , Z Y , Z shared (level 1) with zero mean and unit variance to generate the CCA-whitened variables X CCA and Y CCA (level 2) which in turn produce the observed vectors X and Y -see Fig. 1 Specifically, on the first level we have latent variables with E Z X = E Z Y = E Z shared = 0 and var Z X = I p , var Z Y = I q , and var Z shared = I m and no mutual correlation among the components of Z X , Z Y , and Z shared . The second level latent variables are then generated by mixing shared and non-shared variables according to where the parameters λ 1 , . . . , λ m can be positive as well as negative and range from -1 to 1. The components i > m are always non-shared and taken from Z X or Z Y as appropriate, i.e. as above but with λ i>m = 0. By construction, this results in var X Finally, the observed variables are produced by a coloring transformation and subsequent translation To clarify the workings behind Eq. 19 assume there are three uncorrelated random variables Z 1 , Z 2 , and Z 3 with mean 0 and variance 1. We construct X 1 as a mixture of Z 1 and Z 3 according to where α ∈[ 0, 1], and, correspondingly, X 2 as a mixture of Z 2 and Z 3 via X 2 = √ 1 − αZ 2 + √ αZ 3 . If α = 0 then X 1 = Z 1 and X 2 = Z 2 , and if α = 1 then X 1 = X 2 = Z 3 . By design, the new variables have mean zero (E(X 1 ) = E(X 2 ) = 0) and unit variance (var(X 1 ) = var(X 2 ) = 1). Crucially, the weight α of the latent variable Z 3 common to both mixtures induces a correlation between X 1 and X 2 . The covariance between X 1 and X 2 is cov(X 1 , X 2 ) = cov √ αZ 3 , √ αZ 3 = α, and since X 1 and Fig. 1 Probabilistic CCA as a two layer latent variable generative model. The middle layer contains the CCA-whitened variables X CCA and Y CCA , and the top layer the uncorrelated generative latent variables Z X , Z Y , and Z shared X 2 have variance 1 we have cor(X 1 , X 2 ) = α. In Eq. 19 this is further extended to allow a signed α and hence negative correlations. Note that the above probabilistic model for CCA is in fact not a single model but a family of models, since we do not completely specify the underlying distributions, only their means and (co)variances. While in practice we will typically assume normally distributed generative latent variables, and hence normally distributed observations, it is equally possible to employ other distributions for the first level latent variables. For example, a rescaled t-distribution with a wider tail than the normal distribution may be employed to obtain a robustified version of CCA [18].

Synthetic data
In order to test whether our algorithm allows to correctly identify negative canonical correlations we conducted simulations using simulated data. Specifically, we generated data X i and y i from a p + q dimensional multivariate normal distribution with zero mean and covariance The canonical correlations where set to have alternating positive and negative signs λ 1 = λ 3 = λ 5 = λ 7 = λ 9 = λ and λ 2 = λ 4 = λ 6 = λ 8 = λ 10 = −λ with varying strength λ ∈ {0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9}. A similar setup was used in [14]. The dimensions were fixed at p = 60 and q = 10 and the sample size was n ∈ {20, 30, 50, 100, 200, 500} so that both the small and large sample regime was covered. For each combination of n and λ the simulations were repeated 500 times, and our algorithm using shrinkage estimation of the underlying covariance matrices was employed to each of the 500 data sets to fit the CCA model. The resulting estimated canonical correlations were then compared with the corresponding true canonical correlations, and the proportion of correctly estimated signs was recorded.
The outcome from this simulation study is summarized graphically in Fig. 2. The key finding is that, depending on the strength of correlation λ and sample size n, our algorithm correctly determines the sign of both negative and positive canonical correlations. As expected, the proportion of correctly classified canonical correlations increases with sample size and with the strength of correlation. Remarkably, even for comparatively weak correlation such as λ = 0.5 and low sample size still the majority of canonical correction were estimated with the true sign. In short, this simulation demonstrates that if there are negative canonical correlations between pairs of canonical variables these will be detected by our approach.

Nutrimouse data
We now analyze two experimental omics data sets to illustrate our approach. Specifically, we demonstrate the capability of our variant of CCA to identify negative canonical correlations among canonical variates as well its application to high-dimensional data where the number of samples n is smaller than the number of variables p and q.
The first data set is due to [19] and results from a nutrigenomic study in the mouse studying n = 40 animals. The X variable collects the measurements of the gene expression of p = 120 genes in liver cells. These were selected a priori considering the biological relevance for the study. The Y variable contains lipid concentrations of q = 21 hepatic fatty acids, measured on the same animals. Before further analysis we standardized both X and Y .
Since the number of available samples n is smaller than the number of genes p we used shrinkage estimation to obtain the joint correlation matrix which resulted in a shrinkage intensity of λ cor = 0.16. Subsequently, we computed canonical directions and associated canonical correlations λ 1 , . . . , λ 21 . The canonical correlations are shown in Fig. 3, and range in value between -0.96 and 0.87. As can be seen, 16 of the 21 canonical correlations are negative, including the first three top ranking correlations. In Fig. 4 we depict the squared correlation loadings between the first 5 components of the canonical covariates X CCA and Y CCA and the corresponding observed variables X and Y . This visualization shows that most information about the correlation structure within and between the two data sets (gene expression and lipid concentrations) is concentrated in the first few latent components. This is confirmed by further investigation of the scatter plots both between corresponding pairs of X CCA and Y CCA canonical variates (Fig. 5) as well as within each variate (Fig. 6). Specifically, the first CCA component allow to identify the genotype of the mice (wt: wild type; ppar: PPAR-α deficient) whereas the subsequent few components reveal the imprint of the effect of the various diets (COC: coconut oil; FISH: fish oils; LIN: linseed oils; REF: reference diet; SUN: sunflower oil) on gene expression and lipid concentrations.

The Cancer Genome Atlas LUSC data
As a further illustrative example we studied genomic data from The Cancer Genome Atlas (TCGA), a public resource that catalogues clinical data and molecular characterizations of many cancer types [20]. We used the TCGA2STAT tool to access the TCGA database from within R [21]. Specifically, we retrieved gene expression (RNASeq2) and methylation data for lung squamous cell carcinoma (LUSC) which is one of the most common types of lung cancer. After download, calibration and filtering as well    as matching the two data types to 130 common patients following the guidelines in [21] we obtained two data matrices, one (X) measuring gene expression of p = 206 genes and one (Y ) containing methylation levels corresponding to q = 234 probes. As clinical covariates the sex of each of the 130 patients (97 males, 33 females) was downloaded as well as the vital status (46 events in males, and 11 in females) and cancer end points, i.e. the number of days to last follow-up or the days to death. In addition, since smoking cigarettes is a key risk factor for lung cancer, the number of packs per year smoked was also recorded. The number of packs ranged from 7 to 240, so all of the patients for which this information was available were smokers. As above we applied the shrinkage CCA approach to the LUSC data which resulted in a correlation shrinkage intensity of λ cor = 0.19. Subsequently, we computed canonical directions and associated canonical correlations λ 1 , . . . , λ 21 . The canonical correlations are shown in Fig. 7, and range in value between -0.92 and 0.98. Among the top 10 strongest correlated pairs of canonical covariates only one has a negative coefficient. The plot of the squared correlation loadings (Fig. 8) for these 10 components already indicates that the data can be sufficiently summarized by a few canonical covariates.
Scatter plots between the first pair of canonical components and between the first two components of X CCA are presented in Fig. 9. These plots show that the first canonical component corresponds to the sex of the patients, with males and females being clearly separated by underlying patterns in gene expression and methylation. The survival probabilities computed for both groups show that there is a statistically significant different risk pattern between males and females (Fig. 10). However, inspection of the second order canonical variates reveals that the difference in risk is likely due to overrepresentation of strong smokers in male patients rather than being directly attributed to the sex of the patient (Fig. 9 right).

Conclusions
CCA is crucially important procedure for integration of multivariate data. Here, we have revisited CCA from the perspective of whitening that allows a better understanding of both classical CCA and its probabilistic variant. In particular, our main contributions in this paper are: • first, we show that CCA is procedurally equivalent to a special whitening transformation, that unlike other general whitening procedures, is uniquely defined and without any rotational ambiguity; • second, we demonstrate the direct connection of CCA with multivariate regression and demonstrate that CCA is effectively a linear model between whitened variables, and that correspondingly canonical correlations are best understood as regression coefficients; • third, the regression perspective advocates for permitting both positive and negative canonical correlations and we show that this also allows to resolve the sign ambiguity present in the canonical directions; • fourth, we propose an easily interpretable probabilistic generative model for CCA as a two-layer latent variable framework that not only admits canonical correlations of both signs but also allows non-normal latent variables; • and fifth, we provide a computationally effective computer implementation in the "whitening" R package based on high-dimensional shrinkage estimation of the underlying covariance and correlation matrices and show that this approach performs well both for simulated data as well as in application to the analysis of various types of omics data.
In short, this work provides a unifying perspective on CCA, linking together sphering procedures, multivariate regression and corresponding probabilistic generative  Scatter plots between first component of X CCA and Y CCA (left) and within the first two components of X CCA (right) for the TCGA LUSC data models, and also offers a practical tool for highdimensional CCA for practitioners in applied statistical data analysis.

Implementation in R
We have implemented our method for high-dimensional CCA allowing for potential negative canonical correlations in the R package "whitening" that is freely available from https://CRAN.R-project.org/package=whitening. The functions provided in this package incorporate the computational efficiencies described below. The R package also includes example scripts. The "whitening" package has been used to conduct the data analysis described in this paper. Further information and R code to reproduce the analyses in this paper is available at http://strimmerlab.org/software/whitening/.

High-dimensional estimation
Practical application of CCA, in both the classical and probabilistic variants, requires estimation of the joint covariance of X and Y from data, as well as the computation of the corresponding underlying whitening matrices W CCA X and W CCA Y (i.e. canonical directions) and canonical correlations λ i .
In moderate dimensions and large sample size n, i.e. when both p and q are not excessively big and n is larger than both p and q the classic CCA algorithm is applicable and empirical or maximum likelhood estimates may be used. Conversely, if the sample size n is small compared to p and q then there exist numerous effective Bayesian, penalized likelihood and other related regularized estimators to obtain statistically efficient estimates of the required covariance matrices (e.g., [22][23][24][25]). In our implementation in R and in the analysis below we use the shrinkage covariance estimation approach developed in [22] and also employed for CCA analysis in [14]. However, in principle any other preferred covariance estimator may be applied.

Algorithmic efficiencies
In addition to statistical issues concerning accurate estimation, high dimensionality also poses substantial challenges in algorithmic terms, with regard both to memory requirements as well as to computing time. Specifically, for large values of p and q directly performing the matrix operations necessary for CCA, such as computing the matrix square root or even simple matrix multiplication, will be prohibitive since these procedures typically scale in cubic order of p and q.
In particular, in a CCA analysis this affects i) the computation and estimation of the matrix K (Eq. 9) containing the adjusted cross-correlations, and ii) the calculation of the whitening matrices W CCA X and W CCA Y with the canonical directions α i and β i from the rotation matrices Q CCA X and Q CCA Y (Eq. 5). These computational steps involve multiplication and square-root calculations involving possibly very large matrices of dimension p × p and q × q.
Fortunately, in the small sample domain with n ≤ p, q there exist computational tricks to perform these matrix operations in a very effective and both timeand memory-saving manner that avoids to directly compute and handle the large-scale covariance matrices and their derived quantities [e.g. [26]]. Note this requires the use of regularized estimators, e.g. shrinkage or ridgetype estimation. Specifically, in our implementation of CCA we capitalize on an algorithm described in [27] (see "Zuber et al. algorithm" section for details) that allows to compute the matrix product of the inverse matrix square root of the shrinkage estimate of the correlation matrix R with a matrix M without the need to store or compute the full estimated correlation matrices. The computationals savings due to effective matrix operations for n < p and n < q can be substantial, going from O p 3 and O q 3 down to O n 3 in terms of algorithmic complexity. Correspondingly, for example for p/n = 3 this implies time savings of factor 27 compared to "naive" direct computation. Zuber et al. (2012) [27] describe an algorithm that allows to compute the matrix product of the inverse matrix square root of the shrinkage estimate of the correlation matrix R with a matrix M without the need to store or compute the full estimated correlation matrices. Specifically, writing the correlation estimator in the form

Zuber et al. algorithm
Note that on the right-hand side of these two equations no matrix of dimension p×p appears; instead all matrices are of much smaller size.
In the CCA context we apply this procedure to Eq. 5 in order to obtain the whitening matrix and the canonical directions and also to Eq. 9 to efficiently compute the matrix K .