Description Usage Arguments Details Value Author(s) References See Also Examples
Calculates a weighted kernel density estimate as defined by equation (5) of Hazelton and Turlach (2009).
1 |
y |
the observed values. |
eval |
grid on which the deconvolution density estimate is to be calculated. |
w |
the weights to be used. |
h |
the smoothing parameter to be used. |
If "eval"
is not specified, it defaults to
seq(min(y)-0.1*sd(y), max(y)+0.1*sd(y), length=100)
.
If "w"
is not specified, it defaults to a vector of ones.
If "h"
is not specified, it defaults to bw.SJ(y, method="dpi")
.
A matrix with two columns named "x"
and "y"
; the first
column contains the evaluation grid, "eval"
, and the second
column the deconvolution density estimate.
Martin L Hazelton m.hazelton@massey.ac.nz
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 | set.seed(100719)
sig <- sqrt(29/40) # Var(Z)/Var(X) = 0.1
y <- rden(100, DEN=3, sigma=sig)
f.hat <- wkde(y)
plot(f.hat, type="l", ylim=c(0, 0.2))
w <- w.hat(y, sigma=sig, gamma=2.05)
fd.hat <- wkde(y, w=w)
lines(fd.hat, col="red")
w <- w.hat(y, sigma=sig, gamma=4.4)
fd.hat <- wkde(y, w=w)
lines(fd.hat, col="blue")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.