powered by
Compute leave-one-out cross-validation criterion for a smoother.
CV.S(S.type, tt, h, y, Ker = "norm", w = NULL)
The cross-validation score (mean squared prediction error).
Function to compute smoother matrix (e.g., S.NW, S.LLR).
Evaluation points.
Bandwidth parameter.
Response vector to smooth.
Kernel type.
Optional weights.
tt <- seq(0, 1, length.out = 50) y <- sin(2 * pi * tt) + rnorm(50, sd = 0.1) cv_score <- CV.S(S.NW, tt, h = 0.1, y = y)
Run the code above in your browser using DataLab