Learn R Programming

copula (version 0.999-14)

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

"persp"(x, fun, n = 51, delta = 0, xlab = "x", ylab = "y", zlab = deparse(substitute(fun))[1], theta = -30, phi = 30, expand = 0.618, ticktype = "detail", ...)
"persp"(x, fun, xlim, ylim, nx = 51, ny = 51, xis = seq(xlim[1], xlim[2], length = nx), yis = seq(ylim[1], ylim[2], length = ny), xlab = "x", ylab = "y", zlab = deparse(substitute(fun))[1], theta = -30, phi = 30, expand = 0.618, ticktype = "detail", ...)

Arguments

x
either a "copula" or a "mvdc" object.
fun
the function to be plotted; typically dCopula or pCopula.
n
(for "copula":) the number of points in both directions to do the plotting. The function fun will be evaluated on a grid of size $n x n$.
delta
a very small number in $[0, 1/2)$, defaulting to zero. The x- and y- vectors will use range [0+delta, 1-delta], i.e., [0,1] by default.
xlim, ylim
("mvdc":) the range of the x or y variable, respectively.
nx,ny
("mvdc":) the number of points in x- or y-direction, respectively. The function fun will be evaluated on a grid of size $nx x ny$.
xis, yis
("mvdc":) instead of specifying xlim, ylim and nx, ny, the numeric vectors (of length nx and ny) may be specified directly.
xlab, ylab, zlab, theta, phi, expand, ticktype, ...
arguments for (the default method of) persp(), the ones enumerated here all with different defaults than there.

Value

invisibly (invisible) a list with components
x,y
the numeric vectors, as passed to persp.default.
z
the $nx x ny$ matrix, 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

Run this code
persp(frankCopula(-0.8), dCopula)
persp(claytonCopula(2),  pCopula, main = "CDF of claytonCopula(2)")
## example with negative tau :
(th1 <- iTau(amhCopula(), -0.1))
persp(amhCopula(th1), dCopula)
persp(amhCopula(th1), pCopula, ticktype = "simple")# no axis ticks

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.")

Run the code above in your browser using DataLab