debiased_kde: Debiased kernel density estimation and confidence bands

View source: R/kde.R

debiased_kdeR Documentation

Debiased kernel density estimation and confidence bands

Description

Evaluate the Gaussian debiased KDE in equation (3) of Cheng and Chen or construct its empirical-bootstrap simultaneous confidence band (Figure 2).

Usage

debiased_kde(x, points = NULL, bandwidth = NULL, tau = 1,
  grid_size = 200L)

kde_confidence_band(x, points = NULL, bandwidth = NULL, tau = 1,
  confidence = 0.95, n_boot = 999L, studentized = FALSE,
  random_state = NULL, grid_size = 200L)

Arguments

x

Numeric observations or a numeric matrix with observations in rows.

points

Optional evaluation vector or matrix; required for multivariate data.

bandwidth

Positive isotropic bandwidth selected for the ordinary KDE.

tau

Positive ratio h/b; the paper recommends one.

grid_size

Generated grid size for one-dimensional data.

confidence

Confidence level strictly between zero and one.

n_boot

Positive number of empirical-bootstrap replicates.

studentized

Whether to use the variable-width band in Remark 1.

random_state

Optional local random seed; the caller's RNG state is preserved.

Value

debiased_kde() returns a di_estimate; kde_confidence_band() returns a di_band.

References

Cheng, G. and Chen, Y.-C. (2019). Nonparametric Inference via Bootstrapping the Debiased Estimator. Electronic Journal of Statistics, 13(1). \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/19-EJS1575")}.

Examples

x <- rnorm(50)
fit <- debiased_kde(x, bandwidth = 0.4)
band <- kde_confidence_band(x, bandwidth = 0.4, n_boot = 19,
                            random_state = 1)

debiasedInference documentation built on Sept. 29, 2026, 5:09 p.m.