deheap_kde: Tuning-free de-heaping density estimator (box deconvolution +...

View source: R/adheaping.R

deheap_kdeR Documentation

Tuning-free de-heaping density estimator (box deconvolution + residue-floor Wiener).

Description

Rounding to grid D is convolution of the density with a width-D box followed by lattice sampling; in the identifiable band |w| < pi/D the empirical characteristic function is divided by sinc(wD/2) (de-Sheppard) and Wiener-tapered against the sampling floor 1/n, amplified by the deconvolution. No bandwidth is chosen by hand.

Usage

deheap_kde(y, D, grid)

Arguments

y

heaped (rounded) sample.

D

grid width.

grid

evaluation grid (equally spaced).

Value

Density values on grid.

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 <- deheap_kde(0.5 * round(x / 0.5), 0.5, grid)

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