Description Usage Arguments Value Author(s) References See Also Examples
Evaluates the cross-validation criterion (11) of Hazelton and Turlach (2009).
1 2 |
y |
the observed values. |
sigma |
the standard deviation of the contaminating (normal) distribution. |
h |
the smoothing parameter to be used. |
gamma |
vector of values from which a suitable value is to be selected |
METHOD |
method to be used to solve the quadratic programming
problem involved in calculating the weights; if |
K |
number of folds to be used if |
verb |
logical; if |
A vector containing the cross-validation criterion evaluated at the
values given in gamma
.
Berwin A Turlach Berwin.Turlach@gmail.com
Hazelton, M.L. and Turlach, B.A. (2009). Nonparametric density deconvolution by weighted kernel estimators, Statistics and Computing 19(3): 217–228. http://dx.doi.org/10.1007/s11222-008-9086-7.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | set.seed(100719)
sig <- sqrt(29/40) # Var(Z)/Var(X) = 0.1
y <- rden(100, DEN=3, sigma=sig)
h <- bw.SJ(y, method="dpi")
gamma.ridge <- exp(seq(from=0, to=6, length=17))
save.seed <- .Random.seed
cv1 <- cv.score(y, sigma=sig, h=h, gamma=gamma.ridge,
METHOD="exact", verb=TRUE)
plot(log(gamma.ridge), cv1, type="b")
tmp <- getmin(log(gamma.ridge), cv1, which="r")
abline(v=tmp$xmin)
.Random.seed <- save.seed
cv2 <- cv.score(y, sigma=sig, h=h, gamma=gamma.ridge,
METHOD="svm", verb=TRUE)
plot(log(gamma.ridge), cv2, type="b")
tmp <- getmin(log(gamma.ridge), cv2, which="r")
abline(v=tmp$xmin)
.Random.seed <- save.seed
cv1 <- cv.score(y, sigma=sig, h=h, gamma=gamma.ridge,
METHOD="exact", K=10, verb=TRUE)
plot(log(gamma.ridge), cv1, type="b")
tmp <- getmin(log(gamma.ridge), cv1, which="r")
abline(v=tmp$xmin)
.Random.seed <- save.seed
cv2 <- cv.score(y, sigma=sig, h=h, gamma=gamma.ridge,
METHOD="svm", K=10, verb=TRUE)
plot(log(gamma.ridge), cv2, type="b")
tmp <- getmin(log(gamma.ridge), cv2, which="r")
abline(v=tmp$xmin)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.