n <- 20
gumbel.cop <- gumbelCopula(4)
u <- rCopula(n, gumbel.cop)
## points were to evaluate the empirical copula
w <- matrix(runif(2 * n), n, 2)
ec <- Cn(u, w)
## compare with true c.d.f.
mean(abs(pCopula(w, gumbel.cop) - ec))
## increase n to decrease the mean absolute error
## compare the empirical copula and the true copula c.d.f.
## on the diagonal of the unit square
curve(Cn(u, cbind(x, x)), 0, 1)
curve(pCopula(cbind(x, x), gumbel.cop), lty = 2, add = TRUE)
Run the code above in your browser using DataLab