# About the Randomized Dependence Coefficient

In the paper The Randomized Dependence Coefficient, authors introduce a novel dependence coefficient which seem to be quite generic and powerful compared to what is present in the literature. It is the only measure, to my knowledge, that is

• non-linear
• can work with vectors
• marginal invariant (leveraging use of the copula transform)
• Renyi's properties compliant
• values in $[0,1]$
• quite fast and easy to implement.

The paper is well written, motivations are explained, and justifications for convergence/consistency/approximations are given using theorems.

Yet, I encounter difficulties using it (even when running the authors' code). The resulting dependence coefficient is not stable at all on my tests with respect to the two parameters it depends on

• $k$, the number of non-linear projections of the copula
• $s$, the variance for drawing i.i.d. projection coefficients in $\mathcal{N}(0,sI)$.

For example, this quite "shocking" results:

Input:

X = rnorm(10001,mean=0,sd=1)
Y = rnorm(10001,mean=0,sd=1)


Authors' code:

rdc <- function(x,y,k,s) {
x <- cbind(apply(as.matrix(x),2,function(u) ecdf(u)(u)),1)
y <- cbind(apply(as.matrix(y),2,function(u) ecdf(u)(u)),1)
wx <- matrix(rnorm(ncol(x)*k,0,s),ncol(x),k)
wy <- matrix(rnorm(ncol(y)*k,0,s),ncol(y),k)
cancor(cbind(cos(x%*%wx),sin(x%*%wx)), cbind(cos(y%*%wy),sin(y%*%wy)))$cor }  Run 1: Pearson's product-moment correlation 95 percent confidence interval: -0.01728740 0.02191057 cor 0.00231247 k = 100 s = 0.2 rdc(X,Y,k,s) "RDC" 0.06432993  Run 2: Pearson's product-moment correlation 95 percent confidence interval: -0.02590941 0.01328721 cor -0.006313525 k = 100 s = 0.2 rdc(X,Y,k,s) "RDC" 0.9933134  So, is there a proper way to set the$k$,$s$parameters to stabilize the results (without introducing a strong bias)? From the paper, it is not clear to me. Does anyone have experience with this coefficient and is willing to share? ## 1 Answer In the latest version of the paper on arxive, the authors suggest k=20, and s=1/6 as stable default parameters. Using those parameters you also get a stable result on your example. Here's the code: > X = rnorm(10001,mean=0,sd=1) > Y = rnorm(10001,mean=0,sd=1) > > rdc <- function(x,y,k=20,s=1/6,f=sin) { + x <- cbind(apply(as.matrix(x),2,function(u)rank(u)/length(u)),1) + y <- cbind(apply(as.matrix(y),2,function(u)rank(u)/length(u)),1) + x <- s/ncol(x)*x%*%matrix(rnorm(ncol(x)*k),ncol(x)) + y <- s/ncol(y)*y%*%matrix(rnorm(ncol(y)*k),ncol(y)) + cancor(cbind(f(x),1),cbind(f(y),1))$cor
+ }
>
> rdc(X, Y)
 0.03906866
> rdc(X, Y)
 0.02443842
> rdc(X, Y)
 0.03837279
>


And here's the NIPS version of the paper.

• Thanks for your reply. But, how is done the parameter selection? I read somewhere that there is a method (an experimental paper from Reshef referencing a private communication, can't find it right now). Thanks anyway for pointing me the update! – mic Oct 26 '15 at 16:18
• I haven't seen the paper you're referring to, but my gut feeling tells me parameters are selected on a try and error basis. I'll use the method in my real application, and will report it here if the default parameters are not good enough. – adrin Oct 27 '15 at 9:39