adkde: Combined AD heaping-KDE: band-capacity gate selects de-heap /...

View source: R/adheaping.R

adkdeR Documentation

Combined AD heaping-KDE: band-capacity gate selects de-heap / superposition / iterated.

Description

The single tuning-free estimator. A band-capacity statistic (de-heaped in-band power in the outer quarter of the identifiable band) selects the de-heaping estimator when the density fits inside the band, the superposition when it exceeds the band, and the iterated superposition at the coarsest grids.

Usage

adkde(y, D, grid, rho_lo = 0.06, rho_hi = 0.14, seed = 20260627)

Arguments

y

heaped (rounded) sample.

D

grid width.

grid

evaluation grid (equally spaced).

rho_lo, rho_hi

band-capacity thresholds selecting the component.

seed

random seed passed to the superposition components.

Value

Density values on grid, with attributes pick (the selected component) and rho (the band-capacity statistic).

Examples

grid <- seq(-6, 6, length.out = 1024)
x <- ifelse(runif(2000) < 0.5, rnorm(2000, -1.2, 0.5), rnorm(2000, 1.2, 0.5))
f <- adkde(0.5 * round(x / 0.5), 0.5, grid)
attr(f, "pick")

adheaping documentation built on Sept. 18, 2026, 1:06 a.m.