Learn R Programming

decon (version 1.3-4)

bw.dnrd: A rule of thumb bandwidth selection in denconvolution problems

Description

To compute the optimal bandwidth using the rule-of-thumb methods based on theorem 1 and theorem 2 of Fan (1991).

Usage

bw.dnrd(y,sig,error='normal')

Arguments

y

The observed data. It is a vector of length at least 3.

sig

The standard deviation(s) \(\sigma\). 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.

Value

the selected bandwidth.

Details

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\).

References

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.

See Also

bw.dmise, bw.dboot1, bw.dboot2.

Examples

Run this code
# NOT RUN {
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')
# }

Run the code above in your browser using DataLab