# load data set
data(daxreturns)
# select the R-vine structure, families and parameters
RVM = RVineStructureSelect(daxreturns[,1:4],c(1:6),progress=TRUE)
# specify a C-vine copula model with only Clayton, Gumbel and Frank copulas
CVM = RVineStructureSelect(daxreturns,c(3,4,5),"CVine")
# determine the order of the nodes in a D-vine using the package TSP
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