## A two-dimensional data example ----------------------------------
x <- rCopula(200, claytonCopula(3))
## Model (copula) selection -- takes time: each fits 200 copulas to 199 obs.
xvCopula(gumbelCopula(), x)
xvCopula(frankCopula(), x)
xvCopula(joeCopula(), x)
xvCopula(claytonCopula(), x)
xvCopula(normalCopula(), x)
xvCopula(tCopula(), x)
xvCopula(plackettCopula(), x)
## The same with 10-fold cross-validation
set.seed(1) # k-fold is random (for k < n) !
xvCopula(gumbelCopula(), x, k=10)
xvCopula(frankCopula(), x, k=10)
xvCopula(joeCopula(), x, k=10)
xvCopula(claytonCopula(), x, k=10)
xvCopula(normalCopula(), x, k=10)
xvCopula(tCopula(), x, k=10)
xvCopula(plackettCopula(),x, k=10)
Run the code above in your browser using DataLab