The Nadaraya--Watson kernel regression estimate.
ksmooth(x, y, kernel = c("box", "normal"), bandwidth = 0.5, range.x = range(x), n.points = max(100, length(x)), x.points)
- input x values
- input y values
- the kernel to be used.
- the bandwidth. The kernels are scaled so that their quartiles (viewed as probability densities) are at +/-
- the range of points to be covered in the output.
- the number of points at which to evaluate the fit.
- points at which to evaluate the smoothed fit. If missing,
n.pointsare chosen uniformly to cover
A list with components
- values at which the smoothed fit is evaluated. Guaranteed to be in increasing order.
- fitted values corresponding to
This function is implemented purely for compatibility with S, although it is nowhere near as slow as the S function. Better kernel smoothers are available in other packages.
Documentation reproduced from R 2.15.3. License: GPL-2.