Skip to contents

Fits a local LINE, making the bias O(h^2) uniformly INCLUDING at the boundary – the automatic boundary correction that motivates preferring it to Nadaraya-Watson. The local slope estimates m'(x) for free. Mirrors morie.fn.hrzllr.

Usage

morie_local_linear(x, y, grid = NULL, h = NULL)

Arguments

x, y

numeric regressor and response.

grid

evaluation points.

h

bandwidth.

Value

list: grid, fitted, slope, bandwidth, n.

References

Horowitz, Ch. 2.

Examples

set.seed(1)
morie_local_linear(runif(200), runif(200))$bandwidth
#> [1] 0.09883285