## Prepare to generate from normal copula
pho <- .25
A <- matrix(c(1, pho, pho, sqrt(1 - pho^2)), 2)
## Generating truncated survival data from normal copula
set.seed(123)
n <- 10000
dat <- matrix(NA, n, 2)
for (i in 1:n) dat[i,] <- pnorm(A %*% rnorm(2))
dat <- data.frame(dat)
colnames(dat) <- c("x", "y")
system.time(print(uncondKendall(dat$x, dat$y)))
system.time(print(cor(dat$x, dat$y, method = "kendall")))
Run the code above in your browser using DataLab