Description Usage Arguments Value Author(s) References See Also Examples
Routine to calculate the weights for deconvolution via weighted kernel density estimates.
1 2 |
y |
the observed, contaminated data. |
sigma |
the standard deviation of the contaminating (normal) distribution. |
h |
the bandwidth to be used for the weighted kernel density
estimate; if missing the bandwidth returned by |
gamma |
the regularisation parameter to be used; either a scalar
for methods |
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 weights; if gamma
is chosen by
cross-validation, the selected value is returned as an attribute.
Martin L Hazelton m.hazelton@massey.ac.nz
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 | set.seed(100719)
sig <- sqrt(29/40) # Var(Z)/Var(X) = 0.1
y <- rden(100, DEN=3, sigma=sig)
gamma.ridge <- exp(seq(from=0, to=6, length=17))
save.seed <- .Random.seed
w1 <- w.hat(y, sigma=sig, gamma=gamma.ridge,
METHOD="exact.cv", verb=TRUE)
plot(y, w1, type="h")
attributes(w1)
.Random.seed <- save.seed
w2 <- w.hat(y, sigma=sig, gamma=gamma.ridge,
METHOD="svm.cv", verb=TRUE)
plot(y, w2, type="h")
attributes(w2)
.Random.seed <- save.seed
w1 <- w.hat(y, sigma=sig, gamma=gamma.ridge,
METHOD="exact.cv", K=10, verb=TRUE)
plot(y, w1, type="h")
attributes(w1)
.Random.seed <- save.seed
w2 <- w.hat(y, sigma=sig, gamma=gamma.ridge,
METHOD="svm.cv", K=10, verb=TRUE)
plot(y, w2, type="h")
attributes(w2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.