Skip to contents

The explicit estimator behind morie_average_derivative. Two details carry the root-n property: the density derivative is computed LEAVE-ONE-OUT, and the bandwidth must UNDERSMOOTH relative to the density-optimal choice so the bias vanishes faster than \(n^{-1/2}\). A density-optimal bandwidth leaves a bias of the same order as the standard error, and the confidence interval is then centred on the wrong value. Mirrors morie.fn.hrzades.

Usage

morie_average_derivative_hat(X, y, h = NULL)

Arguments

X

numeric vector or matrix of covariates.

y

numeric response.

h

bandwidth; an undersmoothed default when NULL.

Value

list: delta_hat, se, bandwidth, undersmoothed, n, method.

References

Horowitz, Ch. 2, Sec. 2.6.1-2.6.2.

Examples

set.seed(1)
x <- rnorm(300)
morie_average_derivative_hat(x, 2 * x)$undersmoothed
#> [1] TRUE