kde1d: Univariate kernel density estimation for bounded and...

View source: R/kde1d.R

kde1dR Documentation

Univariate kernel density estimation for bounded and unbounded support

Description

Discrete variables are convoluted with the uniform distribution (see, Nagler, 2017). If a variable should be treated as discrete, declare it as ordered().

Usage

kde1d(x, mult = 1, xmin = -Inf, xmax = Inf, bw = NULL, bw_min = 0, ...)

Arguments

x

vector of length n.

mult

numeric; the actual bandwidth used is bw*mult.

xmin

lower bound for the support of the density.

xmax

upper bound for the support of the density.

bw

bandwidth parameter; has to be a positive number or NULL; the latter calls KernSmooth::dpik().

bw_min

minimum value for the bandwidth.

...

unused.

Details

If xmin or xmax are finite, the density estimate will be 0 outside of [xmin, xmax]. Mirror-reflection is used to correct for boundary bias. Discrete variables are convoluted with the uniform distribution (see, Nagler, 2017).

Value

An object of class kde1d.

References

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

See Also

dkde1d, pkde1d, qkde1d, rkde1d plot.kde1d , lines.kde1d

Examples

data(wdbc, package = "kdecopula")  # load data
fit <- kde1d(wdbc[, 5])            # estimate density
dkde1d(1000, fit)                  # evaluate density estimate


kdevine documentation built on Oct. 18, 2022, 5:05 p.m.