Description Usage Arguments Value References Examples
Title Nadaraya-Watson Kernel estimator at x0
1 | NW.Kernel(Xvec, Yvec, X0, Kernel = "Ep", Bndwdth, Wt = 1)
|
Xvec, Yvec |
numeric vectors of data values, Xvec and Yvec must have the same length. |
X0 |
a given value |
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. |
Bndwdth |
a bandwidth of the kernel |
Wt |
a weight vector or a constant. For longitudinal data, Wt=1/N corresponds to measurement uniform weight and Wt=1/(nni) corresponds subject uniform weight. |
The kernel estimator at x0
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 4 | X <- seq(0, 1, len=100)
Y <- (X- 0.5)^3 - 2*(X-0.5)^2+ rnorm(100, 0, 0.1)
NW.WtKernel(X, Y, X0=0.5, Kernel="Ep", Bndwdth=0.3, Wt=1 )
NW.WtKernel(X, Y, X0=0.5, Kernel="Nm", Bndwdth=0.3, Wt=1 )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.