NW.fit {sharpData}R Documentation

Nadaraya-Watson Regression Estimation

Description

This computes the Nadaraya-Watson local constant regression estimator at a single point. For multiple points, it is not efficient.

Usage

NW.fit(x, y, xgrid, h, kernel)

Arguments

x

numeric explanatory vector

y

numeric response vector

xgrid

numeric vector

h

numeric bandwidth

kernel

character constant

Value

a vector of predictor values

Author(s)

W.J. Braun

References

Wand and Jones, 1996, Kernel Smoothing, Chapman and Hall.

See Also

locpoly

Examples

x <- sort(runif(100))
y <- x + sin(x) + rnorm(100)*.1
NW.fit(x,y,c(.3, .5, .7),h=.1)

[Package sharpData version 1.2 Index]