wireframe2-methods {copula}R Documentation

Perspective Plots - 'wireframe2' in Package 'copula'

Description

Generic function and methods wireframe2() to draw wireframe (aka “perspective”) plots of three dimensional distributions from package copula.

Usage

## S4 method for signature 'matrix'
wireframe2(x,
      xlim = range(x[,1], finite = TRUE),
      ylim = range(x[,2], finite = TRUE),
      zlim = range(x[,3], finite = TRUE),
      xlab = NULL, ylab = NULL, zlab = NULL,
      alpha.regions = 0.5, scales = list(arrows = FALSE, col = "black"),
      par.settings = standard.theme(color = FALSE), ...)
## S4 method for signature 'data.frame'
wireframe2(x,
      xlim = range(x[,1], finite = TRUE),
      ylim = range(x[,2], finite = TRUE),
      zlim = range(x[,3], finite = TRUE),
      xlab = NULL, ylab = NULL, zlab = NULL,
      alpha.regions = 0.5, scales = list(arrows = FALSE, col = "black"),
      par.settings = standard.theme(color = FALSE), ...)
## S4 method for signature 'Copula'
wireframe2(x, FUN, n.grid = 26, delta = 0,
      xlim = 0:1, ylim = 0:1, zlim = NULL,
      xlab = expression(u[1]), ylab = expression(u[2]),
      zlab = list(deparse(substitute(FUN))[1], rot = 90), ...)
## S4 method for signature 'mvdc'
wireframe2(x, FUN, n.grid = 26, xlim, ylim, zlim = NULL,
      xlab = expression(x[1]), ylab = expression(x[2]),
      zlab = list(deparse(substitute(FUN))[1], rot = 90), ...)

Arguments

x

a "matrix", "data.frame", "Copula" or a "mvdc" object.

xlim, ylim, zlim

the x-, y- and z-axis limits.

xlab, ylab, zlab

the x-, y- and z-axis labels.

alpha.regions

see wireframe().

scales

a list determining how the axes are drawn; see wireframe().

par.settings

See wireframe().

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

...

additional arguments passed to the underlying wireframe().

Value

An object of class “trellis” as returned by wireframe().

Methods

Wireframe plots for objects of class "matrix" , "data.frame", "Copula" or "mvdc".

See Also

The persp-methods for drawing perspective plots via base graphics.

Examples

## For 'matrix' objects
## The Frechet--Hoeffding bounds W and M
n.grid <- 26
u <- seq(0, 1, length.out = n.grid)
grid <- expand.grid("u[1]" = u, "u[2]" = u)
W <- function(u) pmax(0, rowSums(u)-1) # lower bound W
M <- function(u) apply(u, 1, min) # upper bound M
x.W <- cbind(grid, "W(u[1],u[2])" = W(grid)) # evaluate W on 'grid'
x.M <- cbind(grid, "M(u[1],u[2])" = M(grid)) # evaluate M on 'grid'
wireframe2(x.W) # plot of W
wireframe2(x.M) # plot of M

## For 'Copula' objects
cop <- frankCopula(-4)
wireframe2(cop, pCopula) # the copula
wireframe2(cop, pCopula, xlab = expression(x[1])) # adjusting an axis label
wireframe2(cop, dCopula, delta=0.01) # the density
wireframe2(cop, dCopula) # => the density is set to 0 on the margins

## For 'mvdc' objects
mvNN <- mvdc(gumbelCopula(3), c("norm", "norm"),
             list(list(mean = 0, sd = 1), list(mean = 1)))
wireframe2(mvNN, dMvdc, xlim=c(-2, 2), ylim=c(-1, 3))

[Package copula version 0.999-15 Index]