The continuous convolution kernel density estimator is defined as the classical kernel density estimator based on continuously convoluted data (see cont_conv()). cckde() fits the estimator (including bandwidth selection), dcckde() and predict.cckde() can be used to evaluate the estimator.

cckde(x, bw = NULL, mult = 1, theta = 0, nu = 5, ...)

dcckde(x, object)

# S3 method for cckde
predict(object, newdata, ...)

Arguments

x

a matrix or data frame containing the data (or evaluation points).

bw

vector of bandwidth parameter; if NULL, the bandwidths are selected automatically by likelihood cross validation.

mult

bandwidth multiplier; either a positive number or a vector of such. Each bandwidth parameter is multiplied with the corresponding multiplier.

theta

scale parameter of the USB distribution (see, dusb()).

nu

smoothness parameter of the USB distribution (see, dusb()). The estimator uses the Epanechnikov kernel for smoothing and the USB distribution for continuous convolution (default parameters correspond to the uniform distribution on \([-0.5, 0.5]\).

...

unused.

object

cckde object.

newdata

matrix or data frame containing evaluation points.

Details

If a variable should be treated as ordered discrete, declare it as ordered(), factors are expanded into discrete dummy codings.

References

Nagler, T. (2017). A generic approach to nonparametric function estimation with mixed data. arXiv:1704.07457

Examples

# dummy data with discrete variables dat <- data.frame( F1 = factor(rbinom(10, 4, 0.1), 0:4), Z1 = ordered(rbinom(10, 5, 0.5), 0:5), Z2 = ordered(rpois(10, 1), 0:10), X1 = rnorm(10), X2 = rexp(10) ) fit <- cckde(dat) # fit estimator dcckde(dat, fit) # evaluate density
#> [1] 0.006360467 0.014830314 0.014789641 0.005534092 0.011112256 0.014951847 #> [7] 0.011272190 0.012159131 0.004525394 0.007624159
predict(fit, dat) # equivalent
#> [1] 0.006360467 0.014830314 0.014789641 0.005534092 0.011112256 0.014951847 #> [7] 0.011272190 0.012159131 0.004525394 0.007624159