NW.WtKernel {npmlda}R Documentation

Title Nadaraya-Watson Kernel estimator at x0

Description

Title Nadaraya-Watson Kernel estimator at x0

Usage

NW.WtKernel(Xvec, Yvec, X0, Kernel = "Ep", Bndwdth, Wt = 1)

Arguments

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.

Value

The kernel estimator at x0

References

  1. Fan, J. and Gijbels, I. Local Polynomial Modeling and Its Applications. Chapman & Hall, London, United Kingdom, 1996.

  2. Wu, C.O. and Tian, X. Nonparametric Models for Longitudinal Data. Chapman & Hall/CRC. To appear.

Examples

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 )

[Package npmlda version 1.0.0 Index]