Learn R Programming

VineCopula (version 1.0)

R2CVine: Transform R-vine to C-vine structure

Description

This function transforms an R-vine matrix structure to the corresponding C-vine structure as used in the package CDVine.

Usage

R2CVine(RVM)

Arguments

RVM
An RVineMatrix object.

Value

  • orderA d-dimensional vector specifying the order of the root nodes in the C-vine.
  • familyA d*(d-1)/2 vector of pair-copula families with values 0 = independence copula 1 = Gaussian copula 2 = Student t copula (t-copula) 3 = Clayton copula 4 = Gumbel copula 5 = Frank copula 6 = Joe copula 7 = BB1 copula 8 = BB6 copula 9 = BB7 copula 10 = BB8 copula 13 = rotated Clayton copula (180 degrees; ``survival Clayton'') 14 = rotated Gumbel copula (180 degrees; ``survival Gumbel'') 16 = rotated Joe copula (180 degrees; ``survival Joe'') 17 = rotated BB1 copula (180 degrees; ``survival BB1'') 18 = rotated BB6 copula (180 degrees; ``survival BB6'') 19 = rotated BB7 copula (180 degrees; ``survival BB7'') 20 = rotated BB8 copula (180 degrees; ``survival BB8'') 23 = rotated Clayton copula (90 degrees) 24 = rotated Gumbel copula (90 degrees) 26 = rotated Joe copula (90 degrees) 27 = rotated BB1 copula (90 degrees) 28 = rotated BB6 copula (90 degrees) 29 = rotated BB7 copula (90 degrees) 30 = rotated BB8 copula (90 degrees) 33 = rotated Clayton copula (270 degrees) 34 = rotated Gumbel copula (270 degrees) 36 = rotated Joe copula (270 degrees) 37 = rotated BB1 copula (270 degrees) 38 = rotated BB6 copula (270 degrees) 39 = rotated BB7 copula (270 degrees) 40 = rotated BB8 copula (270 degrees)
  • parA d*(d-1)/2 vector of pair-copula parameters.
  • par2A d*(d-1)/2 vector of second pair-copula parameters for the t-, BB1, BB6, BB7 and BB8 copulas.

See Also

RVineMatrix, C2RVine, R2DVine

Examples

Run this code
# simulate a sample of size 500 from a 4-dimensional C-vine  
# model with mixed pair-copulas
# load package CDVine
library(CDVine)
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)
type = 1
simdata = CDVineSim(500,family,par,par2,type)

# determine log-likelihood
out = CDVineLogLik(simdata,family,par,par2,type)
out$loglik

# transform to R-vine matrix notation
RVM = C2RVine(order,family,par,par2)

# check that log-likelihood stays the same
out2 = RVineLogLik(simdata,RVM)
out2$loglik

# ... and back
Cvine = R2CVine(RVM)
out3 = CDVineLogLik(simdata[,Cvine$order],Cvine$family,
                    Cvine$par,Cvine$par2,type)
out3$loglik

Run the code above in your browser using DataLab