Local polynomials smoothing
Predicted values from a local polynomials of degree less than 2.
Missing values are not allowed.
npregress(x, y, criterion="rmse", bandwidth=NULL,kernel="g", control.par=list(), cv.options=list())
x |
A numeric vector of explanatory variable of length n. |
y |
A numeric vector of variable to be explained of length n. |
criterion |
Character string. If the bandwidth
( |
bandwidth |
The kernel bandwidth smoothing parameter (a numeric vector of either length 1). |
kernel |
Character string which allows to choose between gaussian kernel
( |
control.par |
A named list that control optional parameters. The
two components are |
cv.options |
A named list which controls the way to do cross
validation with component |
Returns an object of class npregress
which is a list including:
bandwidth |
The kernel bandwidth smoothing parameter. |
residuals |
Vector of residuals. |
fitted |
Vector of fitted values. |
df |
The effective degree of freedom of the smoother. |
call |
A list containing four components: |
criteria |
either a named list containing the bandwidth search
grid and all the criteria ( |
Pierre-Andre Cornillon, Nicolas Hengartner and Eric Matzner-Lober.
Wand, M. P. and Jones, M. C. (1995). Kernel Smoothing. Chapman and Hall, London.
f <- function(x){sin(5*pi*x)} n <- 100 x <- runif(n) z <- f(x) sigma2 <- 0.05*var(z) erreur <- rnorm(n,0,sqrt(sigma2)) y <- z+erreur res <- npregress(x,y,bandwidth=0.02) summary(res) ord <- order(x) plot(x,y) lines(x[ord],predict(res)[ord])
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.