plot.SimCop: Plot a bivariate copula or its density

View source: R/plot.SimCop.R

plot.SimCopR Documentation

Plot a bivariate copula or its density

Description

Plot a bivariate copula or its density function. Essentially hands over immediately to persp3d.

Usage

## S3 method for class 'SimCop'
plot(x, ...)

## S3 method for class 'SimCop'
persp3d(
  x,
  ...,
  type = c("cdf", "pdf"),
  nx = 129,
  ny = 129,
  col = heat.colors(100),
  qcut = 0.95,
  cut,
  xlab = expression(u[1]),
  ylab = expression(u[2])
)

Arguments

x

an object of class ‘SimCop’.

...

additional arguments passed to persp3d.

type

specifies whether the copula (“cdf”) or its probability density function (“pdf”) is plotted; see ‘Details’. Can be abbreviated.

nx, ny

length of grids that define the gridlines on which the plotted function is evaluated.

col

colour scheme to use for the surface; see ‘Details’.

qcut, cut

used if type is “pdf”; see ‘Details’.

xlab, ylab

default labels for the two axes.

Details

If type is “pdf”, then x must have a function with name “pdfCopula” in its environment which evaluates the probability density function of the copula stored in x.

For plotting the copula, the “x”-grid and “y”-grid are produced by using, respectively, nx and ny equispaced points between 0 and 1 (inclusive). To avoid evaluating the density function at the boundary, if type is “pdf”, then grids are initially generated in the same manner, after which the first grid point is removed and all remaining grid points are shifted towards the origin by half the distance between two neighbouring grid points.

The function to be plotted is evaluated at all possible combination of the grid points. As the function values of the density function can be large, in particular for extreme value copulae, the values are truncated using either cut (absolute value) or qcut (corresponding quantile of all values as determined by the quantile function).

Finally, the colour scheme passed by argument col is used to assign a colour to every point at which the function was evaluated by linearly mapping the function values onto the provided colours.

Value

Returns a list with four components invisibly. Components x and y contain the location of grid lines at which the function was evaluate. Component z contains the function evaluations (possibly truncated) and component col contains the col used.

Author(s)

Berwin A Turlach berwin.turlach@gmail.com

Examples

Cop1 <- NewMVFrankCopula(2)
plot(Cop1)
plot(Cop1, type = "p", qcut = 1)


SimCop documentation built on April 13, 2025, 5:09 p.m.

Related to plot.SimCop in SimCop...