powered by
Functions for computing smoothing matrices and applying kernel smoothing to functional data. Nadaraya-Watson Kernel Smoother Matrix
S.NW(tt, h, Ker = "norm", w = NULL, cv = FALSE)
An n x n smoother matrix S such that smooth(y) = S %*% y.
Evaluation points (numeric vector).
Bandwidth parameter.
Kernel function or name. One of "norm", "epa", "tri", "quar", "cos", "unif", or a custom function.
Optional weights vector of length n.
Logical. If TRUE, compute leave-one-out cross-validation matrix (diagonal is zero).
Compute the Nadaraya-Watson kernel smoother matrix.
tt <- seq(0, 1, length.out = 50) S <- S.NW(tt, h = 0.1) dim(S) # 50 x 50
Run the code above in your browser using DataLab