N <- 100; alpha <- exp(2)
xx <- seq(-0.30, 1.30, len = N)
ox <- expand.grid(xx, xx)
zedd <- dbifrankcop(ox[, 1], ox[, 2], alpha = alpha)
contour(xx, xx, matrix(zedd, N, N))
zedd <- pbifrankcop(ox[, 1], ox[, 2], alpha = alpha)
contour(xx, xx, matrix(zedd, N, N))
alpha <- exp(4)
plot(rr <- rbifrankcop(n = 3000, alpha = alpha))
par(mfrow = c(1, 2))
hist(rr[, 1]) # Should be uniform
hist(rr[, 2]) # Should be uniform
Run the code above in your browser using DataLab