-
-
Save akbertram/87126966fe15f1790ed8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(energy) | |
# Find correlated pairs of variables | |
# in a simulated dataset | |
findCorellations <- function(pairs, n) { | |
for(i in 1:pairs) { | |
dx <- rnorm(n) | |
dy <- rnorm(n) | |
dcor <- DCOR(dx, dy) | |
print(dcor$dCor) | |
} | |
} | |
# Time the calculation for increasing number of | |
# observations | |
for(n in c(1000,2000,5000,6000,7000,8000,10000,25000)) { | |
cat(sprintf("n = %d\n",n)) | |
print(system.time(findCorellations(10,n))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment