CDVineTreePlot {CDVine} | R Documentation |
This function plots one or all trees of a given C- and D-vine copula model.
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, ...)
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.
# 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)