powered by
Find the optimal bandwidth by minimizing CV or GCV criterion.
optim.np( fdataobj, S.type, h.range = NULL, criterion = "GCV", Ker = "norm", ... )
A list with optimal bandwidth and CV/GCV score.
An fdata object.
Smoother function (S.NW, S.LLR, etc.).
Range of bandwidths to search (default: data-driven).
"CV" or "GCV".
Kernel type.
Additional arguments passed to optimizer.
tt <- seq(0, 1, length.out = 50) y <- sin(2 * pi * tt) + rnorm(50, sd = 0.1) fd <- fdata(matrix(y, nrow = 1), argvals = tt) result <- optim.np(fd, S.NW)
Run the code above in your browser using DataLab