CDVineSim: Simulation from C- and D-vine copula models

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/CDVineSim.R

Description

This function simulates from given C- and D-vine copula models.

Usage

1

Arguments

N

Number of d-dimensional observations simulated.

family

A d*(d-1)/2 integer vector of C-/D-vine 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)

par

A d*(d-1)/2 vector of pair-copula parameters.

par2

A d*(d-1)/2 vector of second parameters for pair-copula families with two parameters (t, BB1, BB6, BB7, BB8; default: par2 = rep(0,length(family))).

type

Type of the vine model:
1 or "CVine" = C-vine
2 or "DVine" = D-vine

Value

An N x d matrix of data simulated from the given C- or D-vine copula model.

Author(s)

Carlos Almeida, Ulf Schepsmeier, Eike Brechmann, Jakob Stoeber

References

Aas, K., C. Czado, A. Frigessi, and H. Bakken (2009). Pair-copula constructions of multiple dependence. Insurance: Mathematics and Economics 44 (2), 182-198.

See Also

CDVineLogLik, BiCopSim

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
## Example 1: simulate from a 6-dimensional C-vine model 
## with Gaussian pair-copulas
d = 6
dd = d*(d-1)/2
fam1 = rep(1,dd)
par1 = c(0.2,0.69,0.73,0.22,-0.09,0.51,0.32,0.01,0.82,0.01,
         -0.2,-0.32,-0.19,-0.17,-0.06)
N = 100
U1 = CDVineSim(N,fam1,par1,type=1)
head(U1)

# calculate the log-likelihood
logLik = CDVineLogLik(U1,fam1,par1,type=1)
logLik$loglik


## Example 2: simulate from a 6-dimensional C-vine model 
## with Student t pair-copulas each with three degrees of freedom
fam2 = rep(2,dd)
par2 = rep(0.5,dd)
nu2 = rep(3,dd)
U2 = CDVineSim(N,fam2,par2,nu2,type=1)

# calculate the log-likelihood
logLik2 = CDVineLogLik(U2,fam2,par2,nu2,type=1)
logLik2$loglik


## Example 3: simulate from a 6-dimensional D-vine model
## with Student t pair-copulas each with five degrees of freedom
fam3 = rep(2,dd)
par3 = rep(0.4,dd)
nu3 = rep(5,dd)
U3 = CDVineSim(N,fam3,par3,nu3,type=2)

# calculate the log-likelihood
logLik3 = CDVineLogLik(U3,fam3,par3,nu3,type=2)
logLik3$loglik

Example output

The CDVine package is no longer developed actively.
Please consider using the more general VineCopula package
(see https://CRAN.R-project.org/package=VineCopula),
which extends and improves the functionality of CDVine.

          [,1]      [,2]      [,3]      [,4]      [,5]      [,6]
[1,] 0.7490381 0.5025327 0.8972044 0.6678854 0.0520954 0.5811345
[2,] 0.4937799 0.6758178 0.2057871 0.5833563 0.4718454 0.5754951
[3,] 0.8044155 0.6159832 0.5593707 0.2230294 0.4178685 0.6371460
[4,] 0.9253415 0.6181450 0.9252667 0.6979165 0.5013322 0.3194054
[5,] 0.3872614 0.8444397 0.6260970 0.1148200 0.4906736 0.7283768
[6,] 0.5684273 0.9629564 0.6423097 0.8668104 0.6613836 0.9110237
[1] 180.851
[1] 181.8809
[1] 144.2656

CDVine documentation built on May 2, 2019, 9:28 a.m.