Skip to contents

\(\hat f(x) = (nh)^{-1}\sum K((x - X_i)/h)\). The MISE-optimal bandwidth is of order \(n^{-1/5}\), giving the \(n^{-2/5}\) rate – slower than parametric and not improvable for a twice-differentiable density, which is why the book builds root-n functionals of this object rather than using it directly. Mirrors morie.fn.hrzkde.

Usage

morie_kde_h(x, grid = NULL, h = NULL)

Arguments

x

numeric sample.

grid

evaluation points; a spanning grid when NULL.

h

bandwidth; .hrz_silverman when NULL.

Value

list: grid, density, bandwidth, rate_exponent, n.

References

Horowitz, J. L. Semiparametric and Nonparametric Methods in Econometrics. Springer. Appendix (pp. 233-255, KDE).

Examples

set.seed(1)
morie_kde_h(rnorm(200))$bandwidth
#> [1] 0.3340973