# NOT RUN {
# set up C-vine copula model with mixed pair-copulas
d <- 4
dd <- d*(d-1)/2
order <- 1:d
family <- c(1, 2, 3, 4, 7, 3)
par <- c(0.5, 0.4, 2, 1.5, 1.2, 1.5)
par2 <- c(0, 5, 0, 0, 2, 0)
# transform to R-vine matrix notation
RVM <- C2RVine(order, family, par, par2)
# }
# NOT RUN {
# load package CDVine for comparison
library(CDVine)
# simulate a sample of size 500 from a 4-dimensional D-vine
type <- 1 # C-vine
simdata <- CDVineSim(500, family, par, par2, type)
# determine log-likelihood
out <- CDVineLogLik(simdata, family, par, par2, type)
out$loglik
# check that log-likelihood stays the same
out2 <- RVineLogLik(simdata, RVM)
out2$loglik
# }
Run the code above in your browser using DataLab