# simulate from a bivariate Clayton copula
set.seed(123)
simdata <- BiCopSim(300, 3, 2)
u1 <- simdata[,1]
u2 <- simdata[,2]
# perform White's goodness-of-fit test for the true copula
BiCopGofTest(u1, u2, family = 3)
# perform White's goodness-of-fit test for the Frank copula
BiCopGofTest(u1, u2, family = 5)
# perform Kendall's goodness-of-fit test for the true copula
gof <- BiCopGofTest(u1, u2, family = 3, method = "kendall", B=50)
gof$p.value.CvM
gof$p.value.KS
# perform Kendall's goodness-of-fit test for the Frank copula
gof <- BiCopGofTest(u1, u2, family = 5, method = "kendall", B=50)
gof$p.value.CvM
gof$p.value.KS
Run the code above in your browser using DataLab