bw.dnrd {decon} | R Documentation |
To compute the optimal bandwidth using the rule-of-thumb methods based on theorem 1 and theorem 2 of Fan (1991).
bw.dnrd(y,sig,error='normal')
y |
The observed data. It is a vector of length at least 3. |
sig |
The standard deviation(s) σ. For homoscedastic errors, sig is a single value. otherwise, sig is a vector of variances having the same length as y. |
error |
Error distribution types: 'normal', 'laplacian' for normal and Laplacian errors, respectively. |
The current version approximate the second term in the MISE by assuming that X is normally distributed. In the case of heteroscedastic error, the variance was approximated by the arithematic mean of the variances of U.
the selected bandwidth.
X.F. Wang wangx6@ccf.org
B. Wang bwang@jaguar1.usouthal.edu
Fan, J. (1991). On the optimal rates of convergence for nonparametric deconvolution problems. The Annals of Statistics, 19, 1257-1272.
Fan, J. (1992). Deconvolution with supersmooth distributions. The Canadian Journal of Statistics, 20, 155-169.
Stefanski, L. and Carroll, R. J. (1990). Deconvoluting kernel density estimators. Statistics, 21, 169-184.
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.
bw.dmise
, bw.dboot1
, bw.dboot2
.
n <- 1000 x <- c(rnorm(n/2,-2,1),rnorm(n/2,2,1)) ## the case of homoscedastic normal error sig <- .8 u <- rnorm(n, sd=sig) w <- x+u bw.dnrd(w,sig=sig) ## the case of homoscedastic laplacian error sig <- .8 ## generate laplacian errors u <- ifelse(runif(n) > 0.5, 1, -1) * rexp(n,rate=1/sig) w <- x+u bw.dnrd(w,sig=sig,error='laplacian') ## the case of heteroscedastic normal error sig <- runif(n, .7, .9) u <- sapply(sig, function(x) rnorm(1, sd=x)) w <- x+u bw.dnrd(w,sig=sig,error='normal')