Learn R Programming

VineCopula (version 1.3)

C2RVine: Transform C-vine to R-vine structure

Description

This function transforms a C-vine structure from the package CDVine to the corresponding R-vine structure.

Usage

C2RVine(order, family, par, par2=rep(0,length(family)))

Arguments

order
A d-dimensional vector specifying the order of the root nodes in the C-vine.
family
A 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 =
par
A d*(d-1)/2 vector of pair-copula parameters.
par2
A d*(d-1)/2 vector of second pair-copula parameters (optional; default: par2 = rep(0,length(family))), necessary for the t-, BB1, BB6, BB7, BB8, Tawn type 1 and type 2 copulas.

Value

See Also

RVineMatrix, D2RVine

Examples

Run this code
# simulate a sample of size 500 from a 4-dimensional C-vine  
# copula 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

Run the code above in your browser using DataLab