plot.RVineMatrix: Plotting 'RVineMatrix' objects.

View source: R/plot.RVineMatrix.R

contour.RVineMatrixR Documentation

Plotting RVineMatrix objects.

Description

There are two plotting generics for RVineMatrix objects. plot.RVineMatrix plots one or all trees of a given R-vine copula model. Edges can be labeled with information about the corresponding pair-copula. contour.RVineMatrix produces a matrix of contour plots (using plot.BiCop()).

Usage

## S3 method for class 'RVineMatrix'
contour(x, tree = "ALL", xylim = NULL, cex.nums = 1, data = NULL, ...)

## S3 method for class 'RVineMatrix'
plot(
  x,
  tree = "ALL",
  type = 0,
  edge.labels = NULL,
  legend.pos = "bottomleft",
  interactive = FALSE,
  ...
)

Arguments

x

RVineMatrix object.

tree

"ALL" or integer vector; specifies which trees are plotted.

xylim

numeric vector of length 2; sets xlim and ylim for the contours

cex.nums

numeric; expansion factor for font of the numbers.

data

a data matrix for creating kernel density contours of each pair.

...

Arguments passed to network::plot.network() or plot.BiCop() respectively.

type

integer; specifies how to make use of variable names:
0 = variable names are ignored,
1 = variable names are used to annotate vertices,
2 = uses numbers in plot and adds a legend for variable names.

edge.labels

character; either a vector of edge labels or one of the following:
"family" = pair-copula family abbreviation (see BiCopName()),
"par" = pair-copula parameters,
"tau" = pair-copula Kendall's tau (by conversion of parameters)
"family-par" = pair-copula family and parameters
"family-tau" = pair-copula family and Kendall's tau.

legend.pos

the x argument for graphics::legend().

interactive

logical; if TRUE, the user is asked to adjust the positioning of vertices with his mouse.

Details

If you want the contour boxes to be perfect squares, the plot height should be 1.25/length(tree)*(d - min(tree)) times the plot width.

Author(s)

Thomas Nagler, Nicole Barthel

See Also

RVineMatrix(), network::plot.network(), plot.BiCop(), BiCopName(), graphics::legend()

Examples


## build vine model
strucmat <- matrix(c(3,   1, 2, 0, 2, 1, 0, 0, 1), 3, 3)
fammat   <- matrix(c(0,   1, 6, 0, 0, 3, 0, 0, 0), 3, 3)
parmat   <- matrix(c(0, 0.3, 3, 0, 0, 1, 0, 0, 0), 3, 3)
par2mat  <- matrix(c(0,   0, 0, 0, 0, 0, 0, 0, 0), 3, 3)
RVM  <- RVineMatrix(strucmat, fammat, parmat, par2mat)

# plot trees
## Not run: plot(RVM)

# show contour plots
contour(RVM)


tnagler/VineCopula documentation built on March 6, 2024, 5 a.m.