# RV coefficient

In statistics, the RV coefficient is a multivariate generalization of the squared Pearson correlation coefficient (because the RV coefficient takes values between 0 and 1). It measures the closeness of two set of points that may each be represented in a matrix.
The major approaches within statistical multivariate data analysis can all be brought into a common framework in which the RV coefficient is maximised subject to relevant constraints. Specifically, these statistical methodologies include:
   * principal component analysis
   * canonical correlation analysis
   * multivariate regression
   * statistical classification (linear discrimination).
One application of the RV coefficient is in functional neuroimaging where it can measure the similarity between two subjects' series of brain scans or between different scans of a same subject.

## Definitions

The definition of the RV-coefficient makes use of ideas concerning the definition of scalar-valued quantities which are called the "variance" and "covariance" of vector-valued random variables. Note that standard usage is to have matrices for the variances and covariances of vector random variables. Given these innovative definitions, the RV-coefficient is then just the correlation coefficient defined in the usual way.
Suppose that X and Y are matrices of centered random vectors (column vectors) with covariance matrix given by
    $\Sigma _{XY}=\operatorname {E} (XY^{\top })\,,$
then the scalar-valued covariance (denoted by COVV) is defined by
    $\operatorname {COVV} (X,Y)=\operatorname {Tr} (\Sigma _{XY}\Sigma _{YX})\,.$
The scalar-valued variance is defined correspondingly:
    $\operatorname {VAV} (X)=\operatorname {Tr} (\Sigma _{XX}^{2})\,.$
With these definitions, the variance and covariance have certain additive properties in relation to the formation of new vector quantities by extending an existing vector with the elements of another.
Then the RV-coefficient is defined by
    $\mathrm {RV} (X,Y)={\frac {\operatorname {COVV} (X,Y)}{\sqrt {\operatorname {VAV} (X)\operatorname {VAV} (Y)}}}\,.$

## Shortcoming of the coefficient and adjusted version

Even though the coefficient takes values between 0 and 1 by construction, it seldom attains values close to 1 as the denominator is often too large with respect to the maximal attainable value of the denominator.
Given known diagonal blocks $\Sigma _{XX}$ and $\Sigma _{YY}$ of dimensions $p\times p$ and $q\times q$ respectively, assuming that $p\leq q$ without loss of generality, it has been proved that the maximal attainable numerator is $\operatorname {Tr} (\Lambda _{X}\Pi \Lambda _{Y}),$ where $\Lambda _{X}$ (resp. $\Lambda _{Y}$) denotes the diagonal matrix of the eigenvalues of $\Sigma _{XX}$(resp. $\Sigma _{YY}$) sorted decreasingly from the upper leftmost corner to the lower rightmost corner and $\Pi$ is the $p\times q$ matrix $(I_{p}\ 0_{p\times (q-p)})$.
In light of this, Mordant and Segers proposed an adjusted version of the RV coefficient in which the denominator is the maximal value attainable by the numerator. It reads
    ${\bar {\operatorname {RV} }}(X,Y)={\frac {\operatorname {Tr} (\Sigma _{XY}\Sigma _{YX})}{\operatorname {Tr} (\Lambda _{X}\Pi \Lambda _{Y})}}={\frac {\operatorname {Tr} (\Sigma _{XY}\Sigma _{YX})}{\sum _{j=1}^{min(p,q)}(\Lambda _{X})_{j,j}(\Lambda _{Y})_{j,j}}}.$
The impact of this adjustment is clearly visible in practice.