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

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/bwdnrd.R

Description

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

Usage

1
 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) σ. 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.

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.

Value

the selected bandwidth.

Author(s)

X.F. Wang [email protected]

B. Wang [email protected]

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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')

decon documentation built on May 30, 2017, 7:57 a.m.