Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

kcopula

Kernel copula (density) estimate


Description

Kernel copula and copula density estimator for 2-dimensional data.

Usage

kcopula(x, H, hs, gridsize, gridtype, xmin, xmax, supp=3.7, eval.points,
  binned, bgridsize, w, verbose=FALSE, marginal="kernel")
kcopula.de(x, H, gridsize, gridtype, xmin, xmax, supp=3.7,
  eval.points, binned, bgridsize, w, verbose=FALSE, compute.cont=TRUE,
  approx.cont=TRUE, marginal="kernel", boundary.supp, boundary.kernel="beta")

Arguments

x

matrix of data values

H,hs

bandwidth matrix. If these are missing, Hpi.kcde/Hpi or hpi.kcde/hpi is called by default.

gridsize

vector of number of grid points

gridtype

not yet implemented

xmin,xmax

vector of minimum/maximum values for grid

supp

effective support for standard normal

eval.points

matrix of points at which estimate is evaluated

binned

flag for binned estimation

bgridsize

vector of binning grid sizes

w

vector of weights. Default is a vector of all ones.

verbose

flag to print out progress information. Default is FALSE.

marginal

"kernel" = kernel cdf or "empirical" = empirical cdf to calculate pseudo-uniform values. Default is "kernel".

compute.cont

flag for computing 1% to 99% probability contour levels. Default is TRUE.

approx.cont

flag for computing approximate probability contour levels. Default is TRUE.

boundary.supp

effective support for boundary region

boundary.kernel

"beta" = beta boundary kernel, "linear" = linear boundary kernel

Details

For kernel copula estimates, a transformation approach is used to account for the boundary effects. If H is missing, the default is Hpi.kcde; if hs are missing, the default is hpi.kcde.

For kernel copula density estimates, for those points which are in the interior region, the usual kernel density estimator (kde) is used. For those points in the boundary region, a product beta kernel based on the boundary corrected univariate beta kernel of Chen (1999) is used (kde.boundary). If H is missing, the default is Hpi.kcde; if hs are missing, the default is hpi.

The effective support, binning, grid size, grid range parameters are the same as for kde.

Value

A kernel copula estimate, output from kcopula, is an object of class kcopula. A kernel copula density estimate, output from kcopula.de, is an object of class kde. These two classes of objects have the same fields as kcde and kde objects respectively, except for

x

pseudo-uniform data points

x.orig

data points - same as input

marginal

marginal function used to compute pseudo-uniform data

boundary

flag for data points in the boundary region (kcopula.de only)

References

Duong, T. (2014) Optimal data-based smoothing for non-parametric estimation of copula functions and their densities. Submitted.

Chen, S.X. (1999). Beta kernel estimator for density functions. Computational Statistics & Data Analysis, 31, 131–145.

See Also

Examples

library(MASS)
data(fgl)
x <- fgl[,c("RI", "Na")]
Chat <- kcopula(x=x)
plot(Chat, disp="persp", thin=3, col="white", border=1)

ks

Kernel Smoothing

v1.12.0
GPL-2 | GPL-3
Authors
Tarn Duong [aut, cre], Matt Wand [ctb], Jose Chacon [ctb], Artur Gramacki [ctb]
Initial release
2021-02-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.