# compare 6-dimensional C-vine copula models
# with Gaussian and with Student t pair-copulas
d = 6
dd = d*(d-1)/2
fam1 = rep(1,dd)
par1 = c(0.2,0.69,0.73,0.22,-0.09,0.51,0.32,0.01,0.82,0.01,
-0.2,-0.32,-0.19,-0.17,-0.06)
fam2 = rep(2,dd)
par2 = par1
nu2 = rep(4,dd)
# simulate a sample of size 300 from the first C-vine copula model
simdata = CDVineSim(300,fam1,par1,type=1)
# compare the two models based on this sample
clarke = CDVineClarkeTest(simdata,1:d,1:d,fam1,fam2,par1,par2,
Model2.par2=nu2,Model1.type=1,Model2.type=1)
clarke$statistic
clarke$statistic.Schwarz
clarke$p.value
clarke$p.value.SchwarzRun the code above in your browser using DataLab