kre(x, y, h, kernel = c("epan", "unif", "tria", "quar", "triw", "tric", "gaus", "cos"), plot = FALSE)"unif" (uniform), "tria" (triangular), "epan" (epanechnikov), "quar" (quartic), "triw" (triweight), "tric" (tricube), "gaus" (gaussian) and "cos" (cosine). The default is "epan". x (first column), the original data of response variable y (second column), and the fitted values of response yhat (third column). Li, Q., Racine, J. (2007). Nonparametric Econometrics: Theory and Practice. Princeton University Press. ISBN 0-691-12161-3.
Nadaraya, E. A. (1964). On Estimating Regression. Theory of Probability and its Applications 9(1): 141-2.
x <- rnorm(100)
y <- 1 + 4*x^2 + rnorm(100)
kr <- kre(x,y, kernel = "epan", plot = TRUE)
Run the code above in your browser using DataLab