Learn R Programming

kdecopula (version 0.4.1)

dkdecop: Working with kdecopula objects

Description

The function kdecop stores it's result in ojbect of class kdecopula. The density estimate can be evaluated on arbitrary points with dkdecop; the cdf with pkdecop. Furthermore, synthetic data can be simulated with rkdecop.

Usage

dkdecop(u, obj, stable = FALSE)

pkdecop(u, obj)

rkdecop(n, obj, quasi = FALSE)

Arguments

u
mx2 matrix of evaluation points.
obj
kdecop object.
stable
logical; option for stabilizing the estimator: the estimated density is cut off at $50$.
n
integer; number of observations.
quasi
logical; the default (FALSE) returns pseudo-random numbers, use TRUE for quasi-random numbers (generalized Halton, see ghalton).

Value

  • A numeric vector of the density/cdf or a n x 2 matrix of simulated data.

References

Geenens, G., Charpentier, A., and Paindaveine, D. (2014). Probit transformation for nonparametric kernel estimation of the copula density. arXiv:1404.4414 [stat.ME]. Nagler, T. (2014). Kernel Methods for Vine Copula Estimation. Master's Thesis, Technische Universitaet Muenchen, https://mediatum.ub.tum.de/node?id=1231221 Cambou, T., Hofert, M., Lemieux, C. (2015). A primer on quasi-random numbers for copula models, arXiv:1508.03483 [stat.CO]

See Also

kdecop, plot.kdecopula, ghalton

Examples

Run this code
## load data and transform with empirical cdf
data(wdbc)
udat <- apply(wdbc[, -1], 2, function(x) rank(x)/(length(x)+1))

## estimation of copula density of variables 5 and 6
dens.est <- kdecop(udat[, 5:6])
plot(dens.est)

## evaluate density estimate at (u1,u2)=(0.123,0.321)
dkdecop(c(0.123, 0.321), dens.est)

## evaluate cdf estimate at (u1,u2)=(0.123,0.321)
pkdecop(c(0.123, 0.321), dens.est)

## simulate 500 samples from density estimate
rkdecop(500, dens.est)

Run the code above in your browser using DataLab