Learn R Programming

copula (version 0.5-8)

Copula: The Copula Distribution

Description

Density, distribution function, and random generation for a "copula" object.

Usage

dcopula(copula, u)
pcopula(copula, u)
rcopula(copula, n)

Arguments

copula
a "copula" object.
u
a vector of the copula dimension or a matrix with number of rows being the copula dimension, giving the coordinates of the points where the density of distribution function need to be evaluated.
n
number of observations to be generated.

Value

  • 'dcopula' gives the density, 'pcopula' gives the distribution function, and 'rcopula' generates random variates.

Details

The density function of an Archimedean copula is obtained by differentiating the distribution function symbolically using D.

The distribution function of a t copula uses pmvt from package mvtnorm. The density function of a t copula uses the dmst from package sn.

The random number generator for an Archiimedean copula uses the conditional approach for bivariate case and the Marshal-Olkin (1988) approach for dimension greater than 2.

References

Joe (1997), Multivariate Models and Dependence Concepts, Chapman and Hall, London. Nelsen (1999), An introduction to Copulas, Springer, New York.

See Also

copula-class, ellipCopula, archmCopula, fgmCopula.

Examples

Run this code
norm.cop <- normalCopula(0.5)
norm.cop
x <- rcopula(norm.cop, 100)
plot(x)
dcopula(norm.cop, x)
pcopula(norm.cop, x)
persp(norm.cop, dcopula)
contour(norm.cop, pcopula)
## a 3-dimensional normal copula
u <- rcopula(normalCopula(0.5, dim = 3), 1000)
## scatterplot3d(u)
## a 3-dimensional clayton copula
v <- rcopula(claytonCopula(2, dim = 3), 1000)
## scatterplot3d(v)

Run the code above in your browser using DataLab