Description Usage Arguments Details Value Author(s) References Examples
Density functions and random generation from the distributions considered in Hazelton and Turlach (2009); details of the distributions (all Gaussian mixtures) are given on pages 221–222.
1 2 |
eval |
vector of quantiles. |
N |
number of observations to be simulated; Should be a single number. |
DEN |
density to simulate from; possible values are 1, 2, 3 and 4 corresponding to the densities described in the paper. |
sigma |
the standardard deviation of the contaminating measurement error. |
The generated random variates are from X+Z where the
distribution of X is determined by the argument DEN
and
Z has a normal distribution with mean zero and standard
deviation sigma
; X and Z are independent.
A vector with the generated random variates.
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 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ##
## Figure 1 from paper
##
opar <- par(mfrow=c(2,2))
eval1 <- seq(-4,4,length=200)
eval2 <- eval1
eval3 <- seq(-8,7,length=300)
eval4 <- seq(-2,30,length=320)
plot(eval1,dden(eval1,DEN=1),type="l",xlab="",ylab="density")
lines(eval1,dden(eval1,DEN=1,sigma=0.5),lty=3,lwd=1.25)
lines(eval1,dden(eval1,DEN=1,sigma=0.5/sqrt(2.5)),lty=2,lwd=1.25)
lines(eval1,dden(eval1,DEN=1,sigma=0.5*sqrt(2)),lty=4,lwd=1.25)
title("Density 1")
plot(eval2,dden(eval2,DEN=2),type="l",xlab="",ylab="density")
lines(eval2,dden(eval2,DEN=2,sigma=sqrt(51/300)),lty=3,lwd=1.25)
lines(eval2,dden(eval2,DEN=2,sigma=sqrt(51/300)/sqrt(2.5)),lty=2,lwd=1.25)
lines(eval2,dden(eval2,DEN=2,sigma=sqrt(51/300)*sqrt(2)),lty=4,lwd=1.25)
title("Density 2")
plot(eval3,dden(eval3,DEN=3),type="l",xlab="",ylab="density")
lines(eval3,dden(eval3,DEN=3,sigma=sqrt(1.8125)),lty=3,lwd=1.25)
lines(eval3,dden(eval3,DEN=3,sigma=sqrt(1.8125)/sqrt(2.5)),lty=2,lwd=1.25)
lines(eval3,dden(eval3,DEN=3,sigma=sqrt(1.8125)*sqrt(2)),lty=4,lwd=1.25)
title("Density 3")
plot(eval4,dden(eval4,DEN=4),type="l",xlab="",ylab="density")
lines(eval4,dden(eval4,DEN=4,sigma=sqrt(2.516)),lty=3,lwd=1.25)
lines(eval4,dden(eval4,DEN=4,sigma=sqrt(2.516)/sqrt(2.5)),lty=2,lwd=1.25)
lines(eval4,dden(eval4,DEN=4,sigma=sqrt(2.516)*sqrt(2)),lty=4,lwd=1.25)
title("Density 4")
par(opar)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.