Description Usage Arguments Note Author(s) References See Also Examples
View source: R/CDVineTreePlot.R
This function plots one or all trees of a given C- and D-vine copula model.
1 2 3 4 5 |
data |
An N x d data matrix (with uniform margins); default: |
family |
A d*(d-1)/2 vector of pair-copula families with values |
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
(optional; default: |
names |
A vector of names for the d variables.
If |
type |
Type of the vine model: |
method |
Character indicating the estimation method:
either maximum likelihood estimation ( |
max.df |
Numeric; upper bound for the estimation of the degrees of freedom parameter of the t-copula
(default: |
max.BB |
List; upper bounds for the estimation of the two parameters (in absolute values) of the BB1, BB6, BB7 and BB8 copulas |
tree |
Number of the tree to be plotted or |
edge.labels |
Vector of edge labels. Possible choices: |
P |
A list of matrices with two columns for the x-y-coordinates of the nodes in the plot(s) (optional; default: |
... |
further graphical parameters |
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.
Ulf Schepsmeier
Aas, K., C. Czado, A. Frigessi, and H. Bakken (2009). Pair-copula constructions of multiple dependence. Insurance: Mathematics and Economics 44 (2), 182-198.
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)
|
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.