View source: R/plot.CopApprox.R
plot.CopApprox | R Documentation |
Plots the histogram density approximation to a copula as determined by GetApprox
. Currently works only for bivariate copulae.
## S3 method for class 'CopApprox'
plot(
x,
type = c("rgl", "original"),
col = if (type == "rgl") "#cccccc" else grey.colors(100, start = 0, end = 0.8),
qcut = 0.95,
cut,
alpha = 1,
topcol = "#ff0000",
sidecol = "#aaaaaa",
linecol = "#000000",
...
)
x |
an object of |
type |
specifies the type of plot to produce. Possible values are “ |
col |
colour(s) to be used; see ‘Details’. |
qcut , cut |
used if |
alpha , topcol , sidecol , linecol |
used if |
... |
used if |
If type
is “original
” then plots are produced of the kind shown in Tajvidi and Turlach (2017). In this case the dot arguments are passed to plot
when the initial plot is created. Thus, they can be used to set the main title, axes labels and so forth. If the approximation is of type Approximation II, then argument col
is used to colour the squares while they are plotted and filled via polygon
. For this, the ranks of the probability masses of the squares are mapped (linearly) onto the provided colours.
If type
is “rgl
” then plots are used using rgl
. The code used is based on the ‘hist3d
’ demo of the rgl
package. The argument col
sets the background colour of the plot. Arguments topcol
and sidecol
are used to set the colour of the top and sides of the cuboids, and the edges of the cuboids are drawn using linecol
. Argument alpha
sets the transparency. Finally, as the heights of the cuboids can be large, in particular for extreme value copulae, their heights are truncated using either cut
(absolute value) or qcut
(corresponding quantile of all heights as determined by the quantile
function). After truncation, the heights are rescaled to be between 0 and 1, thus the unit on the “z”-axis is meaningless.
NULL
is returned invisibly.
Berwin A. Turlach berwin.turlach@gmail.com
Tajvidi, N. and Turlach, B.A. (2017). A general approach to generate random variates for multivariate copulae, Australian & New Zealand Journal of Statistics 60(1): 140–155. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/anzs.12209")}.
Cop <- NewMEVGumbelCopula(4)
CopApprox1 <- GetApprox(Cop, dim=2)
plot(CopApprox1)
plot(CopApprox1, type = "o")
CopApprox2 <- GetApprox(Cop, dim=2, type=2)
plot(CopApprox2)
plot(CopApprox2, type = "o", xlab = expression(u[1]), ylab = expression(u[2]))
plot(CopApprox2, type = "o", col = heat.colors(100))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.