CDVineTreePlot: Plot function for C- or D-vine trees

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

View source: R/CDVineTreePlot.R

Description

This function plots one or all trees of a given C- and D-vine copula model.

Usage

1
2
3
4
5
CDVineTreePlot(data=NULL, family,
               par=rep(0,length(family)), par2=rep(0,length(family)),
               names=NULL, type, method="mle", max.df=30,
               max.BB=list(BB1=c(5,6),BB6=c(6,6),BB7=c(5,6),BB8=c(6,1)),
               tree="ALL", edge.labels=c("family"), P=NULL, ...)

Arguments

data

An N x d data matrix (with uniform margins); default: data = NULL.

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 = 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
(optional; default: par = rep(0,length(family)).

par2

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

names

A vector of names for the d variables. If names = NULL (default), column names of data (if available) or simply numbers are used.

type

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

method

Character indicating the estimation method: either maximum likelihood estimation (method = "mle"; default) or inversion of Kendall's tau (method = "itau").

max.df

Numeric; upper bound for the estimation of the degrees of freedom parameter of the t-copula (default: max.df = 30; for more details see BiCopEst).

max.BB

List; upper bounds for the estimation of the two parameters (in absolute values) of the BB1, BB6, BB7 and BB8 copulas
(default: max.BB = list(BB1=c(5,6),BB6=c(6,6),BB7=c(5,6),BB8=c(6,1))).

tree

Number of the tree to be plotted or tree = "ALL" (default) to plot all trees.

edge.labels

Vector of edge labels. Possible choices:
FALSE: no edge labels
"family": pair-copula families (default)
"par": pair-copula parameters
"par2": second pair-copula parameters
"theotau": theoretical Kendall's tau values corresponding to pair-copula families and parameters (see BiCopPar2Tau)
"emptau": empirical Kendall's tau values (only if data is provided!)

P

A list of matrices with two columns for the x-y-coordinates of the nodes in the plot(s) (optional; default: P = NULL).

...

further graphical parameters

Note

The function computes the positions of the nodes automatically with the Fruchterman-Reingold algorithm (see plot.igraph for a detailed description). If one would like to set the positions manually, one has to specify a list of matrices P in the argument list. A good starting point may be to run the function CDVineTreePlot and manipulate the returning matrix P.

The user can set the copula parameters par and par2. If not set and data is provided, the parameters of the C- or D-vine copula model are estimated sequentially using CDVineSeqEst/BiCopEst. Then the edge width is chosen according to the empirical Kendall's tau values. Otherwise theoretical values are used.

Author(s)

Ulf Schepsmeier

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

CDVineMLE

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# simulate from a 6-dimensional C-vine model with Gaussian pair-copulas
d = 6
dd = d*(d-1)/2
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);
fam1 = rep(1,dd)
N = 100
U = CDVineSim(N,fam1,par1,type=1)

# plot the first tree with pair-copula families and
# empirical Kendall's tau values as edge labels
CDVineTreePlot(U,fam1,type=1,tree=1,edge.labels=c("family","emptau"))

# plot all trees without edge labels and without sequential estimation
CDVineTreePlot(data=NULL,family=fam1,par=par1,type=1, edge.labels=FALSE)

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]]
          [,1]      [,2]
[1,] -596.9493  71.18227
[2,] -586.8670  70.45415
[3,] -592.1221  70.16323
[4,] -591.7901  71.01673
[5,] -587.9762  69.67569
[6,]  609.5804 -68.30841

[[2]]
[1] 0

[[3]]
[1] 0

[[4]]
[1] 0

[[5]]
[1] 0

[[1]]
          [,1]      [,2]
[1,] 11.738377  595.9712
[2,] 12.384453  584.7216
[3,] 12.117141  591.5912
[4,] 11.196123  591.9737
[5,] 11.255699  584.4416
[6,] -6.258115 -593.2008

[[2]]
          [,1]      [,2]
[1,] -507.7882 111.82928
[2,]  525.4246 -96.69953
[3,] -501.7441 111.05059
[4,] -501.8816 109.92989
[5,] -484.6878 107.17039

[[3]]
         [,1]     [,2]
[1,] 70.15338 62.90529
[2,] 71.87156 70.05549
[3,] 69.85943 61.61578
[4,] 71.17118 66.71763

[[4]]
          [,1]      [,2]
[1,]  427.7538 -67.88135
[2,]  403.7229 -64.06633
[3,] -428.6377  68.02289

[[5]]
          [,1]       [,2]
[1,] -354.5633 -0.8818123
[2,]  354.1992  0.1858043

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