Description Usage Arguments See Also Examples
rmse_cv
computes the leave-one-out RMSE for a single vector of
bandwidths, rmse_cvs
computes for a multiple vectors of bandwidths,
stored as a data frame.
1 2 3 |
x |
condensed summary table |
... |
other variables passed on to |
h,hs |
for |
var |
variable to smooth |
Other bandwidth estimation functions: best_h
;
h_grid
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | set.seed(1014)
# 1d -----------------------------
x <- rchallenge(1e4)
xsum <- condense(bin(x, 1 / 10))
cvs <- rmse_cvs(xsum)
if (require("ggplot2")) {
autoplot(xsum)
qplot(x, err, data = cvs, geom = "line")
xsmu <- smooth(xsum, 1.3)
autoplot(xsmu)
autoplot(peel(xsmu))
}
# 2d -----------------------------
y <- runif(1e4)
xysum <- condense(bin(x, 1 / 10), bin(y, 1 / 100))
cvs <- rmse_cvs(xysum, h_grid(xysum, 10))
if (require("ggplot2")) {
qplot(x, y, data = cvs, size = err)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.