# load data set
data(daxreturns)
# select the R-vine structure, families and parameters
# using only the first 4 variables and the first 750 observations
# we allow for the copula families: Gauss, t, Clayton, Gumbel, Frank and Joe
RVM <- RVineStructureSelect(daxreturns[1:750,1:4], c(1:6), progress = TRUE)
# specify a C-vine copula model with only Clayton, Gumbel and Frank copulas (time-consuming)
CVM <- RVineStructureSelect(daxreturns, c(3,4,5), "CVine")
# determine the order of the nodes in a D-vine using the package TSP (time-consuming)
library(TSP)
d <- dim(daxreturns)[2]
M <- 1 - abs(TauMatrix(daxreturns))
hamilton <- insert_dummy(TSP(M), label = "cut")
sol <- solve_TSP(hamilton, method = "repetitive_nn")
order <- cut_tour(sol, "cut")
DVM <- D2RVine(order, family = rep(0,d*(d-1)/2), par = rep(0, d*(d-1)/2))
RVineCopSelect(daxreturns, c(1:6), DVM$Matrix)
Run the code above in your browser using DataLab