powered by
This computes the Nadaraya-Watson local constant regression estimator at a single point. For multiple points, it is not efficient.
NW.fit(x, y, xgrid, h, kernel)
numeric explanatory vector
numeric response vector
numeric vector
numeric bandwidth
character constant
a vector of predictor values
Wand and Jones, 1996, Kernel Smoothing, Chapman and Hall.
locpoly
# NOT RUN { x <- sort(runif(100)) y <- x + sin(x) + rnorm(100)*.1 NW.fit(x,y,c(.3, .5, .7),h=.1) # }
Run the code above in your browser using DataLab