\documentclass{bioinfo}
\copyrightyear{2015} \pubyear{2015}

\access{Advance Access Publication Date: Day Month Year}
\appnotes{Manuscript Category}

\usepackage{amsmath}

\DeclareMathOperator{\r}{R}
\DeclareMathOperator{\ir}{IR}
\DeclareMathOperator{\covls}{CovLs}
\DeclareMathOperator{\rcovls}{RCovLs}
\DeclareMathOperator{\icovls}{ICovLs}
\DeclareMathOperator{\varls}{VarLs}
\DeclareMathOperator{\ivarls}{IVarLs}
\DeclareMathOperator{\rls}{RLs}
\DeclareMathOperator{\irls}{IRLs}
\DeclareMathOperator{\rv}{RV}
\DeclareMathOperator{\dcor}{dCor}

\DeclareMathOperator{\trace}{Trace}
\DeclareMathOperator{\pvalue}{P_{value}}

\begin{document}
\firstpage{1}

\subtitle{Data and text mining}

\title[A modified $Rls$]{A modified version of the Procruste correlation coefficient for high-dimensional data}
\author[E. Coissac \textit{et~al}.]{E. Coissac\,$^{\text{\sfb 1,}*}$, Co-Author\,$^{\text{\sfb 2}}$ and C. Gonindard-Melodelima\,$^{\text{\sfb 1,}*}$}
\address{$^{\text{\sf 1}}$Department, Institution, City, Post Code, Country and \\
$^{\text{\sf 2}}$Department, Institution, City, Post Code,
Country.}

\corresp{$^\ast$To whom correspondence should be addressed.}

\history{Received on XXXXX; revised on XXXXX; accepted on XXXXX}

\editor{Associate Editor: XXXXXXX}

\abstract{\textbf{Motivation:} Text Text Text Text Text Text Text Text Text Text Text Text Text
Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text
Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text
Text Text Text Text Text Text
Text Text Text Text Text.\\
\textbf{Results:} Text  Text Text Text Text Text Text Text Text Text  Text Text Text Text Text
Text Text Text Text Text Text Text Text Text Text Text Text Text  Text Text Text Text Text Text\\
\textbf{Availability:} Text  Text Text Text Text Text Text Text Text Text  Text Text Text Text
Text Text Text Text Text Text Text Text Text Text Text Text Text Text  Text\\
\textbf{Contact:} \href{eric.coissac@metabarcoding.org}{eric.coissac@metabarcoding.org}\\
\textbf{Supplementary information:} Supplementary data are available at \textit{Bioinformatics}
online.}

\maketitle




\section{Introduction}

Multidimensional data and even high-dimensional data, where the number of variables describing each sample is far larger than the sample count are now regularly produced in functional genomics (\emph{e.g.} transcriptomics, proteomics or metabolomics) and molecular ecology (\emph{e.g.} DNA metabarcoding). Using various techniques, the same sample set can be described by several multidimensional data sets, each one describing a different aspect of the samples. This invites using data analysis methods able to evaluate mutual information shared by these different descriptions. Correlative approaches can be a first and simple way to decipher pairwise relationships of those data sets.

Since a long time ago, several coefficients have been proposed to measure correlation between two matrices \citep[for a comprehensive review see][]{Ramsay:84:00}. But when applied to high-dimensional data, they suffer from the over-fitting effect leading them to estimate a high correlation even for unrelated data sets. Modified versions of some of these matrix correlation coefficients have been already proposed to tackle this problem. The $\rv_2$ coefficient \citep{Smilde:09:00} is correcting the original $\rv$ coefficient \citep{Escoufier:73:00} for over-fitting. Similarly, a modified version of the distance correlation coefficient $\dcor$ \citep{Szekely:07:00} has been proposed by \cite{SzeKely:13:00}. $\dcor$ has the advantage over the other correlation factors for not considering only linear relationships. Here we will focus on the Procrustes correlation coeficient $\rls$ proposed by \cite{Lingoes:74:00} and by \cite{Gower:71:00}. Let the define $Trace$, a function summing the diagonal elements of a matrix. For a $ \; n \; \times \; p \; $ real matrix $X$ and anothet a $ \; n \; \times \; q \; $ real matrix $Y$ defining respectively two sets of $p$ and $q$ centered variables caracterizing $n$ individuals, we define $\covls(X,Y)$ an analog of covariance applicable to vectorial data following Equation~(\ref{eq:CovLs})

\begin{equation}
\covls(X,Y) = \frac{\trace((XX'YY')^{1/2})}{n-1}
\label{eq:CovLs}
\end{equation}

and $\varls(X)$ as $\covls(X,X)$. $\rls$ can then be expressed as follow in Equation~(\ref{eq:Rls}).

\begin{equation}
\rls(X,Y) = \frac{\covls(X,Y)}{\sqrt{\varls(X)\;\varls(Y)}}
\label{eq:Rls}
\end{equation}

Procrustean analyses have been proposed as a good alternative to Mantel's statistics for analyzing ecological data, and more generally for every high-dimensional data sets \citep{Peres-Neto:01:00}. Among the advantages of $Rls$, its similarity with the Pearson correlation coefficient $\r$ \citep{Bravais:44:00} has to be noticed. Considering $\covls(X,Y)$ and $\varls(X)$ respectively corresponding to the covariance of two matrices and the variance of a matrix,  Equation~(\ref{eq:Rls}) highlight the analogy between both the correlation coefficients. Moreover, when $p=1 \text{ and } q = 1,\; \rls = \lvert \r \rvert$.

\section{Approach}

$\rls$ is part of the procruste framework that aims to superimpose a set of points with respect to another through three operations: a translation, a rotation and a scaling. The optimal transfert matrix $Rot_{X \rightarrow Y}$ can be estimated from the singular value decomposition (SVD) of the covariance matrix $X'Y$. SVD factorize any matrix as the product of three matrices (Equation~\ref{eq:SVD}).

\begin{equation}
X'Y=U \Sigma V'
\label{eq:SVD}
\end{equation}

$U$ and $V$ are two rotation matrices allowing to compute the transfer matrix to superimpose $X$ on $Y$ or reciproquly $Y$ on $X$. All the elements of $\Sigma$ except its diagonal are equal to zero. The diagonal elements are the singular values. Singular values are the extention of the eigenvalues to non square matrices. $\covls(X,Y)$ can also be computed from singular values (Equation~\ref{eq:CovLsSVD}).

\begin{equation}
\covls(X,Y) = \frac{\trace(\Sigma)}{n-1}
\label{eq:CovLsSVD}
\end{equation}

This expression illustrates that actually $CovLs(X,Y)$ is the variance of the projections of $X$ on $Y$ or of the reciproque projection. Therefore $CovLs(X,Y)$ and $Rls(X,Y)$ are always positive and rotation independante. Here we propose to partitionate this variance in two components. A fisrt one corresponting to the actual shared information between $X$ and $Y$, and a second part that corresponds to that two random matrices of same structure than $X$ and $Y$ are sharing. Two methods are proposed to estimate $\overline{\rcovls(X,Y)}$ the mean the random part of $\covls(X,Y)$. $\icovls(X,Y)$ the informative part of $\covls(X,Y)$ is estimated using Equation~(\ref{eq:ICovLs})

\begin{equation}
\icovls(X,Y) = Max \left\{ \begin{align}
                       \covls(X,Y) - \overline{\rcovls(X,Y)} &\\
                       0 &
                      \end{align}
              \right.
\label{eq:ICovLs}
\end{equation}

Similarly the informative counter-part of $VarLs(X)$ is defined as $\ivarls(X)=\icovls(X,X)$.

\begin{methods}
\section{Methods}

Two methods are proposed to estimate $\overline{\rcovls(X,Y)}$. The first one is formal and applicable only when $p=1$ and $q=1$ the second one is based on a Monte-Carlo evaluation and is applicable for every $p$ and $q$.

\subsection{Formal estimation of $\overline{\rcovls(X,Y)}$}

For two random real vectors of length $n$, $x$ and $y$ the mean of $R(x,y)^2$, $\overline{\r(x,y)^2}=1/(n-1)$. That equality is independent of the distribution of $x$ and $y$. Let $\sigma_x$ and $\sigma_y$ being respectively the standard deviations of $x$ and $y$, we can estimate $\overline{\rcovls(x,y)}$ by Equation~(\ref{eq:RCovLs11}).

\begin{equation}
\overline{\rcovls(x,y)} = \sigma_x \; \sigma_y \sqrt{\frac{1}{n-1}}
\label{eq:RCovLs11}
\end{equation}

\subsection{Monte-Carlo estimation of $\overline{\rcovls(X,Y)}$}

For every values of $p$ and $q$ including $1$, $\overline{\rcovls(X,Y)}$ can be estimated using a serie of $k$ random matrices $RX=\{RX_1,RX_2,...,RX_k\}$ and $RY=\{RY_1,RY_2,...,RY_k\}$ where each $RX_i$ and $RY_i$ have the same structure respectively than $X$ and $Y$ in term of number of columns and of standard deviation of these columns.

\begin{equation}
\overline{\rcovls(X,Y)} = \frac{\Sigma_{i=1}^k \covls(RX_i,RY_i)}{k}
\label{eq:RCovLsMC}
\end{equation}

Even when $X=Y$ to estimate $VarLs(X)$, $\overline{\rcovls(X,Y)}$ is estimated with two independent sets of random matrix $RX$ and $RY$, both having the same structure than $X$.

\subsection{Estimation of $\irls(X,Y)$}

We proposed to define $\irls(X,Y)$ the informative Procruste correlation coefficient as follow.

\begin{equation}
\irls(X,Y)= \frac{\icovls(X,Y)}{\ivarls(X)\;\ivarls(Y)}
\label{eq:IRLs}
\end{equation}

Like $\rs(X,Y)$ $\irls(X,Y) \in [0;1]$ with the $0$ value corresponding to not correlation and the maximum value $1$ reached for two strictly homothetic data sets.

\subsection{Testing significance of $\irls(X,Y)$}

Significance of $\irls(X,Y)$ can be tested using permutation test as defined in \cite{Jackson:95:00} or \cite{Peres-Neto:01:00} and implemented respectively in the \texttt{protest} method of the vegan R package \citep{Dixon:03:00} or the \texttt{procuste.rtest} method of the ADE4 R package \cite{Dray:07:00}.

It is also possible to take advantage of the Monte-Carlo estimation of $\overline{\rcovls(X,Y)}$ to test that $\icovls(X,Y)$ and therefore $\irls(X,Y)$ are greater than expected under random hypothesis. Let counting over the $k$ rendomization when $\rcovls(X,Y)_k$ greater than $\covls(X,Y)}$ name this counts $N_{>\covls}$. $\pvalue$ of the test can be estimated following Equation~(\ref{eq:pvalue}).

\begin{equation}
\pvalue= \frac{N_{>\covls}}{k}
\label{eq:pvalue}
\end{equation}

\subsection{Simulating data for testing sensibility to overfitting}



To test sensibility to overfitting correlations were mesured between two random matrices of same dimensions. Each matrix is $n \times p$ with $n=20$ and $p \in [2,50]$. Each $p$ variables are drawn from a centered and reduced normal distribution $\mathcal{N}(0,1)$. Eight correlation coefficients have been tested: \emph{RLs} the original procruste coefficient , \emph{IRLs} this work, \emph{RV} the original R for vector data \citep{Robert:76:00}, RVadjMaye, \emph{RV2} and \emph{RVadjGhaziri} three modified versions of \emph{RV} \citep{El-Ghaziri:15:00,Mayer:11:00,Smilde:09:00}, \emph{dCor} the original distance correlation coefficient \citep{Szekely:07:00} and \emph{dCor\_ttest} a modified version of \emph{dCor} not sensible to overfitting \citep{SzeKely:13:00}. For each $p$ value, $100$ simulations were run. Computation of \emph{IRLs} is estimated with $100$ randomizations.







For $p=1$ random vectors with $n \in [3,25]$ are generated. As above data are drawn from $\mathcal{N}(0,1)$ and $k=100$ simulations are run for each $n$. The original Pearson correlation coefficient $R$ and the modified version $IR$ are used to estimate correlation between both vectors.








\subsection{Empirical assessment of $\alpha\text{-risk}$ for the $CovLs$ test}



To assess empirically the $\alpha\text{-risk}$ of the procruste test based on the randomisations realized during the estimation of $\overline{RCovLs(X,Y)}$, distribution of $P_{value}$ under the $H_0$ is comparaed to a uniform distribution between $0$ and $1$ ($\mathcal{U}(0,1)$). To estimate such empirical distribution,  $k=1000$ pairs of $n \times p$ random matrices with $n=20$ and
$p \in \{10, 20, 50\}$ are simulated under the null hypothesis of independancy. Procruste correlation between whose matrices is tested based on three tests. Our proposed test ($CovLs.test$), the \texttt{protest} method of the vegan R package and the \texttt{procuste.rtest} method of the ADE4 R package. Conformance of the distribution of each set of $k$ $P_{value}$ to $\mathcal{U}(0,1)$ is assessed using the Cramer-Von Mises test \citep{CSoRgo:96:00} implemented in the \texttt{cvm.test} function of the R package \texttt{goftest}.





\subsection{Empirical power assessment for the $CovLs$ test}












