Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

contour-methods

Methods for Contour Plots in Package 'copula'


Description

Methods for function contour to draw contour lines aka a level plot for objects from package copula.

Usage

## S4 method for signature 'Copula'
contour(x, FUN,
                   n.grid = 26, delta = 0,
                   xlab = quote(u[1]), ylab = quote(u[2]),
                   box01 = TRUE, ...)
## S4 method for signature 'mvdc'
contour(x, FUN, xlim, ylim, n.grid = 26,
                   xlab = quote(x[1]), ylab = quote(x[2]),
		   box01 = FALSE, ...)

Arguments

x

a "Copula" or a "mvdc" object.

FUN

the function to be plotted; typically dCopula or pCopula.

n.grid

the number of grid points used in each dimension. This can be a vector of length two, giving the number of grid points used in x- and y-direction, respectively; the function FUN will be evaluated on the corresponding (x,y)-grid.

delta

a small number in [0, 1/2) influencing the evaluation boundaries. The x- and y- vectors will have the range [0+delta, 1-delta], the default being [0,1].

xlab, ylab

the x-axis and y-axis labels.

xlim, ylim

the range of the x and y variables, respectively.

box01

a logical specifying if a faint rectangle should be drawn on the boundary of [0,1]^2 (often useful for copulas, but typically not for general multivariate distributions ("mvdc")).

...

further arguments for (the default method of) contour(), e.g., nlevels, levels, etc.

Methods

Contour lines are drawn for "Copula" or "mvdc" objects, see x in the Arguments section.

See Also

The persp-methods for “perspective” aka “3D” plots.

Examples

contour(frankCopula(-0.8), dCopula)
contour(frankCopula(-0.8), dCopula, delta=1e-6)
contour(frankCopula(-1.2), pCopula)
contour(claytonCopula(2), pCopula)

## the Gumbel copula density is "extreme"
## --> use fine grid (and enough levels):
r <- contour(gumbelCopula(3), dCopula, n=200, nlevels=100)
range(r$z)# [0, 125.912]
## Now superimpose contours of three resolutions:
contour(r, levels = seq(1, max(r$z), by=2), lwd=1.5)
contour(r, levels = (1:13)/2, add=TRUE, col=adjustcolor(1,3/4), lty=2)
contour(r, levels = (1:13)/4, add=TRUE, col=adjustcolor(2,1/2),
        lty=3, lwd=3/4)

x <- mvdc(gumbelCopula(3), c("norm", "norm"),
          list(list(mean = 0, sd =1), list(mean = 1)))
contour(x, dMvdc, xlim=c(-2, 2), ylim=c(-1, 3))
contour(x, pMvdc, xlim=c(-2, 2), ylim=c(-1, 3))

copula

Multivariate Dependence with Copulas

v1.0-1
GPL (>= 3) | file LICENCE
Authors
Marius Hofert [aut] (<https://orcid.org/0000-0001-8009-4665>), Ivan Kojadinovic [aut] (<https://orcid.org/0000-0002-2903-1543>), Martin Maechler [aut, cre] (<https://orcid.org/0000-0002-8685-9910>), Jun Yan [aut] (<https://orcid.org/0000-0003-4401-7296>), Johanna G. Nešlehová [ctb] (evTestK(), <https://orcid.org/0000-0001-9634-4796>), Rebecca Morger [ctb] (fitCopula.ml(): code for free mixCopula weight parameters)
Initial release
2020-12-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.