Description Usage Arguments References Examples
Nadaraya-Watson Kernel estimator
1 | kernel.fit(Xint, Xvec, Yvec, bw, Kernel = "Ep", Wt = 1)
|
Xint |
a vector of x interval to generate the local linear fit |
Xvec, Yvec |
numeric vectors of data values, Xvec and Yvec must have the same length. |
bw |
a bandwidth of the kernel |
Kernel |
a character string indicating which kernel function is to be used. Use of "Ep", "Bw", or "Nm" for Epanechnikov, Biweight or Normal kernel function. |
Wt |
a weight vector |
Fan, J. and Gijbels, I. Local Polynomial Modeling and Its Applications. Chapman & Hall, London, United Kingdom, 1996.
Wu, C.O. and Tian, X. Nonparametric Models for Longitudinal Data. Chapman & Hall/CRC. To appear.
1 2 3 | X <- seq(0, 1, len=100)
Y <- (X- 0.5)^3 - 2*(X-0.5)^2+ rnorm(100, 0, 0.1)
kernel.fit(seq(0,1,0.1), X, Y, Kernel="Ep", bw=0.1, Wt=1 )
|
[1] -0.563036954 -0.386253181 -0.186116970 -0.103224562 0.008686797
[6] 0.043631208 0.015269123 -0.051506490 -0.150086240 -0.266147667
[11] -0.325700692
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.