rCopula_y: Sampling from a given contour level

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This method draws a sample from a given copula for a given contour level respecting the copula density along the contour.

Usage

1
rCopula_y(y, copula, n = 1, n.disc = 100)

Arguments

y

A vector of contour levels, i.e. y = C(u,v).

copula

a copula object that is used

n

The number of samples; can only be larger 1 if a single contour level "y" is provided.

n.disc

An integer giving the approximate number of evaluation points of the contour curve(s) per axis.

Details

A) The contour curve is evaluated for each value of y. The length of this contour curve is approximated as piece-wise linear and the copula density along this curve is integrated. B) Taking am appropriate uniform random number and applying the inverse of the (almost) CDF yields a distance d on the contour curve. Based on the piece-wise linear function, a pair (u,v) is found that represents the above distance d. Depending if the pair lies in the upper or lower triangle, u or v is fixed and qCopula_u respectively qCopula_v is applied to find the "exact" random pair on the contour curve. The procedure starting in A is repeated for each value in y or the procedure starting in B is repeated n-times if only a single y is provided.

Value

A matrix of random pairs with as many rows as values in y or n if only a single value y is given.

Author(s)

Benedikt Graeler

See Also

rCopula

Examples

1
2
contour(frankCopula(4), pCopula, asp=1)
points(rCopula_y(0.4, frankCopula(4), 100), asp=1, xlim=c(0.8,1), col="red")

BenGraeler/spcopula documentation built on Nov. 20, 2020, 4:07 p.m.