One gridpoint within the range of x variables. A set of gridpoints can be achieved by looping this function.
x
A set of x observations.
y
A set of y observations.
h
Optimal bandwidth chosen by the user.
Value
Density value
Details
$\frac{1}{h}\sum^n_{i=1}[\int^{s_i}_{s_{i-1}}K(\frac{x-u}{h})du]y_i$,
where
$s_i=\frac{x_{i-1}+x_i}{2}$.
References
T. Gasser, H-G. Muller and V. Mammitzsch (1985), Kernels for nonparametric curve estimation, Journal of the Royal Statistical Society (Series B), 47(2), 238-252.
Q. Li and J. S. Racine (2007), Nonparametric econometrics: Theory and Practice. Princeton University Press.
J. S. Simonoff (1996), Smoothing methods in Statistics, Springer.