plot-methods: Methods for 'plot' in Package 'copula'

plot-methodsR Documentation

Methods for 'plot' in Package 'copula'

Description

Methods for plot() to draw a scatter plot of a random sample from bivariate distributions from package copula.

Usage


## S4 method for signature 'Copula,ANY'
plot(x, n, xlim = 0:1, ylim = 0:1,
      xlab = quote(U[1]), ylab = quote(U[2]), main = NULL, ...)
## S4 method for signature 'mvdc,ANY'
plot(x, n, xlim = NULL, ylim = NULL,
      xlab = quote(X[1]), ylab = quote(X[2]), ...)

Arguments

x

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

n

when x is not matrix-like: The sample size of the random sample drawn from x.

xlim, ylim

the x- and y-axis limits.

xlab, ylab

the x- and y-axis labels.

main

the main title; when true, shows the call's x “expression”. By default, when NULL and the x expression matches "[Cc]opula" that expression is used as well. This smart default is somewhat experimental; feedback is welcome.

...

additional arguments passed to plot methods, i.e., typically plot.default.

Value

invisible().

See Also

splom2() for a scatter-plot matrix based on splom().

Examples

## For 2-dim. 'copula' objects -------------------------
## Plot uses  n  compula samples
n <- 1000 # sample size
set.seed(271) # (reproducibility)
plot(tCopula(-0.8, df = 1.25), n = n) # automatic main title!

nu <- 3 # degrees of freedom
tau <- 0.5 # Kendall's tau
th <- iTau(tCopula(df = nu), tau) # corresponding parameter
cop <- tCopula(th, df = nu) # define 2-d copula object
plot(cop, n = n)

## For 2-dim. 'mvdc' objects ---------------------------
mvNN <- mvdc(cop, c("norm", "norm"),
             list(list(mean = 0, sd = 1), list(mean = 1)))
plot(mvNN, n = n)

copula documentation built on Feb. 7, 2024, 3:01 p.m.