Learn R Programming

HAC (version 0.1-1)

plot.hac: Plot of a HAC

Description

The function plots the structure of (Hierarchical) Archimedean Copulae.

Usage

## S3 method for class 'hac':
plot(x, xlim, ylim, xlab, ylab, axes = FALSE,
col = "black", fg = "black", bg = "white", lwd = 2, index = FALSE, 
theta = TRUE, h = 0.45, l = 1.2, circles = 0.25, digits = 2, \dots)

Arguments

x
a hac object. It can be constructed by hac or be the result of the estimation procedure (estimate.copula).
xlim, ylim
numeric vectors of the length 2, giving the limits of the x and y axes. The default values adjust the size of the coordinate plane automatically with respect to the dimension of the HAC. If the type of the hac is AC_GUMBEL or
xlab, ylab
titles for the x and y axes.
axes
the default value FALSE implies, that no axes appear.
col
defines the color of the lines, which connect the circles and rectangles.
fg
defines the color of the lines of the rectangles and circles equivalent to the color settings in R.
bg
defines the background color of the rectangles and circles equivalent to the color settings in R.
lwd
the width of the lines.
index
is boolean, i.e. index = T or index = F. If it is set to TRUE, a string, which represents the structure of the hosted variables, appears as subscript of the dependence parameter. If the dimension of the copula is big
theta
determines, whether the dependency parameter $\theta$ or Kendall's rank correlation coefficient $\tau$ is printed.
h
the height of the rectangles.
l
the width of the rectangles.
circles
a positive number giving the radius of the circles.
digits
an integer specifying the number of digits of the dependence parameter.
...
arguments to be passed to methods, such as graphical parameters (see par).

Details

The user is advised to make the plot window as big as possible, since some printed text (e.g. the correlation parameter) could be outside of the rectangles or circles. Subscripts can only appear, if the dimension of the copula is strictly smaller than 8. If the hac refers to Archimedean copulae, the variables are always labeled by ``V$i$'', where $i = 1, \dots, k$ and $k$ denotes the amount of variables. This is reasoned by the exchangeability of the variables in the case of AC.

See Also

estimate.copula

Examples

Run this code
# a hac object is created
Matrix = matrix(c(1.988, 0, 0, 0, 3.234, 4.567, 0, 0, ~X1, ~X2, ~X3, ~X4),
nrow = 3, byrow = TRUE)
Object = hac(HAC_GUMBEL, Matrix)

# do not forget to make the plot window as big as possible
plot(Object, col = "red", fg = "red", index = TRUE)

# the same procedure works for an estimated object
x = rHAC(1000, Object)
est.obj = estimate.copula(x, HAC_GUMBEL, method = ML)

# the result can be properly presented without any effort
plot(est.obj, index = TRUE, digits = 5)

# as explained, ylim should be adjusted for AC
ac_model = hac(type = AC_GUMBEL, X = 3, dim = 3)
plot(ac_model, ylim = c(-0.4, 1.25), l = 1, h = 0.35)

Run the code above in your browser using DataLab