wireframe2-methods | R Documentation |
Generic function and methods wireframe2()
to draw
(lattice) wireframe
(aka
“perspective”) plots of two-dimensional distributions from
package copula.
## 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),
draw.4.pCoplines = FALSE, ...)
## _identical_ method for 'data.frame' as for 'matrix'
## S4 method for signature 'Copula'
wireframe2(x, FUN, n.grid = 26, delta = 0,
xlim = 0:1, ylim = 0:1, zlim = NULL,
xlab = quote(u[1]), ylab = quote(u[2]),
zlab = list(deparse(substitute(FUN))[1], rot = 90),
draw.4.pCoplines = identical(FUN, pCopula), ...)
## S4 method for signature 'mvdc'
wireframe2(x, FUN, n.grid = 26, xlim, ylim, zlim = NULL,
xlab = quote(x[1]), ylab = quote(x[2]),
zlab = list(deparse(substitute(FUN))[1], rot = 90), ...)
x |
a |
xlim , ylim , zlim |
the x-, y- and z-axis limits. |
xlab , ylab , zlab |
the x-, y- and z-axis labels. |
scales |
a |
FUN |
the |
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 |
delta |
a small number in |
draw.4.pCoplines |
logical indicating if the 4 known border
segments of a copula distribution function, i.e., |
alpha.regions , par.settings , ... |
additional arguments passed to
the underlying |
An object of class “trellis” as returned by wireframe()
.
Wireframe plots for objects of class "matrix"
,
"data.frame"
, "Copula"
or
"mvdc"
.
The persp-methods
for drawing perspective plots via base graphics.
The lattice-based contourplot2-methods
.
## 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)
wireframe2(x.W, shade = TRUE) # plot of W
wireframe2(x.M, drape = TRUE) # plot of M
## use with custom colors:
myPalette <- colorRampPalette(c("white","darkgreen", "gold", "red"))
myPar <- lattice::standard.theme(region = myPalette(16))
wireframe2(x.W, shade = TRUE, par.settings = myPar)
## For 'Copula' objects
cop <- frankCopula(-4)
wireframe2(cop, pCopula) # the copula
wireframe2(cop, pCopula, shade = TRUE) # ditto, "shaded" (but color=FALSE)
wireframe2(cop, pCopula, shade = TRUE, par.settings=list()) # use lattice default colors
wireframe2(cop, pCopula, shade = TRUE, col.4 = "gray60") # ditto, "shaded"+grid
wireframe2(cop, pCopula, drape = TRUE, xlab = quote(x[1])) # adjusting an axis label
wireframe2(cop, dCopula, delta=0.01) # the density
wireframe2(cop, dCopula, shade = TRUE, par.settings=list()) # use lattice default colors
wireframe2(cop, dCopula) # => the density is set to 0 on the margins
wireframe2(cop, function(u, copula) dCopula(u, copula, log=TRUE),
shade = TRUE, par.settings = myPar,
zlab = list(quote(log(c(u[1],u[2]))), rot=90), main = "dCopula(.., log=TRUE)")
## 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))
wireframe2(mvNN, dMvdc, xlim=c(-2, 2), ylim=c(-1, 3), shade=TRUE, par.settings=list())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.