Measure of similarity between samples
In statistics, biweight midcorrelation (also called bicor) is a measure of similarity between samples. It is median-based, rather than mean-based, thus is less sensitive to outliers, and can be a robust alternative to other similarity metrics, such as Pearson correlation or mutual information.
Derivation
Here we find the biweight midcorrelation of two vectors
and
, with
items, representing each item in the vector as
and
. First, we define
as the median of a vector
and
as the median absolute deviation (MAD), then define
and
as,

Now we define the weights
and
as,

where
is the identity function where,

Then we normalize so that the sum of the weights is 1:
![{\displaystyle {\begin{aligned}{\tilde {x}}_{i}&={\frac {\left(x_{i}-\operatorname {med} (x)\right)w_{i}^{(x)}}{\sqrt {\sum _{j=1}^{m}\left[(x_{j}-\operatorname {med} (x))w_{j}^{(x)}\right]^{2}}}}\\{\tilde {y}}_{i}&={\frac {\left(y_{i}-\operatorname {med} (y)\right)w_{i}^{(y)}}{\sqrt {\sum _{j=1}^{m}\left[(y_{j}-\operatorname {med} (y))w_{j}^{(y)}\right]^{2}}}}.\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/4ddaa71533c2d782bdd2b7812536299d3ccc19b9)
Finally, we define biweight midcorrelation as,

Applications
Biweight midcorrelation has been shown to be more robust in evaluating similarity in gene expression networks, and is often used for weighted correlation network analysis.
Implementations
Biweight midcorrelation has been implemented in the R statistical programming language as the function bicor
as part of the WGCNA package
Also implemented in the Raku programming language as the function bi_cor_coef
as part of the Statistics module.
See also
References