Comment by ur-whale

4 years ago

Is there code?

Yes, the author has shared the link to R package here:

https://cran.r-project.org/web/packages/XICOR/index.html

Edit: R code from Dr. Chatterjee's Stanford page is here - https://souravchatterjee.su.domains//xi.R

If you have never worked with R, the code seems clunky so I suggest checking out Python implementation on Github here:

https://github.com/czbiohub/xicor

The Python library is not from the original author though. But it's easy to read the code and it works with pandas as well.

The equation is on the second page, and if you know enough to know what correlation is, you know enough to implement from the equation given. Takes N*Log(N) to run though, if implemented naively. (because you have to sort your data)