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

persp-methods

Methods for Function ‘persp’ in Package ‘copula’


Description

Methods for function persp to draw perspective plots (of two dimensional distributions from package copula).

Usage

## S4 method for signature 'Copula'
persp(x, FUN, n.grid = 26, delta = 0,
      xlab = "u1", ylab = "u2",
      zlab = deparse(substitute(FUN))[1], zlim = NULL,
      theta = -30, phi = 30, expand = 0.618,
      ticktype = "detail", ...)
## S4 method for signature 'mvdc'
persp(x, FUN, xlim, ylim, n.grid = 26,
      xlab = "x1", ylab = "x2", zlab = deparse(substitute(FUN))[1],
      theta = -30, phi = 30, expand = 0.618,
      ticktype = "detail", ...)

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].

xlim, ylim

The range of the x and y variables, respectively.

xlab, ylab, zlab, zlim, theta, phi, expand, ticktype, ...

Arguments for (the default method of) persp(), the ones enumerated here all with different defaults than there.

Value

invisible; a list with the following components:

x, y

The numeric vectors, as passed to persp.default.

z

The matrix of evaluated FUN values on the grid as passed to persp.default.

persp

the 4 x 4 transformation matrix returned by persp.default.

Methods

Perspective plots for both "copula" or "mvdc" objects, see x in the Arguments section.

See Also

The contour-methods for drawing contour lines of the same functions.

Examples

persp(claytonCopula(2),   pCopula, main = "CDF of claytonCopula(2)")
persp(  frankCopula(1.5), dCopula, main = "Density of frankCopula(1.5)")
persp(  frankCopula(1.5), dCopula, main = "c_[frank(1.5)](.)", zlim = c(0,2))

## Examples with negative tau:
(th1 <- iTau(amhCopula(), -0.1))
persp(amhCopula(th1), dCopula)
persp(amhCopula(th1), pCopula, ticktype = "simple") # no axis ticks
persp(  frankCopula(iTau(  frankCopula(), -0.1)), dCopula)
persp(claytonCopula(iTau(claytonCopula(), -0.1)), dCopula)
##
cCop.2 <- function(u, copula, ...) cCopula(u, copula, ...)[,2]
persp(    amhCopula(iTau(    amhCopula(), -0.1)), cCop.2, main="cCop(AMH...)[,2]")
persp(  frankCopula(iTau(  frankCopula(), -0.1)), cCop.2, main="cCop(frankC)[,2]")
## and  Clayton  also looks "the same" ...

## MVDC Examples ------------------------------------
mvNN <- mvdc(gumbelCopula(3), c("norm", "norm"),
          list(list(mean = 0, sd = 1), list(mean = 1)))
persp(mvNN, dMvdc, xlim=c(-2, 2), ylim=c(-1, 3), main = "Density")
persp(mvNN, pMvdc, xlim=c(-2, 2), ylim=c(-1, 3), main = "Cumulative Distr.")

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.