Learn R Programming

copula (version 0.999-1)

Cn: Computes the empirical copula

Description

Given a random sample from a distribution with continuous margins and copula C, the empirical copula is a natural nonparametric estimator of C.

Usage

Cn(x, w)

Arguments

x
a data matrix whose lines represent a multivariate random sample that will be transformed to pseudo-observations.
w
a matrix with the same number of columns as x whose lines represent the points where the empirical copula of x will be evaluated.

Value

  • Returns a numeric containing the values of the empirical copula of x at the points specified in w.

Details

There are several asymptotically equivalent definitions of the empirical copula. Here, the empirical copula is simply defined as the empirical cumulative distribution function computed from the pseudo-observations, i.e., multivariate ranks divided by the number of observations plus one.

References

Rü{u}schendorf, L. (1976). Asymptotic distributions of multivariate rank order statistics, Annals of Statistics. 4, 912--923.

Deheuvels, P. (1979). La fonction de dépendance empirique et ses propriétés: un test non paramétrique d'indépendance, Acad. Roy. Belg. Bull. Cl. Sci., 5th Ser. 65, 274--292.

Deheuvels, P. (1981). A non parametric test for independence, Publ. Inst. Statist. Univ. Paris. 26, 29--50.

See Also

pCopula.

Examples

Run this code
n <- 20
gumbel.cop <- gumbelCopula(4)
u <- rCopula(n, gumbel.cop)
## points were to evaluate the empirical copula
w <- matrix(runif(2 * n), n, 2)
ec <- Cn(u, w)
## compare with true c.d.f.
mean(abs(pCopula(w, gumbel.cop) - ec))
## increase n to decrease the mean absolute error

## compare the empirical copula and the true copula c.d.f.
## on the diagonal of the unit square
curve(Cn(u, cbind(x, x)), 0, 1)
curve(pCopula(cbind(x, x), gumbel.cop), lty = 2, add = TRUE)

Run the code above in your browser using DataLab