Learn R Programming

kdecopula (version 0.4.1)

kdecop: Bivariate kernel copula density estimation

Description

Based on samples from a bivariate copula, the copula density is estimated. The user can choose between different methods. If no bandwidth is provided by the user, it will be set by a method-specific automatic selection procedure. The related (d/p/r)kdecop functions evaluate the density and cdf or simulate synthetic data, respectively.

Usage

kdecop(udata, bw = NA, mult = 1, method = "TLL2", knots = 50,
  renorm.iter = 3L, info = TRUE)

Arguments

udata
nx2 matrix of copula data.
bw
bandwidth specification; if NA, bw is selected automatically; Otherwise, please provide (for the respective method) "MR", "beta": a positive real number, "T": a $2x2$ matrix for method, "TLL1",
mult
bandwidth multiplier, has to be positive; useful for making estimates more/less smooth manually.
method
"MR": mirror-reflection estimator, "beta": beta kernel estimator, "T": transformation estimator with standard bivariate kernel estimation, "TLL1": transformation estimator with log-linear local likel
knots
integer; number of knots in each dimension for the spline approximation.
renorm.iter
integer; number of iterations for the renormalization procedure (see Details).
info
logical; if TRUE, additional information about the estimate will be gathered (see Value).

Value

  • The function kdecop returns an object of class kdecopula that contains all information necessary for evaluation of the estimator. If no bandwidth was provided in the function call, the automatically selected value can be found in the variable object$bw. If info=TRUE, also the following will be available under object$info:
  • likvaluesEstimator evaluated in sample points
  • loglikLog likelihood
  • effpEffective number of parameters
  • AICAkaike information criterion
  • cAICBias-corrected version of Akaike information criterion
  • BICBayesian information criterion.
  • The density estimate can be evaluated on arbitrary points with dkdecop; the cdf with pkdecop. Furthermore, synthetic data can be simulated with rkdecop, and several plotting options are available with plot and contour.

Details

Details on the estimation methods and bandwidth selection can be found in Geenens et al. (2014) for methods TLL1/2 and Nagler (2014) for other methods. We use a Gaussian product kernel function for all methods except the beta kernel estimator. Kernel estimates are usually no proper copula densities. In particular, the estimated marginal densities are not uniform. We mitigate this issue bei implementing a renormalization procedure. The number of iterations of the renormalization algorithm can be specified with the renorm.iter argument. Typically, a very small number of iterations is sufficient. The implementation of the tapered transformation estimator ("TTPI"/"TTCV") was kindly provided by Kuangyu Wen.

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 Wen, K. and Wu, X. (2015). Transformation-Kernel Estimation of the Copula Density, Working paper, http://agecon2.tamu.edu/people/faculty/wu-ximing/agecon2/public/copula.pdf

See Also

kdecopula, plot.kdecopula, dkdecop, pkdecop, rkdecop

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