
Last chance! 50% off unlimited learning
Sale ends in
To compute the conditional probability density function from data with measurement error. The measurement errors have to be homoscedastic.
DeconCPdf(y,sig,y0,error='normal',bw1='dboot1',bw2='nrd0',adjust=1,
fft=FALSE,n=512,from,to,cut=3,na.rm=FALSE,grid=100,ub=2,tol=0,...)
The observed data. It is a vector of length at least 3.
The standard deviations
The given conditional data point in the conditional density f(x|y=y0).
Error distribution types: (1) 'normal' for normal errors; (2) 'laplacian' for Laplacian errors; (3) 'snormal' for a special case of small normal errors.
The bandwidth for the deconvolution density
The bandwidth for the kernel density
adjust the range there the PDF is to be evaluated. By default,
To specify the method to compute the PDF. 'fft=FALSE' to compute directly; 'fft=TRUE' to compute the PDF by using the Fast Fourier Transformation.
number of points where the conditional PDF is to be evaluated.
the starting point where the conditional PDF is to be evaluated.
the starting point where the conditional PDF is to be evaluated.
used to adjust the starting end ending points where the conditional PDF is to be evaluated.
is set to FALSE by default: no NA value is allowed.
the grid number to search the optimal bandwidth when a bandwidth selector was specified in bw. Default value "grid=100".
the upper boundary to search the optimal bandwidth, default value is "ub=2".
the parameter to avoid the estimate of f(y|x) too small. The default vaule is 0. It can not exceed 0.05.
control
An object of class ``Decon''.
If the number of points to be evaluated is too small (less than 32), a direct computing method is preferred. The current version can support up to
Fan, J. (1991). On the optimal rates of convergence for nonparametric deconvolution problems. The Annals of Statistics, 19, 1257-1272.
Wang XF, Ye D (2010). Conditional density estimation with measurement error. Technical Report.
Wang, X.F. and Wang, B. (2011). Deconvolution estimation in measurement error models: The R package decon. Journal of Statistical Software, 39(10), 1-24.
# NOT RUN {
n <- 100
x <- c(rnorm(n/2,-2,1),rnorm(n/2,2,1))
sig <- .8
u <- rnorm(n,sd=sig)
w <- x+u
f1 <- DeconCPdf(w,sig, y0=-2.5, error='normal')
#f2 <- DeconCPdf(w,sig, y0=0, error='normal')
#f3 <- DeconCPdf(w,sig, y0=2.5, error='normal')
#par(mfrow=c(2,2))
plot(density(w), main="f_w", xlab="w")
plot(f1, main="f1", xlab="x")
#plot(f2, main="f2", xlab="x")
#plot(f3, main="f3", xlab="x")
# }
Run the code above in your browser using DataLab