ksmooth {stats}
Description
The Nadaraya--Watson kernel regression estimate.
Usage
ksmooth(x, y, kernel = c("box", "normal"), bandwidth = 0.5,
range.x = range(x),
n.points = max(100, length(x)), x.points)
Arguments
- x
- input x values
- y
- input y values
- kernel
- the kernel to be used.
- bandwidth
- the bandwidth. The kernels are scaled so that their quartiles (viewed as probability densities) are at +/-
0.25*bandwidth. - range.x
- the range of points to be covered in the output.
- n.points
- the number of points at which to evaluate the fit.
- x.points
- points at which to evaluate the smoothed fit. If missing,
n.pointsare chosen uniformly to coverrange.x.
Values
A list with components
- x
- values at which the smoothed fit is evaluated. Guaranteed to be in increasing order.
- y
- fitted values corresponding to
x.
Note
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.
Examples
Documentation reproduced from R 2.15.3. License: GPL-2.
